Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f42d63e93c | ||
|
|
1aa6016f1e | ||
|
|
055e63d1a0 | ||
|
|
d955edce80 | ||
|
|
4b4daa42cf | ||
|
|
5eb341ca72 | ||
|
|
b9c5337032 |
No files matched your search
+16
-2
@@ -29,8 +29,8 @@ android {
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.aoleyun.sn"
|
||||
versionCode 208
|
||||
versionName "1.6.0317"
|
||||
versionCode 214
|
||||
versionName "1.6.0427"
|
||||
|
||||
//There are no CERT files because If the mini sdk version is 23+, the AGP will ignore the V1 scheme signature.
|
||||
minSdkVersion 24
|
||||
@@ -282,6 +282,20 @@ android {
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
QualcommDebug.initWith(debug)
|
||||
QualcommDebug {
|
||||
buildConfigField "String", "platform", '"QualcommA"'
|
||||
versionNameSuffix "-debug"
|
||||
debuggable true
|
||||
signingConfig signingConfigs.zhanRui
|
||||
}
|
||||
|
||||
QualcommRelease.initWith(release)
|
||||
QualcommRelease {
|
||||
buildConfigField "String", "platform", '"QualcommA"'
|
||||
signingConfig signingConfigs.zhanRui
|
||||
}
|
||||
|
||||
G128TDebug.initWith(debug)
|
||||
G128TDebug {
|
||||
buildConfigField "String", "platform", '"G128T"'
|
||||
|
||||
@@ -25,7 +25,6 @@ import com.aoleyun.sn.BuildConfig;
|
||||
import com.aoleyun.sn.R;
|
||||
import com.aoleyun.sn.activity.main.MainActivity;
|
||||
import com.aoleyun.sn.comm.CommonConfig;
|
||||
import com.aoleyun.sn.comm.JGYActions;
|
||||
import com.aoleyun.sn.comm.PackageNames;
|
||||
import com.aoleyun.sn.network.NetInterfaceManager;
|
||||
import com.aoleyun.sn.service.LogcatService;
|
||||
@@ -101,7 +100,7 @@ public class SplashActivity extends AppCompatActivity {
|
||||
Utils.getAndroiodScreenProperty(SplashActivity.this);
|
||||
Log.e(TAG, "getOperators: " + NetworkUtils.getOperators(this));
|
||||
Log.e(TAG, "PublicIP: " + mMMKV.decodeString(NetInterfaceManager.PublicIP, ""));
|
||||
NetInterfaceManager.GetWhois();
|
||||
NetInterfaceManager.getWhois();
|
||||
Log.e(TAG, "initView: " + NetworkUtils.getPhoneNumber(this));
|
||||
FlowInfo flowInfo1 = GetFlowUtil.getAppFlowInfo(BuildConfig.APPLICATION_ID, this);
|
||||
Log.e(TAG, "initView: " + GetFlowUtil.byteToMB(flowInfo1.getUpKb()));
|
||||
@@ -171,7 +170,7 @@ public class SplashActivity extends AppCompatActivity {
|
||||
Log.e(TAG, "getCustomVersion: " + Utils.getCustomVersion());
|
||||
Log.e(TAG, "getRomVersion: " + Utils.getRomVersion());
|
||||
Log.i(TAG, "debugTest: " + BuildConfig.VERSION_NAME);
|
||||
Log.i(TAG, "debugTest: " + Utils.getAPPVersionName(PackageNames.APPSTORE, this));
|
||||
Log.i(TAG, "debugTest: " + Utils.getAppVersionName(PackageNames.APPSTORE, this));
|
||||
Log.i(TAG, "debugTest: " + Utils.getAndroid7MAC());
|
||||
Log.i(TAG, "debugTest: launcher3 " + JgyUtils.getInstance().getStartClassName("com.android.launcher3"));
|
||||
// try {
|
||||
|
||||
@@ -141,10 +141,8 @@ public class MainViewModel extends BaseViewModel<ActivityMainBinding, ActivityEv
|
||||
public MutableLiveData<JsonObject> mUpdateInfoData = new MutableLiveData<>();
|
||||
|
||||
public void checkUpdateInfo() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getUpdateApi()
|
||||
.getUpdate(BuildConfig.APPLICATION_ID,
|
||||
JgyUtils.getInstance().checkAppPlatform())
|
||||
NetInterfaceManager.getInstance().getAppDownloadApi()
|
||||
.getUpdate(BuildConfig.APPLICATION_ID, JgyUtils.getInstance().checkAppPlatform())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
@@ -222,7 +220,7 @@ public class MainViewModel extends BaseViewModel<ActivityMainBinding, ActivityEv
|
||||
|
||||
} else {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getDefaultDesktop( getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
.getDefaultDesktop(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
@@ -292,7 +290,7 @@ public class MainViewModel extends BaseViewModel<ActivityMainBinding, ActivityEv
|
||||
|| "HT01".equals(Build.MODEL)) {
|
||||
mShowPanel.setValue(true);
|
||||
} else if ("G10-M".equals(Build.MODEL)
|
||||
||"Ebox201W".equals(Build.MODEL)) {
|
||||
|| "Ebox201W".equals(Build.MODEL)) {
|
||||
mShowPanel.setValue(false);
|
||||
}
|
||||
|
||||
@@ -345,7 +343,7 @@ public class MainViewModel extends BaseViewModel<ActivityMainBinding, ActivityEv
|
||||
});
|
||||
}
|
||||
|
||||
public void getPushTags(){
|
||||
public void getPushTags() {
|
||||
NetInterfaceManager.getInstance().setPushTags(getLifecycle(), new NetInterfaceManager.PushTagCallback() {
|
||||
@Override
|
||||
public void setPushTag(String tag) {
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.aoleyun.sn.base;
|
||||
|
||||
import android.app.Service;
|
||||
import android.content.Intent;
|
||||
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
import androidx.lifecycle.LifecycleRegistry;
|
||||
|
||||
import com.trello.rxlifecycle4.LifecycleProvider;
|
||||
import com.trello.rxlifecycle4.LifecycleTransformer;
|
||||
import com.trello.rxlifecycle4.RxLifecycle;
|
||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||
import com.trello.rxlifecycle4.android.RxLifecycleAndroid;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import io.reactivex.rxjava3.subjects.BehaviorSubject;
|
||||
|
||||
public abstract class BaseService extends Service implements LifecycleProvider<ActivityEvent>, LifecycleOwner {
|
||||
|
||||
private final BehaviorSubject<ActivityEvent> lifecycleSubject = BehaviorSubject.create();
|
||||
|
||||
public BehaviorSubject<ActivityEvent> getLifecycleSubject() {
|
||||
return lifecycleSubject;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final Observable<ActivityEvent> lifecycle() {
|
||||
return lifecycleSubject.hide();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final <T> LifecycleTransformer<T> bindUntilEvent(ActivityEvent event) {
|
||||
return RxLifecycle.bindUntilEvent(lifecycleSubject, event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final <T> LifecycleTransformer<T> bindToLifecycle() {
|
||||
return RxLifecycleAndroid.bindActivity(lifecycleSubject);
|
||||
}
|
||||
|
||||
private final LifecycleRegistry lifecycleRegistry = new LifecycleRegistry(this);
|
||||
|
||||
@Override
|
||||
public Lifecycle getLifecycle() {
|
||||
return lifecycleRegistry;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
lifecycleSubject.onNext(ActivityEvent.CREATE);
|
||||
lifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_CREATE);
|
||||
//修补在Service中LiveData不能触发
|
||||
lifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_START);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
lifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_RESUME);
|
||||
return super.onStartCommand(intent, flags, startId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
lifecycleSubject.onNext(ActivityEvent.DESTROY);
|
||||
lifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_DESTROY);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.aoleyun.sn.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class TimeControlApp implements Serializable {
|
||||
private static final long serialVersionUID = 5184143240402181001L;
|
||||
|
||||
String app_package;
|
||||
String app_name;
|
||||
|
||||
public String getApp_package() {
|
||||
return app_package;
|
||||
}
|
||||
|
||||
public void setApp_package(String app_package) {
|
||||
this.app_package = app_package;
|
||||
}
|
||||
|
||||
public String getApp_name() {
|
||||
return app_name;
|
||||
}
|
||||
|
||||
public void setApp_name(String app_name) {
|
||||
this.app_name = app_name;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.aoleyun.sn.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public class TimeControlData implements Serializable {
|
||||
private static final long serialVersionUID = 8902745668847718218L;
|
||||
|
||||
List<TimeControlInfo> periods;
|
||||
|
||||
public List<TimeControlInfo> getPeriods() {
|
||||
return periods;
|
||||
}
|
||||
|
||||
public void setPeriods(List<TimeControlInfo> periods) {
|
||||
this.periods = periods;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.aoleyun.sn.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public class TimeControlInfo implements Serializable {
|
||||
private static final long serialVersionUID = 4988631077105878200L;
|
||||
|
||||
String start_time;
|
||||
String end_time;
|
||||
List<TimeControlApp> app;
|
||||
|
||||
public String getStart_time() {
|
||||
return start_time;
|
||||
}
|
||||
|
||||
public void setStart_time(String start_time) {
|
||||
this.start_time = start_time;
|
||||
}
|
||||
|
||||
public String getEnd_time() {
|
||||
return end_time;
|
||||
}
|
||||
|
||||
public void setEnd_time(String end_time) {
|
||||
this.end_time = end_time;
|
||||
}
|
||||
|
||||
public List<TimeControlApp> getApp() {
|
||||
return app;
|
||||
}
|
||||
|
||||
public void setApp(List<TimeControlApp> app) {
|
||||
this.app = app;
|
||||
}
|
||||
}
|
||||
@@ -91,6 +91,9 @@ public class CommonConfig {
|
||||
|
||||
/*壁纸地址*/
|
||||
public static final String WALLPAPER_URL_KEY = "wallpaper_url";
|
||||
/*时间管控json*/
|
||||
public static final String TIME_CONTROL_DATA_KEY = "time_dontrol_data_json_string";
|
||||
|
||||
|
||||
/**
|
||||
* 管控系统指令
|
||||
@@ -112,6 +115,8 @@ public class CommonConfig {
|
||||
public final static String AOLE_APP_ALLOW_INSTALL = "aole_app_allow_install";
|
||||
/*应用安装白名单*/
|
||||
public final static String AOLE_ACTION_APP_FORBID = "aole_app_forbid";
|
||||
/*公共应用白名单*/
|
||||
public final static String AOLE_PUBLIC_APP_INSTALL_WHITELIST = "aole_public_app_install_whitelist_set";
|
||||
/*强制安装应用,禁止卸载*/
|
||||
public final static String AOLE_ACTION_FORCE_APP = "aole_force_app";
|
||||
/*指定应用安装源 非指定包名不能安装apk*/
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.util.Log;
|
||||
|
||||
import com.aoleyun.sn.comm.CommonConfig;
|
||||
import com.aoleyun.sn.utils.JgyUtils;
|
||||
import com.hjq.toast.Toaster;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
|
||||
public class AoleyunActivityController extends IActivityController.Stub {
|
||||
@@ -20,10 +21,15 @@ public class AoleyunActivityController extends IActivityController.Stub {
|
||||
// return false;
|
||||
// }
|
||||
|
||||
//false 则不会启动,直接返回。
|
||||
if (JgyUtils.getInstance().isCloudLessonMod(pkg)) {
|
||||
return true;
|
||||
if (JgyUtils.getInstance().checkTimePeriod(pkg)) {
|
||||
//false 则不会启动,直接返回。
|
||||
if (JgyUtils.getInstance().isCloudLessonMod(pkg)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
Toaster.show("专注模式只允许使用指定应用");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -13,6 +13,14 @@ public class UrlAddress {
|
||||
public static final String GET_DEVICES_LOCKED = "lock/index";
|
||||
/*获取设备标签*/
|
||||
public static final String GET_DEVICES_TAGS = "Sn/getSnTag";
|
||||
/*通过sn获取信息*/
|
||||
public static final String GET_STUDENTS_INFO = "Sn/getStudent";
|
||||
/*获取霸屏状态*/
|
||||
public static final String GET_LOCK_SCREEN_STATE = "Sn/getSnScreen";
|
||||
/*开发人员选项开关*/
|
||||
public static final String GET_DEVELOPER = "Sn/getDeveloper";
|
||||
/*获取电子书包激活码*/
|
||||
public static final String GET_EBAG_CODE = "And/getEbagCode";
|
||||
/*绑定设备*/
|
||||
public static final String SN_CONFIRM_BIND = "And/sn/snConfirmBind";
|
||||
|
||||
@@ -32,6 +40,9 @@ public class UrlAddress {
|
||||
public static final String CHECK_UPDATE = "Silent/silent";
|
||||
/*获取测试app*/
|
||||
public static final String GET_SN_APP_TEST = "Sn/getSnAppTest";
|
||||
/*强制安装应用 不允许卸载*/
|
||||
public static final String GET_FORCE_INSTALL_LIST = "forceinstall/index";
|
||||
|
||||
/*电子围栏*/
|
||||
public static final String GET_SN_EFENCE = "android/sn/efence";
|
||||
|
||||
@@ -39,13 +50,16 @@ public class UrlAddress {
|
||||
public static final String SET_WHITE_PACKAGE_LIST = "firmware/index";
|
||||
/*获取全部应用*/
|
||||
public static final String GET_ALL_APP = "recommend/index";
|
||||
/*强制安装应用*/
|
||||
public static final String GET_FORCE_INSTALL_LIST = "forceinstall/index";
|
||||
/*应用管控的应用*/
|
||||
public static final String GET_ADMIN_APP = "And/app/getAdminApp";
|
||||
/*公共应用*/
|
||||
public static final String HTTP_TAG_COMMOAPP = "Rank/commonApp";
|
||||
/*通过固件名获取内置应用*/
|
||||
@Deprecated
|
||||
public static final String GET_ROM_APP = "And/getFirmwareApp";
|
||||
/*分组应用强制安装*/
|
||||
public static final String GROUP_APP_INSTALL_LIST = "forceinstall/group-app";
|
||||
|
||||
/*通过固件名获取内置应用*/
|
||||
public static final String GET_ROM_APP = "And/getFirmwareApp";
|
||||
/*获取应用升级自启*/
|
||||
public static final String NET_AND_LAUNCH_API = "automatic/get";
|
||||
/*获取禁用的app包名*/
|
||||
@@ -56,8 +70,7 @@ public class UrlAddress {
|
||||
public static final String GET_APPID = "application/index";
|
||||
/*app内部网页管控*/
|
||||
public static final String SET_APPINSIDEWEB = "Appground";
|
||||
/*应用管控的应用*/
|
||||
public static final String GET_ADMIN_APP = "And/app/getAdminApp";
|
||||
|
||||
|
||||
/*app下载完成发送下载次数*/
|
||||
@Deprecated
|
||||
@@ -68,42 +81,38 @@ public class UrlAddress {
|
||||
|
||||
/*上传安装的应用信息*/
|
||||
public static final String UPLOAD_APPINFO = "log/index";
|
||||
/*通过sn获取信息*/
|
||||
public static final String GET_STUDENTS_INFO = "Sn/getStudent";
|
||||
/*发送设备信息*/
|
||||
public static final String SEND_DEVICES = "Mac/getMac";
|
||||
/*上传我的设备*/
|
||||
public static final String UPDATE_DEVICEINFO = "Mac/getInfo";
|
||||
/*发送app使用情况*/
|
||||
public static final String GET_APP_LOG = "Applog/getAppLog";
|
||||
/*获取电子书包激活码*/
|
||||
public static final String GET_EBAG_CODE = "And/getEbagCode";
|
||||
/*恢复出厂设置次数*/
|
||||
public static final String SEND_RESTORE_TIMES = "And/restore";
|
||||
/*上传截图*/
|
||||
public static final String SEND_SCREENSHOT = "Screenshot/addImg";
|
||||
/*上传锁屏状态*/
|
||||
public static final String GET_LOCK_STATE = "Application/getLockState";
|
||||
/*获取霸屏状态*/
|
||||
public static final String GET_LOCK_SCREEN_STATE = "Sn/getSnScreen";
|
||||
/*上传电池信息*/
|
||||
public static final String SEND_BATTERY_INFO = "And/sn/updateBatteryInfo";
|
||||
/*上传联网时间*/
|
||||
public static final String NETWORK_CONNECT = "And/network";
|
||||
/*小程序的管控设置*/
|
||||
public static final String GET_SN_SETTING = "And/control/getSnSetting";
|
||||
|
||||
|
||||
/**
|
||||
* 系统策略相关
|
||||
*/
|
||||
|
||||
/*小程序的管控设置*/
|
||||
public static final String GET_SN_SETTING = "And/control/getSnSetting";
|
||||
/*获取隐藏桌面图标*/
|
||||
public static final String GET_HIDE_DESKTOPICON = "Icon";
|
||||
/*获取系统设置*/
|
||||
public static final String GET_FIRMWARE = "firmware/get";
|
||||
/*获取时间管控*/
|
||||
@Deprecated
|
||||
public static final String GET_SN_TIME_CONTROL = "Sn/getSnTimeControl";
|
||||
public static final String GET_TIME_CONTROL = "android/control/time-control";
|
||||
/*获取WiFi名和密码*/
|
||||
public static final String GET_WIFI_ALIAS_PW = "And/SnControl/getWifi";
|
||||
/*获取远程关机时间*/
|
||||
@@ -130,21 +139,16 @@ public class UrlAddress {
|
||||
|
||||
/*开机动画*/
|
||||
public static final String GET_LOGO_IMG = "Sn/getLogoImg";
|
||||
/*获取壁纸设置*/
|
||||
public static final String GET_WALLPAPER = "android/sn/wallpaper";
|
||||
/*获取默认桌面升级*/
|
||||
public static final String GET_DESKTOP = "Sn/getSnDesktop";
|
||||
/*获取自定义桌面升级*/
|
||||
public static final String GET_DESKTOPS_DIY_UPDATE = "Sn/getDesktopsDiyUpdate";
|
||||
/*获取系统默认程序*/
|
||||
public static final String GET_DEFAULT_APP = "app/getDefaultApp";
|
||||
/*获取壁纸设置*/
|
||||
public static final String GET_WALLPAPER = "android/sn/wallpaper";
|
||||
|
||||
/**
|
||||
* 开发人员调试
|
||||
*/
|
||||
|
||||
/*开发人员选项开关*/
|
||||
public static final String GET_DEVELOPER = "Sn/getDeveloper";
|
||||
|
||||
/**
|
||||
* log相关
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.AppAttr;
|
||||
import com.aoleyun.sn.bean.AppID;
|
||||
import com.aoleyun.sn.bean.Appground;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.NetAndLaunchBean;
|
||||
import com.aoleyun.sn.bean.TopApp;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface AppControlApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.NET_AND_LAUNCH_API)
|
||||
Observable<NetAndLaunchBean> getNetAndLaunchApi(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_SN_APP_ATTR)
|
||||
Observable<BaseResponse<List<AppAttr>>> getSnAppAttr(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_TOP_APP_CONTROL)
|
||||
Observable<BaseResponse<TopApp>> getSnAppControl(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_APPID)
|
||||
Observable<BaseResponse<List<AppID>>> getDeselectIDApi(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SET_APPINSIDEWEB)
|
||||
Observable<BaseResponse> getNewAppinsideWeb(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SET_APPINSIDEWEB)
|
||||
Observable<BaseResponse<List<Appground>>> getAppinsideWeb(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
}
|
||||
+24
-3
@@ -1,19 +1,41 @@
|
||||
package com.aoleyun.sn.network.api.post;
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.AppUpdateInfo;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.ForceDownloadData;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FieldMap;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface ForceDownloadApi {
|
||||
public interface AppDownloadApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.CHECK_UPDATE)
|
||||
//1MTK平台 2展锐平台
|
||||
Observable<BaseResponse<AppUpdateInfo>> getUpdate(
|
||||
@Field("package") String packageName,
|
||||
@Field("type") int type
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.CHECK_UPDATE)
|
||||
Observable<BaseResponse<AppUpdateInfo>> getUpdate(
|
||||
@FieldMap Map<String, String> params
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_SN_APP_TEST)
|
||||
Observable<BaseResponse<List<ForceDownloadData>>> getTestUpdate(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_FORCE_INSTALL_LIST)
|
||||
Observable<BaseResponse<List<ForceDownloadData>>> getForceDownloadApi(
|
||||
@@ -26,5 +48,4 @@ public interface ForceDownloadApi {
|
||||
@Query("key") String key,
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.AppDateInfo;
|
||||
import com.aoleyun.sn.bean.AppLimit;
|
||||
import com.aoleyun.sn.bean.AppListInfo;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.CustomROMApp;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface AppInstallStrategyApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SET_WHITE_PACKAGE_LIST)
|
||||
Observable<BaseResponse<AppLimit>> getAppLimitApi(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_ALL_APP)
|
||||
Observable<BaseResponse<List<AppListInfo>>> getAllAppList(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_ADMIN_APP)
|
||||
Observable<BaseResponse<List<AppDateInfo>>> getAdminApp(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.HTTP_TAG_COMMOAPP)
|
||||
Observable<BaseResponse<List<AppDateInfo>>> getRankApp(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn,
|
||||
@Field("page") String page
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_ROM_APP)
|
||||
Observable<BaseResponse<CustomROMApp>> getRomApp(
|
||||
@Field("key") String key,
|
||||
@Field("version_number") String version_number
|
||||
);
|
||||
}
|
||||
+7
-1
@@ -1,6 +1,7 @@
|
||||
package com.aoleyun.sn.network.api.get;
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.LessonApp;
|
||||
import com.aoleyun.sn.bean.LessonSetting;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
@@ -13,4 +14,9 @@ public interface CloudLessonApi {
|
||||
Observable<BaseResponse<LessonSetting>> getCloudLessonSetting(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_CLOUD_LESSON_APP)
|
||||
Observable<BaseResponse<LessonApp>> getCloudLessonApp(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.Batch;
|
||||
import com.aoleyun.sn.bean.DeveloperBean;
|
||||
import com.aoleyun.sn.bean.EBagCode;
|
||||
import com.aoleyun.sn.bean.ScreenLockState;
|
||||
import com.aoleyun.sn.bean.StudentsInfo;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface DevicesStatusApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_DEVICES_LOCKED)
|
||||
Observable<BaseResponse> getLockedState(
|
||||
@Field("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_DEVICES_TAGS)
|
||||
Observable<BaseResponse<Batch>> getPushTags(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_STUDENTS_INFO)
|
||||
Observable<BaseResponse<StudentsInfo>> getStudentsInfo(
|
||||
@Field("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_LOCK_SCREEN_STATE)
|
||||
Observable<BaseResponse<ScreenLockState>> getScreenLockState(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_DEVELOPER)
|
||||
Observable<BaseResponse<DeveloperBean>> getDeveloperState(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_EBAG_CODE)
|
||||
Observable<BaseResponse<EBagCode>> getEBagCode(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SN_CONFIRM_BIND)
|
||||
Observable<BaseResponse> snConfirmBind(
|
||||
@Field("sn") String sn,
|
||||
@Field("userId") String userId,
|
||||
@Field("type") int type
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.SnRunLog;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import okhttp3.MultipartBody;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Multipart;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Part;
|
||||
import retrofit2.http.Query;
|
||||
import retrofit2.http.QueryMap;
|
||||
|
||||
public interface LogApi {
|
||||
|
||||
@GET(UrlAddress.GET_LOG_ORDER)
|
||||
Observable<BaseResponse<SnRunLog>> getSnRunLog(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@Multipart
|
||||
@POST(UrlAddress.UPLOAD_LOG_FILE)
|
||||
Observable<BaseResponse> uploadLog(
|
||||
@QueryMap Map<String, String> params,
|
||||
@Part MultipartBody.Part body
|
||||
);
|
||||
|
||||
@Multipart
|
||||
@POST(UrlAddress.UPLOAD_IS_LOG_FILE)
|
||||
Observable<BaseResponse> sendSnLog(
|
||||
@QueryMap Map<String, String> params,
|
||||
@Part MultipartBody.Part body
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.DefaultApp;
|
||||
import com.aoleyun.sn.bean.ForceDownloadData;
|
||||
import com.aoleyun.sn.bean.LogoImg;
|
||||
import com.aoleyun.sn.bean.Wallpaper;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface SystemCustomApi {
|
||||
@GET(UrlAddress.GET_LOGO_IMG)
|
||||
Observable<BaseResponse<LogoImg>> getLogoImg(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_WALLPAPER)
|
||||
Observable<BaseResponse<Wallpaper>> getWallpaper(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_DESKTOP)
|
||||
Observable<BaseResponse<ForceDownloadData>> getDesktop(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_DESKTOPS_DIY_UPDATE)
|
||||
Observable<BaseResponse<ForceDownloadData>> getDesktopsDiyUpdate(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_DEFAULT_APP)
|
||||
Observable<BaseResponse<DefaultApp>> getDefaultApp(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.bean.AppSettings;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.BlacklistBean;
|
||||
import com.aoleyun.sn.bean.BrowserBookmarks;
|
||||
import com.aoleyun.sn.bean.BrowserData;
|
||||
import com.aoleyun.sn.bean.PoweroffBean;
|
||||
import com.aoleyun.sn.bean.SnSetting;
|
||||
import com.aoleyun.sn.bean.SnTimeControl;
|
||||
import com.aoleyun.sn.bean.TimeControlData;
|
||||
import com.aoleyun.sn.bean.WhitelistBean;
|
||||
import com.aoleyun.sn.bean.WiFiAlias;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface SystemSettingApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_FIRMWARE)
|
||||
Observable<BaseResponse> getSystemSettings(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_SN_SETTING)
|
||||
Observable<BaseResponse<SnSetting>> getSnSetting(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_SN_EFENCE)
|
||||
Observable<BaseResponse> geElectronicFence(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_HIDE_DESKTOPICON)
|
||||
Observable<BaseResponse> getDesktopIcon(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_SN_TIME_CONTROL)
|
||||
Observable<BaseResponse<SnTimeControl>> getSnTimeControl(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_TIME_CONTROL)
|
||||
Observable<BaseResponse<TimeControlData>> getTimeControl(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_WIFI_ALIAS_PW)
|
||||
Observable<BaseResponse<List<WiFiAlias>>> getWiFiAlias(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_POWEROFF_TIME)
|
||||
Observable<BaseResponse<List<PoweroffBean>>> getPoweroffTime(
|
||||
@Field("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.APP_SETTING)
|
||||
Observable<BaseResponse<AppSettings>> getAppSetting(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.BLACK_LIST)
|
||||
Observable<BaseResponse<BlacklistBean>> getBlackList(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.WHITE_LIST)
|
||||
Observable<BaseResponse<WhitelistBean>> getWhiteList(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SET_HOMEPAG_TAG)
|
||||
Observable<BaseResponse<BrowserBookmarks>> getBrowserBookmarks(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SET_BROWSER_LIST)
|
||||
Observable<BaseResponse<BrowserData>> getBrowserList(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
package com.aoleyun.sn.network.api.aoleyun;
|
||||
|
||||
import com.aoleyun.sn.BuildConfig;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import okhttp3.MultipartBody;
|
||||
import okhttp3.RequestBody;
|
||||
import okhttp3.ResponseBody;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FieldMap;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Multipart;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Part;
|
||||
import retrofit2.http.PartMap;
|
||||
import retrofit2.http.Query;
|
||||
import retrofit2.http.QueryMap;
|
||||
|
||||
public interface UploadInfoApi {
|
||||
@FormUrlEncoded
|
||||
@POST(BuildConfig.SCREEN_URL)
|
||||
@Deprecated
|
||||
Observable<BaseResponse> sendScreenStatus(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn,
|
||||
@Field("is_online") int is_online
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.UPLOAD_APPINFO)
|
||||
@Deprecated
|
||||
Observable<BaseResponse> getUploadAppInfoApi(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn,
|
||||
@Field("app_infoes") String json
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.UPLOAD_APPINFO)
|
||||
Observable<BaseResponse> getUploadAppInfoApi(
|
||||
@FieldMap Map<String, String> params
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SEND_DEVICES)
|
||||
Observable<BaseResponse> sendMACaddress(
|
||||
@Field("sn") String sn,
|
||||
@Field("mac") String mac,
|
||||
@Field("jpush_id") String jpushId,
|
||||
@Field("devices_version") String devicesVersion,
|
||||
@Field("appstore_version") String appstoreVersion,
|
||||
@Field("store_version") String storeVersion,
|
||||
@Field("desktop_version") String desktop_version,
|
||||
@Field("local_mac") String local_mac,
|
||||
@Field("wifi_status") int wifi_status,
|
||||
@Field("PN_ip") String PN_ip,
|
||||
@Field("LAN_ip") String LAN_ip,
|
||||
@Field("bluetooth") String bluetooth,
|
||||
@Field("wifi_name") String wifi_name,
|
||||
@Field("browser_version") String browser_version,
|
||||
@Field("notice_version") String notice_version,
|
||||
@Field("platform") String platform,
|
||||
@Field("wifi_operator") String wifi_operator,
|
||||
@Field("network_type") String network_type,
|
||||
@Field("network_operator") String network_operator,
|
||||
@Field("sn_phone") String sn_phone,
|
||||
@Field("dpi") int dpi
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.UPDATE_DEVICEINFO)
|
||||
Observable<BaseResponse> updateDeviceInfo(
|
||||
@Field("sn") String sn,
|
||||
@Field("key") String key,
|
||||
@Field("machine") String machine,
|
||||
@Field("hardware") String hardware,
|
||||
@Field("address") String address,
|
||||
@Field("other") String other
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.UPDATE_DEVICEINFO)
|
||||
Observable<BaseResponse> updateDeviceInfo(
|
||||
@FieldMap Map<String, String> params
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_APP_LOG)
|
||||
Observable<BaseResponse> getAppLog(
|
||||
@Field("sn") String sn,
|
||||
@Field("random") String random,
|
||||
@Field("data") String data
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SEND_RESTORE_TIMES)
|
||||
Observable<BaseResponse> sendRestoreTimes(
|
||||
@Field("sn") String sn
|
||||
);
|
||||
|
||||
@Multipart
|
||||
@POST(UrlAddress.SEND_SCREENSHOT)
|
||||
Call<BaseResponse> sendScreenshot(
|
||||
@QueryMap Map<String, String> params,
|
||||
@Part MultipartBody.Part body
|
||||
);
|
||||
|
||||
@Deprecated
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_LOCK_STATE)
|
||||
Observable<ResponseBody> getLockState(
|
||||
@Field("sn") String sn,
|
||||
@Field("status") String status,
|
||||
@Field("time") String time
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SEND_BATTERY_INFO)
|
||||
Observable<BaseResponse> sendBatteryInfo(
|
||||
@Field("sn") String sn,
|
||||
@Field("key") String key,
|
||||
@Field("battery_quantity") String battery_quantity,
|
||||
@Field("battery_temperature") String battery_temperature,
|
||||
@Field("battery_voltage") String battery_voltage,
|
||||
@Field("charge_current") String charge_current,
|
||||
@Field("charge_voltage") String charge_voltage,
|
||||
@Field("battery_status") String battery_status,
|
||||
@Field("charge_type") String charge_type,
|
||||
@Field("charge_current_max") String charge_current_max,
|
||||
@Field("charge_voltage_max") String charge_voltage_max,
|
||||
@Field("battery_health") String battery_health,
|
||||
@Field("quantity_max") String quantity_max,
|
||||
@Field("battery_desc") String battery_desc,
|
||||
@Field("charge_speed") String charge_speed
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.NETWORK_CONNECT)
|
||||
Observable<BaseResponse> sendNetwork(
|
||||
@Field("sn") String sn,
|
||||
@Field("time") String time
|
||||
);
|
||||
|
||||
@Deprecated
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SEND_DOWNLOAD_TIMES)
|
||||
Observable<BaseResponse> sendDownloadTimes(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn,
|
||||
@Field("package") String packages,
|
||||
@Field("app_id") String app_id
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_IS_APP_IMG)
|
||||
Observable<BaseResponse> getIsAppImg(
|
||||
@Query("package") String pkg
|
||||
);
|
||||
|
||||
@Multipart
|
||||
@POST(UrlAddress.UPLOAD_APP_IMG)
|
||||
Call<BaseResponse> uploadAppImg(
|
||||
@PartMap Map<String, RequestBody> params,
|
||||
@Part MultipartBody.Part body
|
||||
);
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.get;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface AppImgApi {
|
||||
@GET(UrlAddress.GET_IS_APP_IMG)
|
||||
Observable<BaseResponse> getIsAppImg(
|
||||
@Query("package") String pkg
|
||||
);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.get;
|
||||
|
||||
import com.aoleyun.sn.bean.AppSettings;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface AppSettingApi {
|
||||
@GET(UrlAddress.APP_SETTING)
|
||||
Observable<BaseResponse<AppSettings>> getAppSetting(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.get;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.BlacklistBean;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface BlackListApi {
|
||||
@GET(UrlAddress.BLACK_LIST)
|
||||
Observable<BaseResponse<BlacklistBean>> getBlackList(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.get;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.LessonApp;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface CloudLessonAppApi {
|
||||
@GET(UrlAddress.GET_CLOUD_LESSON_APP)
|
||||
Observable<BaseResponse<LessonApp>> getCloudLessonApp(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.get;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.DefaultApp;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface DefaultAppApi {
|
||||
@GET(UrlAddress.GET_DEFAULT_APP)
|
||||
Observable<BaseResponse<DefaultApp>> getDefaultApp(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.get;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.ForceDownloadData;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface DesktopsDiyUpdateApi {
|
||||
@GET(UrlAddress.GET_DESKTOPS_DIY_UPDATE)
|
||||
Observable<BaseResponse<ForceDownloadData>> getDesktopsDiyUpdate(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.get;
|
||||
|
||||
import com.aoleyun.sn.bean.AppDateInfo;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface GetAdminAppApi {
|
||||
@GET(UrlAddress.GET_ADMIN_APP)
|
||||
Observable<BaseResponse<List<AppDateInfo>>> getAdminApp(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.get;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.ForceDownloadData;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface GetDesktopApi {
|
||||
@GET(UrlAddress.GET_DESKTOP)
|
||||
Observable<BaseResponse<ForceDownloadData>> getDesktop(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.get;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.DeveloperBean;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface GetDeveloperApi {
|
||||
@GET(UrlAddress.GET_DEVELOPER)
|
||||
Observable<BaseResponse<DeveloperBean>> getDeveloperState(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.get;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.Batch;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface GetPushTagsApi {
|
||||
@GET(UrlAddress.GET_DEVICES_TAGS)
|
||||
Observable<BaseResponse<Batch>> getPushTags(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.get;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.SnRunLog;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface GetSnRunLogApi {
|
||||
@GET(UrlAddress.GET_LOG_ORDER)
|
||||
Observable<BaseResponse<SnRunLog>> GetSnRunLog(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.get;
|
||||
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.WiFiAlias;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
/**
|
||||
* @author : fanhuitong
|
||||
* e-mail :
|
||||
* @date : 2021/10/26 10:07
|
||||
* desc :
|
||||
* version: 1.0
|
||||
*/
|
||||
public interface GetWiFiAliasApi {
|
||||
@GET(UrlAddress.GET_WIFI_ALIAS_PW)
|
||||
Observable<BaseResponse<List<WiFiAlias>>> getWiFiAlias(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.get;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.LogoImg;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface LogoImgApi {
|
||||
@GET(UrlAddress.GET_LOGO_IMG)
|
||||
Observable<BaseResponse<LogoImg>> getLogoImg(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.get;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.ScreenLockState;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface ScreenLockStateApi {
|
||||
@GET(UrlAddress.GET_LOCK_SCREEN_STATE)
|
||||
Observable<BaseResponse<ScreenLockState>> getScreenLockState(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.get;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.ForceDownloadData;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface SnApi {
|
||||
@GET(UrlAddress.GET_SN_APP_TEST)
|
||||
Observable<BaseResponse<List<ForceDownloadData>>> getTestUpdate(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_SN_EFENCE)
|
||||
Observable<BaseResponse> geElectronicFence(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.get;
|
||||
|
||||
import com.aoleyun.sn.bean.AppAttr;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface SnAppAttrApi {
|
||||
@GET(UrlAddress.GET_SN_APP_ATTR)
|
||||
Observable<BaseResponse<List<AppAttr>>> getSnAppAttr(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.get;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.SnSetting;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface SnSettingApi {
|
||||
@GET(UrlAddress.GET_SN_SETTING)
|
||||
Observable<BaseResponse<SnSetting>> getSnSetting(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.get;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.SnTimeControl;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface SnTimeControlApi {
|
||||
@GET(UrlAddress.GET_SN_TIME_CONTROL)
|
||||
Observable<BaseResponse<SnTimeControl>> getSnTimeControl(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.get;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.TopApp;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface TopAppControlApi {
|
||||
@GET(UrlAddress.GET_TOP_APP_CONTROL)
|
||||
Observable<BaseResponse<TopApp>> getSnAppControl(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.get;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.Wallpaper;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface WallpaperApi {
|
||||
@GET(UrlAddress.GET_WALLPAPER)
|
||||
Observable<BaseResponse<Wallpaper>> getWallpaper(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.get;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.WhitelistBean;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface WhiteListApi {
|
||||
@GET(UrlAddress.WHITE_LIST)
|
||||
Observable<BaseResponse<WhitelistBean>> getWhiteList(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.post;
|
||||
|
||||
import com.aoleyun.sn.bean.AppLimit;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface AppLimitApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SET_WHITE_PACKAGE_LIST)
|
||||
Observable<BaseResponse<AppLimit>> getAppLimitApi(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.post;
|
||||
|
||||
|
||||
import com.aoleyun.sn.bean.Appground;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface AppinsideWebApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SET_APPINSIDEWEB)
|
||||
Observable<BaseResponse<List<Appground>>> getAppinsideWeb(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.post;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface BatteryInfoApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SEND_BATTERY_INFO)
|
||||
Observable<BaseResponse> sendBatteryInfo(
|
||||
@Field("sn") String sn,
|
||||
@Field("key") String key,
|
||||
@Field("battery_quantity") String battery_quantity,
|
||||
@Field("battery_temperature") String battery_temperature,
|
||||
@Field("battery_voltage") String battery_voltage,
|
||||
@Field("charge_current") String charge_current,
|
||||
@Field("charge_voltage") String charge_voltage,
|
||||
@Field("battery_status") String battery_status,
|
||||
@Field("charge_type") String charge_type,
|
||||
@Field("charge_current_max") String charge_current_max,
|
||||
@Field("charge_voltage_max") String charge_voltage_max,
|
||||
@Field("battery_health") String battery_health,
|
||||
@Field("quantity_max") String quantity_max,
|
||||
@Field("battery_desc") String battery_desc,
|
||||
@Field("charge_speed") String charge_speed
|
||||
);
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.post;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.BrowserBookmarks;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface BrowserBookmarksApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SET_HOMEPAG_TAG)
|
||||
Observable<BaseResponse<BrowserBookmarks>> getBrowserBookmarks(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.post;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.BrowserData;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface BrowserListApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SET_BROWSER_LIST)
|
||||
Observable<BaseResponse<BrowserData>> getBrowserList(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.post;
|
||||
|
||||
import com.aoleyun.sn.bean.AppUpdateInfo;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface CheckUpdateApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.CHECK_UPDATE)
|
||||
//1MTK平台 2展锐平台
|
||||
Observable<BaseResponse<AppUpdateInfo>> getUpdate(
|
||||
@Field("package") String packages,
|
||||
@Field("type") int type
|
||||
);
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.post;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.CustomROMApp;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface CustomROMAppApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_ROM_APP)
|
||||
Observable<BaseResponse<CustomROMApp>> getROMApp(
|
||||
@Field("key") String key,
|
||||
@Field("version_number") String version_number
|
||||
);
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.post;
|
||||
|
||||
import com.aoleyun.sn.bean.AppID;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface DeselectIDApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_APPID)
|
||||
Observable<BaseResponse<List<AppID>>> getDeselectIDApi(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.post;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface DesktopIconApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_HIDE_DESKTOPICON)
|
||||
Observable<BaseResponse> getDesktopIcon(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.post;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface DevicesLockedStateApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_DEVICES_LOCKED)
|
||||
Observable<BaseResponse> getLockedState(
|
||||
@Field("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.post;
|
||||
|
||||
import com.aoleyun.sn.bean.AppListInfo;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface GetAllAppApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_ALL_APP)
|
||||
Observable<BaseResponse<List<AppListInfo>>> getAllAppList(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.post;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface GetAppLogApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_APP_LOG)
|
||||
Observable<BaseResponse> getAppLog(
|
||||
@Field("sn") String sn,
|
||||
@Field("random") String random,
|
||||
@Field("data") String data
|
||||
);
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.post;
|
||||
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import okhttp3.ResponseBody;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface GetBatchApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_BATCH)
|
||||
Observable<ResponseBody> getBatch(
|
||||
@Field("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.post;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.EBagCode;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface GetEBagCodeApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_EBAG_CODE)
|
||||
Observable<BaseResponse<EBagCode>> getEBagCode(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.post;
|
||||
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import okhttp3.ResponseBody;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface GetLockStateApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_LOCK_STATE)
|
||||
Observable<ResponseBody> getLockState(
|
||||
@Field("sn") String sn,
|
||||
@Field("status") String status,
|
||||
@Field("time") String time
|
||||
);
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.post;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.PoweroffBean;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface GetPoweroffApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_POWEROFF_TIME)
|
||||
Observable<BaseResponse<List<PoweroffBean>>> getPoweroffTime(
|
||||
@Field("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.post;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import okhttp3.MultipartBody;
|
||||
import retrofit2.http.Multipart;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Part;
|
||||
import retrofit2.http.QueryMap;
|
||||
|
||||
public interface GetUploadIsLogApi {
|
||||
@Multipart
|
||||
@POST(UrlAddress.UPLOAD_IS_LOG_FILE)
|
||||
Observable<BaseResponse> sendSnisLog(
|
||||
@QueryMap Map<String, String> params,
|
||||
@Part MultipartBody.Part body
|
||||
);
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.post;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import okhttp3.MultipartBody;
|
||||
import retrofit2.http.Multipart;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Part;
|
||||
import retrofit2.http.QueryMap;
|
||||
|
||||
public interface GetUploadLogApi {
|
||||
@Multipart
|
||||
@POST(UrlAddress.UPLOAD_LOG_FILE)
|
||||
Observable<BaseResponse> UploadLog(
|
||||
@QueryMap Map<String, String> params,
|
||||
@Part MultipartBody.Part body
|
||||
);
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.post;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface MACAddressApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SEND_DEVICES)
|
||||
Observable<BaseResponse> sendMACaddress(
|
||||
@Field("sn") String sn,
|
||||
@Field("mac") String mac,
|
||||
@Field("jpush_id") String jpushId,
|
||||
@Field("devices_version") String devicesVersion,
|
||||
@Field("appstore_version") String appstoreVersion,
|
||||
@Field("store_version") String storeVersion,
|
||||
@Field("desktop_version") String desktop_version,
|
||||
@Field("local_mac") String local_mac,
|
||||
@Field("wifi_status") int wifi_status,
|
||||
@Field("PN_ip") String PN_ip,
|
||||
@Field("LAN_ip") String LAN_ip,
|
||||
@Field("bluetooth") String bluetooth,
|
||||
@Field("wifi_name") String wifi_name,
|
||||
@Field("browser_version") String browser_version,
|
||||
@Field("notice_version") String notice_version,
|
||||
@Field("platform") String platform,
|
||||
@Field("wifi_operator") String wifi_operator,
|
||||
@Field("network_type") String network_type,
|
||||
@Field("network_operator") String network_operator,
|
||||
@Field("sn_phone") String sn_phone,
|
||||
@Field("dpi") int dpi
|
||||
);
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.post;
|
||||
|
||||
import com.aoleyun.sn.bean.NetAndLaunchBean;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface NetAndLaunchApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.NET_AND_LAUNCH_API)
|
||||
Observable<NetAndLaunchBean> getNetAndLaunchApi(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.post;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface NetworkConnectApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.NETWORK_CONNECT)
|
||||
Observable<BaseResponse> sendNetwork(
|
||||
@Field("sn") String sn,
|
||||
@Field("time") String time
|
||||
);
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.post;
|
||||
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface NewAppinsideWebApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SET_APPINSIDEWEB)
|
||||
Observable<BaseResponse> getAppinsideWeb(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.post;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
@Deprecated
|
||||
public interface SendDownloadInfoApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SEND_DOWNLOAD_FILE_INFO)
|
||||
Observable<BaseResponse> sendDownloadTimes(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn,
|
||||
@Field("userId") int userId,
|
||||
@Field("package_name") String package_name,
|
||||
@Field("app_size") long app_size
|
||||
);
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.post;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface SendDownloadTimesApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SEND_DOWNLOAD_TIMES)
|
||||
Observable<BaseResponse> sendDownloadTimes(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn,
|
||||
@Field("package") String packages,
|
||||
@Field("app_id") String app_id
|
||||
);
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.post;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
/**
|
||||
* @author : fanhuitong
|
||||
* e-mail :
|
||||
* @date : 2021/10/2115:02
|
||||
* desc :
|
||||
* version: 1.0
|
||||
*/
|
||||
public interface SendRestoreTimesApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SEND_RESTORE_TIMES)
|
||||
Observable<BaseResponse> sendRestoreTimes(
|
||||
@Field("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.post;
|
||||
|
||||
import com.aoleyun.sn.BuildConfig;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface SendScreenStatusApi {
|
||||
@FormUrlEncoded
|
||||
@POST(BuildConfig.SCREEN_URL)
|
||||
Observable<BaseResponse> sendScreenStatus(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn,
|
||||
@Field("is_online") int is_online
|
||||
);
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.post;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import okhttp3.MultipartBody;
|
||||
import retrofit2.http.Multipart;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Part;
|
||||
import retrofit2.http.QueryMap;
|
||||
|
||||
@Deprecated
|
||||
public interface SendScreenshotApi {
|
||||
@Multipart
|
||||
@POST(UrlAddress.SEND_SCREENSHOT)
|
||||
Observable<BaseResponse> sendScreenshot(
|
||||
@QueryMap Map<String, String> params,
|
||||
@Part MultipartBody.Part body
|
||||
);
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.post;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import okhttp3.MultipartBody;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Multipart;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Part;
|
||||
import retrofit2.http.QueryMap;
|
||||
|
||||
public interface SendScreenshotCall {
|
||||
@Multipart
|
||||
@POST(UrlAddress.SEND_SCREENSHOT)
|
||||
Call<BaseResponse> sendScreenshot(
|
||||
@QueryMap Map<String, String> params,
|
||||
@Part MultipartBody.Part body
|
||||
);
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.post;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface SnConfirmBindApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SN_CONFIRM_BIND)
|
||||
Observable<BaseResponse> snConfirmBind(
|
||||
@Field("sn") String sn,
|
||||
@Field("userId") String userId,
|
||||
@Field("type") int type
|
||||
);
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.post;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.StudentsInfo;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface StudentsInfoApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_STUDENTS_INFO)
|
||||
Observable<BaseResponse<StudentsInfo>> getStudentsInfo(
|
||||
@Field("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.post;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface SystemSettingApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_FIRMWARE)
|
||||
Observable<BaseResponse> getSystemSettingApi(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.post;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface UpdateDeviceInfoApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.UPDATE_DEVICEINFO)
|
||||
Observable<BaseResponse> updateDeviceInfo(
|
||||
@Field("sn") String sn,
|
||||
@Field("key") String key,
|
||||
@Field("machine") String machine,
|
||||
@Field("hardware") String hardware,
|
||||
@Field("address") String address,
|
||||
@Field("other") String other
|
||||
);
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.post;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import okhttp3.MultipartBody;
|
||||
import okhttp3.RequestBody;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Multipart;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Part;
|
||||
import retrofit2.http.PartMap;
|
||||
|
||||
public interface UploadAppImgApi {
|
||||
@Multipart
|
||||
@POST(UrlAddress.UPLOAD_APP_IMG)
|
||||
Call<BaseResponse> uploadAppImg(
|
||||
@PartMap Map<String, RequestBody> params,
|
||||
@Part MultipartBody.Part body
|
||||
);
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.aoleyun.sn.network.api.post;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface UploadAppInfoApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.UPLOAD_APPINFO)
|
||||
Observable<BaseResponse> getUploadAppInfoApi(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn,
|
||||
@Field("app_infoes") String json
|
||||
);
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.aoleyun.sn.network.api;
|
||||
package com.aoleyun.sn.network.api.thirdparty;
|
||||
|
||||
import com.aoleyun.sn.bean.WhoisBean;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.aoleyun.sn.network.cache;
|
||||
|
||||
/**
|
||||
* 缓存实体:存储请求结果、创建时间、有效期
|
||||
*
|
||||
* @param <T> 接口返回数据类型
|
||||
*/
|
||||
public class CacheEntry<T> {
|
||||
// 缓存的成功数据
|
||||
private final T data;
|
||||
// 缓存创建时间(毫秒)
|
||||
private final long createTime;
|
||||
// 缓存有效期(毫秒)
|
||||
private final long expireTimeMillis;
|
||||
|
||||
public CacheEntry(T data, long createTime, long expireTimeMillis) {
|
||||
this.data = data;
|
||||
this.createTime = createTime;
|
||||
this.expireTimeMillis = expireTimeMillis;
|
||||
}
|
||||
|
||||
// 判断缓存是否过期
|
||||
public boolean isExpired() {
|
||||
return System.currentTimeMillis() - createTime > expireTimeMillis;
|
||||
}
|
||||
|
||||
public T getData() {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.aoleyun.sn.network.cache;
|
||||
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* 全局缓存管理器:线程安全,存储所有接口缓存
|
||||
*/
|
||||
public class RxCacheManager {
|
||||
// 单例
|
||||
private static volatile RxCacheManager INSTANCE;
|
||||
// 缓存容器:key=请求唯一标识,value=缓存实体
|
||||
private final ConcurrentHashMap<String, CacheEntry<?>> cacheMap;
|
||||
|
||||
private RxCacheManager() {
|
||||
cacheMap = new ConcurrentHashMap<>();
|
||||
}
|
||||
|
||||
public static RxCacheManager getInstance() {
|
||||
if (INSTANCE == null) {
|
||||
synchronized (RxCacheManager.class) {
|
||||
if (INSTANCE == null) {
|
||||
INSTANCE = new RxCacheManager();
|
||||
}
|
||||
}
|
||||
}
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存缓存
|
||||
*/
|
||||
public <T> void saveCache(String key, T data, long expireTimeMillis) {
|
||||
if (key == null || data == null) return;
|
||||
cacheMap.put(key, new CacheEntry<>(data, System.currentTimeMillis(), expireTimeMillis));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取缓存(自动判断过期)
|
||||
*/
|
||||
public <T> T getCache(String key) {
|
||||
CacheEntry<?> entry = cacheMap.get(key);
|
||||
if (entry == null || entry.isExpired()) {
|
||||
// 缓存不存在/已过期,移除并返回null
|
||||
cacheMap.remove(key);
|
||||
return null;
|
||||
}
|
||||
return (T) entry.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空所有缓存
|
||||
*/
|
||||
public void clearAllCache() {
|
||||
cacheMap.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除指定缓存
|
||||
*/
|
||||
public void removeCache(String key) {
|
||||
cacheMap.remove(key);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.aoleyun.sn.network.cache;
|
||||
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
|
||||
/**
|
||||
* 优化后:无需手动传CacheKey,自动从请求获取
|
||||
*/
|
||||
public class RxCacheRequest {
|
||||
private static final RxCacheManager CACHE_MANAGER = RxCacheManager.getInstance();
|
||||
|
||||
/**
|
||||
* 极简调用:仅需 网络请求Observable + 缓存过期时间
|
||||
*
|
||||
* @param networkObservable 原始网络请求
|
||||
* @param expireTimeMillis 缓存有效期(毫秒)
|
||||
* @return 带自动缓存的Observable
|
||||
*/
|
||||
public static <T> Observable<T> withCache(Observable<T> networkObservable, String cacheKey, long expireTimeMillis) {
|
||||
return Observable.defer(() -> {
|
||||
|
||||
// 2. 读取缓存
|
||||
T cacheData = CACHE_MANAGER.getCache(cacheKey);
|
||||
if (cacheData != null) {
|
||||
return Observable.just(cacheData);
|
||||
}
|
||||
|
||||
// 3. 无缓存则发起网络请求,成功后缓存
|
||||
return networkObservable
|
||||
.subscribeOn(Schedulers.io())
|
||||
.doOnNext(data -> CACHE_MANAGER.saveCache(cacheKey, data, expireTimeMillis));
|
||||
})
|
||||
.subscribeOn(Schedulers.io()) // 缓存IO切到子线程
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.aoleyun.sn.network.cache;
|
||||
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import io.reactivex.rxjava3.core.ObservableSource;
|
||||
import io.reactivex.rxjava3.core.ObservableTransformer;
|
||||
|
||||
public class RxTimeCacheManager {
|
||||
|
||||
// Thread-safe memory cache to hold our data and its timestamp
|
||||
private static final ConcurrentHashMap<String, CacheEntry<?>> cacheMap = new ConcurrentHashMap<>();
|
||||
|
||||
/**
|
||||
* Industry Standard RxJava Cache Transformer.
|
||||
* * @param cacheKey Unique key for this specific request (e.g., URL or Method Name)
|
||||
*
|
||||
* @param validTimeMillis How long the data is valid before a new network request is allowed
|
||||
*/
|
||||
public static <T> ObservableTransformer<T, T> applyCache(final String cacheKey, final long validTimeMillis) {
|
||||
return new ObservableTransformer<T, T>() {
|
||||
@Override
|
||||
public ObservableSource<T> apply(Observable<T> upstream) {
|
||||
// defer() ensures this logic runs EVERY time someone subscribes, not at initialization
|
||||
return Observable.defer(() -> {
|
||||
CacheEntry<?> entry = cacheMap.get(cacheKey);
|
||||
long currentTime = System.currentTimeMillis();
|
||||
|
||||
// 1. Check if cache exists and is within the time limit
|
||||
if (entry != null && (currentTime - entry.timestamp) < validTimeMillis) {
|
||||
// Cache HIT -> Return cached data immediately, do not trigger network
|
||||
@SuppressWarnings("unchecked")
|
||||
T cachedData = (T) entry.data;
|
||||
return Observable.just(cachedData);
|
||||
}
|
||||
|
||||
// 2. Cache MISS or EXPIRED -> Trigger upstream (network) and save result
|
||||
return upstream.doOnNext(data -> {
|
||||
// Save the fresh data and current timestamp back to the cache
|
||||
cacheMap.put(cacheKey, new CacheEntry<>(data, System.currentTimeMillis()));
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears a specific cache key if you need to force a refresh manually.
|
||||
*/
|
||||
public static void clearCache(String cacheKey) {
|
||||
cacheMap.remove(cacheKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal wrapper to hold the payload and the time it was fetched.
|
||||
*/
|
||||
private static class CacheEntry<T> {
|
||||
final T data;
|
||||
final long timestamp;
|
||||
|
||||
CacheEntry(T data, long timestamp) {
|
||||
this.data = data;
|
||||
this.timestamp = timestamp;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -616,7 +616,7 @@ public class PushManager {
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.put("sn", Utils.getSerial(mContext));
|
||||
params.put("createtime", String.valueOf(createTime));
|
||||
Call<BaseResponse> call = NetInterfaceManager.getInstance().getScreenshotCall().sendScreenshot(params, body);
|
||||
Call<BaseResponse> call = NetInterfaceManager.getInstance().getUploadInfoApi().sendScreenshot(params, body);
|
||||
call.enqueue(new RetryCallback<BaseResponse>(call, 10, 30 * 1000) {
|
||||
@Override
|
||||
public void onRequestResponse(Call call, Response response) {
|
||||
@@ -1066,7 +1066,7 @@ public class PushManager {
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.put("sn", Utils.getSerial(mContext));
|
||||
params.put("createtime", String.valueOf(time));
|
||||
Call<BaseResponse> call = NetInterfaceManager.getInstance().getScreenshotCall().sendScreenshot(params, body);
|
||||
Call<BaseResponse> call = NetInterfaceManager.getInstance().getUploadInfoApi().sendScreenshot(params, body);
|
||||
call.enqueue(new RetryCallback<BaseResponse>(call, 10, 30 * 1000) {
|
||||
@Override
|
||||
public void onRequestResponse(Call call, Response response) {
|
||||
@@ -1113,6 +1113,7 @@ public class PushManager {
|
||||
|
||||
private void getTimeControl(String extras) {
|
||||
NetInterfaceManager.getInstance().getSnTimeControl();
|
||||
NetInterfaceManager.getInstance().getTimeControl();
|
||||
}
|
||||
|
||||
private void getTopApp(String extras) {
|
||||
@@ -1503,7 +1504,7 @@ public class PushManager {
|
||||
|
||||
private void bind(final String id, int type) {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getSnConfirmBindApi()
|
||||
.getDevicesStatusApi()
|
||||
.snConfirmBind(Utils.getSerial(mContext), id, type)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
|
||||
@@ -8,11 +8,9 @@ import android.os.Build;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.aoleyun.sn.comm.CommonConfig;
|
||||
import com.aoleyun.sn.comm.PackageNames;
|
||||
import com.aoleyun.sn.network.NetInterfaceManager;
|
||||
import com.aoleyun.sn.utils.ApkUtils;
|
||||
import com.aoleyun.sn.utils.CmdUtil;
|
||||
import com.aoleyun.sn.utils.JgyUtils;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@@ -76,7 +74,6 @@ public class NewAppReceiver extends BroadcastReceiver {
|
||||
JgyUtils.getInstance().setAllowPermissionsPackage();
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
if (!PackageNames.APPSTORE.equals(packageName) || !PackageNames.DEVICE_INFO.equals(packageName)) {
|
||||
ApkUtils.addShortcut(context);
|
||||
ApkUtils.RemoveTask(context, packageName);
|
||||
}
|
||||
JgyUtils.getInstance().wakeUpAoleyunAPP();
|
||||
@@ -122,6 +119,7 @@ public class NewAppReceiver extends BroadcastReceiver {
|
||||
NetInterfaceManager.getInstance().getAppLimit();
|
||||
// NetInterfaceManager.getInstance().getDefaultDesktop();
|
||||
NetInterfaceManager.getInstance().getNetAndLaunchSetting();
|
||||
NetInterfaceManager.getInstance().getDesktopIcon();
|
||||
NetInterfaceManager.getInstance().sendInstalledAppInfo(new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
@@ -27,7 +27,7 @@ import com.aoleyun.sn.comm.CommonConfig;
|
||||
import com.aoleyun.sn.gson.GsonUtils;
|
||||
import com.aoleyun.sn.manager.MapManager;
|
||||
import com.aoleyun.sn.network.NetInterfaceManager;
|
||||
import com.aoleyun.sn.network.api.post.SendScreenStatusApi;
|
||||
import com.aoleyun.sn.network.api.aoleyun.UploadInfoApi;
|
||||
import com.aoleyun.sn.receiver.NewAppReceiver;
|
||||
import com.aoleyun.sn.rlog.LogDBManager;
|
||||
import com.aoleyun.sn.service.main.MainService;
|
||||
@@ -387,8 +387,8 @@ public class GuardService extends Service {
|
||||
.addConverterFactory(GsonConverterFactory.create())
|
||||
.addCallAdapterFactory(RxJava3CallAdapterFactory.create())
|
||||
.build();
|
||||
SendScreenStatusApi sendScreenStatusApi = retrofit.create(SendScreenStatusApi.class);
|
||||
sendScreenStatusApi.sendScreenStatus(NetInterfaceManager.HTTP_KEY, Utils.getSerial(this), status)
|
||||
UploadInfoApi uploadInfoApi = retrofit.create(UploadInfoApi.class);
|
||||
uploadInfoApi.sendScreenStatus(NetInterfaceManager.HTTP_KEY, Utils.getSerial(this), status)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<BaseResponse>() {
|
||||
@@ -424,7 +424,7 @@ public class GuardService extends Service {
|
||||
return;
|
||||
}
|
||||
NetInterfaceManager.getInstance()
|
||||
.getLockState()
|
||||
.getUploadInfoApi()
|
||||
.getLockState(Utils.getSerial(this), status, time)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
|
||||
@@ -268,8 +268,8 @@ public class LogcatService extends Service {
|
||||
//设置一个file文件
|
||||
MultipartBody.Part body = MultipartBody.Part.createFormData("file", file.getName(), fileBody);
|
||||
|
||||
NetInterfaceManager.getInstance().getUploadLogApi()
|
||||
.UploadLog(params, body)
|
||||
NetInterfaceManager.getInstance().getLogApi()
|
||||
.uploadLog(params, body)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<BaseResponse>() {
|
||||
|
||||
@@ -99,9 +99,9 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
Log.e("getLockedState", "onComplete: ");
|
||||
int locked = Settings.System.getInt(crv, JGYActions.ACTION_QCH_UNLOCK_IPAD, JGYActions.FRAME_CODE_LOCKED);
|
||||
Log.e("getLockedState", "locked: " + locked);
|
||||
if (locked == 0) {
|
||||
JgyUtils.getInstance().deleteOtherApp();
|
||||
}
|
||||
// if (locked == 0) {
|
||||
// JgyUtils.getInstance().deleteOtherApp();
|
||||
// }
|
||||
mView.setLockedState(locked == JGYActions.FRAME_CODE_LOCKED);
|
||||
}
|
||||
});
|
||||
@@ -109,7 +109,7 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
|
||||
@Override
|
||||
public void setPushTags() {
|
||||
NetInterfaceManager.getInstance().setPushTags( getLifecycle(), new NetInterfaceManager.PushTagCallback() {
|
||||
NetInterfaceManager.getInstance().setPushTags(getLifecycle(), new NetInterfaceManager.PushTagCallback() {
|
||||
@Override
|
||||
public void setPushTag(String tag) {
|
||||
mView.setTagsFinish(TextUtils.isEmpty(tag));
|
||||
@@ -184,7 +184,7 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
Log.e(TAG, "sendNetwork: " + "time empty");
|
||||
return;
|
||||
}
|
||||
NetInterfaceManager.getInstance().GetNetworkConnectControl(time.toString())
|
||||
NetInterfaceManager.getInstance().getNetworkConnectControl(time.toString())
|
||||
.compose(RxLifecycle.bindUntilEvent(lifecycle, ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse>() {
|
||||
@Override
|
||||
@@ -236,12 +236,12 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
mView.updateDeviceInfoFinish();
|
||||
}
|
||||
// if (!JgyUtils.getInstance().tagEmpty()) {
|
||||
NetInterfaceManager.getInstance().updateDeviceInfo(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.updateDeviceInfoFinish();
|
||||
}
|
||||
});
|
||||
NetInterfaceManager.getInstance().updateDeviceInfo(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.updateDeviceInfoFinish();
|
||||
}
|
||||
});
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -251,12 +251,12 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
@Override
|
||||
public void sendInstalled() {
|
||||
// if (!JgyUtils.getInstance().tagEmpty()) {
|
||||
NetInterfaceManager.getInstance().sendInstalledAppInfo(new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.sendInstalledFinish();
|
||||
}
|
||||
});
|
||||
NetInterfaceManager.getInstance().sendInstalledAppInfo(new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.sendInstalledFinish();
|
||||
}
|
||||
});
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -309,7 +309,7 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
String customVersion = Utils.getCustomVersion();
|
||||
Log.e(TAG, "getROMApp: " + customVersion);
|
||||
NetInterfaceManager.getInstance()
|
||||
.getCustomROMApp(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
.getCustomRomApp(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getRomAppFinish();
|
||||
@@ -380,7 +380,7 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
mView.getDefaultDesktopFinish();
|
||||
} else {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getDefaultDesktop( getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
.getDefaultDesktop(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getDefaultDesktopFinish();
|
||||
@@ -418,7 +418,7 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
@Override
|
||||
public void getAllAppList() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getAllAppList(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
.getAllAppList(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getAllAppListFinish();
|
||||
@@ -459,7 +459,7 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
@Override
|
||||
public void getAppAutoStartUpdateAndNet() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getAppAutoStartUpdateAndNet( getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
.getAppAutoStartUpdateAndNet(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getAppAutoStartUpdateAndNetFinish();
|
||||
@@ -556,7 +556,14 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
mView.getSnTimeControlFinish();
|
||||
} else {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getSnTimeControl(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
.getSnTimeControl(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getSnTimeControlFinish();
|
||||
}
|
||||
});
|
||||
NetInterfaceManager.getInstance()
|
||||
.getTimeControl(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getSnTimeControlFinish();
|
||||
|
||||
@@ -6,7 +6,6 @@ import android.app.AlarmManager;
|
||||
import android.app.IActivityManager;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.Service;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
@@ -44,6 +43,7 @@ import com.alibaba.sdk.android.push.noonesdk.PushServiceFactory;
|
||||
import com.aoleyun.sn.BuildConfig;
|
||||
import com.aoleyun.sn.R;
|
||||
import com.aoleyun.sn.activity.main.MainActivity;
|
||||
import com.aoleyun.sn.base.BaseService;
|
||||
import com.aoleyun.sn.bean.PoweroffBean;
|
||||
import com.aoleyun.sn.comm.CommonConfig;
|
||||
import com.aoleyun.sn.comm.JGYActions;
|
||||
@@ -68,10 +68,7 @@ import com.google.gson.reflect.TypeToken;
|
||||
import com.hjq.toast.Toaster;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.trello.rxlifecycle4.LifecycleProvider;
|
||||
import com.trello.rxlifecycle4.LifecycleTransformer;
|
||||
import com.trello.rxlifecycle4.RxLifecycle;
|
||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||
import com.trello.rxlifecycle4.android.RxLifecycleAndroid;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.text.SimpleDateFormat;
|
||||
@@ -86,14 +83,14 @@ import io.reactivex.rxjava3.core.ObservableEmitter;
|
||||
import io.reactivex.rxjava3.core.ObservableOnSubscribe;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
import io.reactivex.rxjava3.subjects.BehaviorSubject;
|
||||
|
||||
public class MainService extends Service implements MainSContact.MainView, NetworkUtils.OnNetworkStatusChangedListener, LifecycleProvider<ActivityEvent> {
|
||||
public class MainService extends BaseService implements MainSContact.MainView, NetworkUtils.OnNetworkStatusChangedListener, LifecycleProvider<ActivityEvent> {
|
||||
private static final String TAG = "MainService";
|
||||
|
||||
public MainSPresenter mPresenter;
|
||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
|
||||
public MainSPresenter mPresenter;
|
||||
|
||||
private static final String JXW_LAUNCHER = "com.wyt.wangkexueximvvm";
|
||||
|
||||
@Override
|
||||
@@ -109,7 +106,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
String WiFiAlias = Utils.getWifiAlias(this);
|
||||
Log.e("OnNetworkStatusChanged", "onConnected: " + WiFiAlias);
|
||||
JgyUtils.getInstance().addNetworkConnectedTime(System.currentTimeMillis() / 1000);
|
||||
mPresenter.sendNetwork(JgyUtils.getInstance().getNetworkConnectedTime());
|
||||
// mPresenter.sendNetwork(JgyUtils.getInstance().getNetworkConnectedTime());
|
||||
if (JgyUtils.getInstance().isScreenOn()) {
|
||||
TimeTask task = new TimeTask();
|
||||
task.execute("ntp.aliyun.com");
|
||||
@@ -278,23 +275,6 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
}
|
||||
};
|
||||
|
||||
private final BehaviorSubject<ActivityEvent> lifecycleSubject = BehaviorSubject.create();
|
||||
|
||||
@Override
|
||||
public Observable<ActivityEvent> lifecycle() {
|
||||
return lifecycleSubject.hide();
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> LifecycleTransformer<T> bindUntilEvent(ActivityEvent event) {
|
||||
return RxLifecycle.bindUntilEvent(lifecycleSubject, event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> LifecycleTransformer<T> bindToLifecycle() {
|
||||
return RxLifecycleAndroid.bindActivity(lifecycleSubject);
|
||||
}
|
||||
|
||||
private WifiReceiver mWifiReceiver;
|
||||
|
||||
private void registerWiFiReceiver() {
|
||||
@@ -382,6 +362,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
String action = intent.getAction();
|
||||
Log.e("RefreshReceiver", "onReceive: " + action);
|
||||
if (!TextUtils.isEmpty(action)) {
|
||||
NetInterfaceManager.clearAllCache();
|
||||
mPresenter.getLockedState();
|
||||
}
|
||||
}
|
||||
@@ -465,10 +446,9 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
Log.e(TAG, "onCreate: ");
|
||||
lifecycleSubject.onNext(ActivityEvent.CREATE);
|
||||
mPresenter = new MainSPresenter(this);
|
||||
mPresenter.attachView(this);
|
||||
mPresenter.setLifecycle(lifecycleSubject);
|
||||
mPresenter.setLifecycle(getLifecycleSubject());
|
||||
if ("YX-T01".equalsIgnoreCase(Build.MODEL)) {
|
||||
JgyUtils.getInstance().setTongyiAppTop();
|
||||
}
|
||||
@@ -599,13 +579,14 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
|
||||
registerReceivers();
|
||||
NetworkUtils.registerNetworkStatusChangedListener(this);
|
||||
addShortcut();
|
||||
timeChangedStart.onstar(System.currentTimeMillis());
|
||||
setStatusbar();
|
||||
setFloatingWindow();
|
||||
JgyUtils.getInstance().writeAppPackageList();
|
||||
// notificationManager = NotificationManagerCompat.from(this);
|
||||
// createNotificationChannel();
|
||||
notificationManager = NotificationManagerCompat.from(this);
|
||||
createNotificationChannel();
|
||||
sendSimpleNotification();
|
||||
|
||||
// aliyunPushInit();
|
||||
|
||||
IActivityManager activityManager = ActivityManagerNative.getDefault();
|
||||
@@ -646,7 +627,6 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
lifecycleSubject.onNext(ActivityEvent.DESTROY);
|
||||
unRegisterReceivers();
|
||||
NetworkUtils.unregisterNetworkStatusChangedListener(this);
|
||||
mPresenter.detachView();
|
||||
@@ -673,7 +653,6 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
channel.setDescription(CHANNEL_DESCRIPTION);
|
||||
// Register the channel with the system; you can't change the importance
|
||||
// or other notification behaviors after this
|
||||
NotificationManager notificationManager = getSystemService(NotificationManager.class);
|
||||
notificationManager.createNotificationChannel(channel);
|
||||
}
|
||||
}
|
||||
@@ -691,11 +670,8 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
.setOngoing(true)
|
||||
.setPriority(NotificationCompat.PRIORITY_MAX);
|
||||
// notificationId is a unique int for each notification that you must define
|
||||
notificationManager.notify(NotificationID, builder.build());
|
||||
}
|
||||
|
||||
private void addShortcut() {
|
||||
ApkUtils.addShortcut(this);
|
||||
// notificationManager.notify(NotificationID, builder.build());
|
||||
startForeground(NotificationID, builder.build());
|
||||
}
|
||||
|
||||
private void setStatusbar() {
|
||||
@@ -922,22 +898,25 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
@SuppressLint("NewApi")
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
Log.e(TAG, "onReceive: " + intent.getAction());
|
||||
if (Intent.ACTION_DATE_CHANGED.equals(intent.getAction())) {
|
||||
Log.e("TimeChangedReceiver", "onReceive:" + "data changed");
|
||||
} else if (Intent.ACTION_TIME_CHANGED.equals(intent.getAction())) {
|
||||
Log.e("TimeChangedReceiver", "onReceive:" + "time changed");
|
||||
} else if (Intent.ACTION_TIMEZONE_CHANGED.equals(intent.getAction())) {
|
||||
Log.e("TimeChangedReceiver", "onReceive:" + "timezone changed");
|
||||
} else if (Intent.ACTION_TIME_TICK.equals(intent.getAction())) {
|
||||
Log.e("TimeChangedReceiver", "onReceive:" + "time tick");
|
||||
checkShutdownTime();
|
||||
checkUploadLogTime();
|
||||
setFloatingWindow();
|
||||
} else if (ACTION_UPDATE.equals(intent.getAction())) {
|
||||
setFloatingWindow();
|
||||
Log.e("TimeChangedReceiver", "onReceive: " + intent.getAction());
|
||||
String action = intent.getAction();
|
||||
if (TextUtils.isEmpty(action)) {
|
||||
return;
|
||||
}
|
||||
switch (action) {
|
||||
case Intent.ACTION_DATE_CHANGED:
|
||||
case Intent.ACTION_TIME_CHANGED:
|
||||
case Intent.ACTION_TIMEZONE_CHANGED:
|
||||
case Intent.ACTION_TIME_TICK:
|
||||
checkShutdownTime();
|
||||
checkUploadLogTime();
|
||||
setFloatingWindow();
|
||||
JgyUtils.getInstance().checkTimePeriod();
|
||||
break;
|
||||
case ACTION_UPDATE:
|
||||
setFloatingWindow();
|
||||
// mPresenter.getScreenLockState();
|
||||
Log.e("TimeChangedReceiver", "onReceive:" + "date update");
|
||||
break;
|
||||
}
|
||||
timeChangedStart.onstar(System.currentTimeMillis());
|
||||
}
|
||||
@@ -1064,6 +1043,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private interface TopApp {
|
||||
void open(Long time);
|
||||
}
|
||||
@@ -1168,7 +1148,6 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
Log.e(TAG, "setLockedState: " + loocked);
|
||||
if (loocked) {
|
||||
Toaster.debugShow("设备已上锁");
|
||||
// sendSimpleNotification();
|
||||
mPresenter.setPushTags();
|
||||
ApkUtils.UninstallAPP(this, "com.joytv.live");
|
||||
ApkUtils.UninstallAPP(this, "com.tencent.android.qqdownloader");
|
||||
@@ -1192,6 +1171,9 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
// mPresenter.getStudesInfo(true);
|
||||
mPresenter.checkAoleyunUpdate();
|
||||
// SysSettingUtils.setEnableSetting(this);
|
||||
Settings.System.putString(getContentResolver(), CommonConfig.AOLE_ACTION_FORCE_APP, "");
|
||||
mPresenter.getForceDownload();
|
||||
mPresenter.getAppLimit();
|
||||
} else {
|
||||
mPresenter.getFirstConnect();
|
||||
mPresenter.getStudesInfo();
|
||||
|
||||
@@ -1365,10 +1365,6 @@ public class ApkUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public static void addShortcut(Context context) {
|
||||
|
||||
}
|
||||
|
||||
private static final Set<String> AoleyunOSApp = new HashSet<String>() {{
|
||||
this.add("com.aoleyun.info");
|
||||
this.add("com.aoleyun.os");
|
||||
|
||||
@@ -55,6 +55,8 @@ import com.aoleyun.sn.bean.LessonJson;
|
||||
import com.aoleyun.sn.bean.NetAndLaunchBean;
|
||||
import com.aoleyun.sn.bean.NetAndLaunchData;
|
||||
import com.aoleyun.sn.bean.TTAppground;
|
||||
import com.aoleyun.sn.bean.TimeControlApp;
|
||||
import com.aoleyun.sn.bean.TimeControlInfo;
|
||||
import com.aoleyun.sn.comm.CommonConfig;
|
||||
import com.aoleyun.sn.comm.JGYActions;
|
||||
import com.aoleyun.sn.comm.PackageNames;
|
||||
@@ -98,6 +100,9 @@ import java.net.Inet4Address;
|
||||
import java.net.InetAddress;
|
||||
import java.net.NetworkInterface;
|
||||
import java.net.SocketException;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Enumeration;
|
||||
@@ -143,6 +148,8 @@ public class JgyUtils {
|
||||
private LessonJson mLessonJson;
|
||||
private TimeUtils.ContralTime mContralTime;
|
||||
|
||||
private List<TimeControlInfo> mAppPeriods;
|
||||
|
||||
public static final int UnknowPlatform = 0;
|
||||
|
||||
public static final int MTKPlatform = 1;
|
||||
@@ -166,6 +173,7 @@ public class JgyUtils {
|
||||
public static final int U1302Platform = 26;
|
||||
public static final int MT6765Platform = 28;
|
||||
public static final int G128TPlatform = 29;
|
||||
public static final int QualcommTPlatform = 30;
|
||||
|
||||
|
||||
public static final String Other = "其他";
|
||||
@@ -191,6 +199,7 @@ public class JgyUtils {
|
||||
public static final String allwinner_U1302 = "QZA15";
|
||||
public static final String MT6765_TAG = "MT6765";
|
||||
public static final String G128T_TAG = "G128T";
|
||||
public static final String Qualcomm_TAG = "QualcommA";
|
||||
|
||||
|
||||
private CacheHelper cacheHelper;
|
||||
@@ -230,12 +239,17 @@ public class JgyUtils {
|
||||
bindEbaifenService();
|
||||
}
|
||||
refresh();
|
||||
syncTimePeriod();
|
||||
}
|
||||
|
||||
public static void init(Context context) {
|
||||
if (sInstance == null) {
|
||||
Log.e(TAG, "init: ");
|
||||
sInstance = new JgyUtils(context);
|
||||
synchronized (JgyUtils.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new JgyUtils(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -342,6 +356,9 @@ public class JgyUtils {
|
||||
} else if (G128T_TAG.equalsIgnoreCase(platform)) {
|
||||
Log.i(TAG, "checkAppPlatform: " + "G128T");
|
||||
return G128TPlatform;
|
||||
} else if (Qualcomm_TAG.equalsIgnoreCase(platform)) {
|
||||
Log.i(TAG, "checkAppPlatform: " + "QualcommA");
|
||||
return QualcommTPlatform;
|
||||
} else {
|
||||
Log.i(TAG, "checkAppPlatform: " + "没有数据");
|
||||
return UnknowPlatform;
|
||||
@@ -408,6 +425,8 @@ public class JgyUtils {
|
||||
getAppPlatformCallback.AppPlatform(MT6765Platform);
|
||||
} else if (G128T_TAG.equalsIgnoreCase(platform)) {
|
||||
getAppPlatformCallback.AppPlatform(G128TPlatform);
|
||||
} else if (Qualcomm_TAG.equalsIgnoreCase(platform)) {
|
||||
getAppPlatformCallback.AppPlatform(QualcommTPlatform);
|
||||
} else {
|
||||
getAppPlatformCallback.AppPlatform(UnknowPlatform);
|
||||
}
|
||||
@@ -415,35 +434,7 @@ public class JgyUtils {
|
||||
|
||||
public String getAppPlatform() {
|
||||
String platform = BuildConfig.platform;
|
||||
if (MTKTag.equalsIgnoreCase(platform)) {
|
||||
return MTKTag;
|
||||
} else if (ZhanruiTag.equalsIgnoreCase(platform)) {
|
||||
return ZhanruiTag;
|
||||
}
|
||||
// else if (CubeTag.equalsIgnoreCase(platform)) {
|
||||
// return CubeTag;
|
||||
// }
|
||||
else if (MTK11Tag.equalsIgnoreCase(platform)) {
|
||||
return MTK11Tag;
|
||||
} else if (TeclastP20sTag.equalsIgnoreCase(platform)) {
|
||||
return TeclastP20sTag;
|
||||
} else if (AH6016Tag.equalsIgnoreCase(platform)) {
|
||||
return AH6016Tag;
|
||||
} else if (ZR6016Tag.equalsIgnoreCase(platform)) {
|
||||
return ZR6016Tag;
|
||||
} else if (HRAD13Tag.equalsIgnoreCase(platform)) {
|
||||
return HRAD13Tag;
|
||||
} else if (G10PTag.equalsIgnoreCase(platform)) {
|
||||
return G10PTag;
|
||||
} else if (C2Tag.equalsIgnoreCase(platform)) {
|
||||
return C2Tag;
|
||||
} else if (YXPD1TAG.equalsIgnoreCase(platform)) {
|
||||
return YXPD1TAG;
|
||||
} else if (G11TAG.equalsIgnoreCase(platform)) {
|
||||
return G11TAG;
|
||||
} else {
|
||||
return Other;
|
||||
}
|
||||
return platform;
|
||||
}
|
||||
|
||||
public static boolean isOfficialVersion() {
|
||||
@@ -1028,17 +1019,13 @@ public class JgyUtils {
|
||||
return;
|
||||
}
|
||||
if (appIDList == null || appIDList.isEmpty()) {
|
||||
if ("G10".equals(Build.MODEL) || "D1".equals(Build.MODEL)) {
|
||||
Settings.System.putString(mContext.getContentResolver(), CommonConfig.APP_VIEW_CLICK_DISABLED, "com.arivoc.wordhd:2131624676,2131624689;com.ttstd.utils:12345");
|
||||
} else {
|
||||
try {
|
||||
Settings.System.putString(crv, CommonConfig.APP_VIEW_CLICK_DISABLED, null);
|
||||
// TODO: 2024/9/11 修复1.4.0907版本数据为空系统报错
|
||||
CmdUtil.Result result = CmdUtil.execute(" settings delete system app_view_click_disabled");
|
||||
Log.e(TAG, "writeDeselectIDtoSystem: " + result);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
try {
|
||||
Settings.System.putString(crv, CommonConfig.APP_VIEW_CLICK_DISABLED, null);
|
||||
// TODO: 2024/9/11 修复1.4.0907版本数据为空系统报错
|
||||
CmdUtil.Result result = CmdUtil.execute(" settings delete system app_view_click_disabled");
|
||||
Log.e(TAG, "writeDeselectIDtoSystem: " + result);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
String s = appIDList.stream().map(new Function<AppID, String>() {
|
||||
@@ -1516,7 +1503,6 @@ public class JgyUtils {
|
||||
setAppRestriction(0);
|
||||
return;
|
||||
}
|
||||
ApkUtils.addShortcut(mContext);
|
||||
HashSet<String> pkgSet = new HashSet<>(defaultPackages);
|
||||
if (BuildConfig.DEBUG) {
|
||||
pkgSet.add("com.reqable.android");
|
||||
@@ -1794,6 +1780,8 @@ public class JgyUtils {
|
||||
Log.e(TAG, "deleteOtherApp: " + "start");
|
||||
Set<String> allAppWhiteSet = mMMKV.decodeStringSet(CommonConfig.AOLE_ALL_APP_WHITE_LIST_KEY, new HashSet<>());
|
||||
Log.e("deleteOtherApp", "allAppWhiteSet:" + allAppWhiteSet);
|
||||
Set<String> pubAppSet = mMMKV.decodeStringSet(CommonConfig.AOLE_PUBLIC_APP_INSTALL_WHITELIST, new HashSet<>());
|
||||
Log.e(TAG, "deleteOtherApp: pubAppSet = " + pubAppSet);
|
||||
|
||||
List<String> resulWhitetList = new ArrayList<>(defaultPackages);
|
||||
resulWhitetList.addAll(allAppWhiteSet);
|
||||
@@ -2929,8 +2917,8 @@ public class JgyUtils {
|
||||
jsonObject.addProperty("jpush_id", PushServiceFactory.getCloudPushService().getDeviceId());
|
||||
jsonObject.addProperty("devices_version", Utils.getCustomVersion());
|
||||
jsonObject.addProperty("appstore_version", BuildConfig.VERSION_NAME);
|
||||
jsonObject.addProperty("store_version", Utils.getAPPVersionName(PackageNames.APPSTORE, mContext));
|
||||
jsonObject.addProperty("desktop_version", Utils.getAPPVersionName("com.aoleyun.os", mContext));
|
||||
jsonObject.addProperty("store_version", Utils.getAppVersionName(PackageNames.APPSTORE, mContext));
|
||||
jsonObject.addProperty("desktop_version", Utils.getAppVersionName("com.aoleyun.os", mContext));
|
||||
jsonObject.addProperty("local_mac", Utils.getAndroid7MAC());
|
||||
// jsonObject.addProperty("wifi_status", Utils.obtainWifiInfo(mContext));
|
||||
jsonObject.addProperty("PN_ip", mMMKV.decodeString(NetInterfaceManager.PublicIP, ""));
|
||||
@@ -2998,6 +2986,7 @@ public class JgyUtils {
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public List<String> getHidePackage() {
|
||||
String jsonString = cacheHelper.getAsString(UrlAddress.GET_HIDE_DESKTOPICON);
|
||||
//为 "" 是已经请求成功的
|
||||
@@ -3916,4 +3905,133 @@ public class JgyUtils {
|
||||
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
|
||||
}
|
||||
}
|
||||
|
||||
private String getTopActivityInfo() {
|
||||
ActivityManager manager = (ActivityManager) mContext.getApplicationContext().getSystemService(Context.ACTIVITY_SERVICE);
|
||||
List<ActivityManager.RunningTaskInfo> runningTaskInfos = manager.getRunningTasks(1);
|
||||
if (runningTaskInfos != null && !runningTaskInfos.isEmpty()) {
|
||||
ComponentName componentName = runningTaskInfos.get(0).topActivity;
|
||||
if (componentName != null) {
|
||||
String currentClassName = componentName.getPackageName();
|
||||
return currentClassName;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public boolean inOpenTimePeriod(TimeControlInfo timeControlInfo) {
|
||||
String startTimeStr = timeControlInfo.getStart_time();
|
||||
String endTimeStr = timeControlInfo.getEnd_time();
|
||||
|
||||
// 获取当前日期和时间
|
||||
LocalDate currentDate = LocalDate.now();
|
||||
LocalTime currentTime = LocalTime.now();
|
||||
|
||||
// 解析时间并比较
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm");
|
||||
LocalTime startTime = LocalTime.parse(startTimeStr, formatter);
|
||||
LocalTime endTime = LocalTime.parse(endTimeStr, formatter);
|
||||
|
||||
boolean inTime = !currentTime.isBefore(startTime) && !currentTime.isAfter(endTime);
|
||||
return inTime;
|
||||
}
|
||||
|
||||
public void syncTimePeriod() {
|
||||
String jsonString = mMMKV.decodeString(CommonConfig.TIME_CONTROL_DATA_KEY, "");
|
||||
if (TextUtils.isEmpty(jsonString)) {
|
||||
mAppPeriods = null;
|
||||
return;
|
||||
}
|
||||
Gson gson = new Gson();
|
||||
Type type = new TypeToken<List<TimeControlInfo>>() {
|
||||
}.getType();
|
||||
try {
|
||||
mAppPeriods = gson.fromJson(jsonString, type);
|
||||
Log.e(TAG, "checkTimePeriod: periods = " + mAppPeriods);
|
||||
checkTimePeriod();
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "checkTimePeriod: Exception = " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public void checkTimePeriod() {
|
||||
if (mAppPeriods == null || mAppPeriods.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
String foregroundPackage = getTopActivityInfo();
|
||||
if (ApkUtils.isSystemApp(mContext, foregroundPackage)) {
|
||||
Log.d(TAG, "checkTimePeriod: " + foregroundPackage + " is system app, skip");
|
||||
return;
|
||||
}
|
||||
Set<String> packageNames = mAppPeriods.stream()
|
||||
.filter(new Predicate<TimeControlInfo>() {
|
||||
@Override
|
||||
public boolean test(TimeControlInfo timeControlInfo) {
|
||||
return inOpenTimePeriod(timeControlInfo);
|
||||
}
|
||||
})
|
||||
.map(new Function<TimeControlInfo, List<String>>() {
|
||||
@Override
|
||||
public List<String> apply(TimeControlInfo timeControlInfo) {
|
||||
return timeControlInfo.getApp().stream().map(new Function<TimeControlApp, String>() {
|
||||
@Override
|
||||
public String apply(TimeControlApp timeControlApp) {
|
||||
return timeControlApp.getApp_package();
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
})
|
||||
//使用 stream 和 flatMap 将所有元素合并
|
||||
.flatMap(List::stream)
|
||||
.collect(Collectors.toSet());
|
||||
Log.d(TAG, "checkTimePeriod: " + packageNames);
|
||||
if (packageNames.contains(foregroundPackage)) {
|
||||
Log.e(TAG, "checkTimePeriod: " + foregroundPackage + " skip");
|
||||
} else {
|
||||
gotoLauncher();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param pkgName
|
||||
* @return true为可以打开
|
||||
*/
|
||||
public boolean checkTimePeriod(String pkgName) {
|
||||
if (mAppPeriods == null || mAppPeriods.isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
if (ApkUtils.isSystemApp(mContext, pkgName)) {
|
||||
Log.d(TAG, "checkTimePeriod: " + pkgName + " is system app, skip");
|
||||
return true;
|
||||
}
|
||||
Set<String> packageNames = mAppPeriods.stream()
|
||||
.filter(new Predicate<TimeControlInfo>() {
|
||||
@Override
|
||||
public boolean test(TimeControlInfo timeControlInfo) {
|
||||
return inOpenTimePeriod(timeControlInfo);
|
||||
}
|
||||
})
|
||||
.map(new Function<TimeControlInfo, List<String>>() {
|
||||
@Override
|
||||
public List<String> apply(TimeControlInfo timeControlInfo) {
|
||||
return timeControlInfo.getApp().stream().map(new Function<TimeControlApp, String>() {
|
||||
@Override
|
||||
public String apply(TimeControlApp timeControlApp) {
|
||||
return timeControlApp.getApp_package();
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
})
|
||||
//使用 stream 和 flatMap 将所有元素合并
|
||||
.flatMap(List::stream)
|
||||
.collect(Collectors.toSet());
|
||||
Log.d(TAG, "checkTimePeriod: " + packageNames);
|
||||
if (packageNames.contains(pkgName)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -5,7 +5,6 @@ import android.app.StatusBarManager;
|
||||
import android.bluetooth.BluetoothAdapter;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.cube.SuperPower;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
@@ -205,8 +204,12 @@ public class SysSettingUtils {
|
||||
if (JgyUtils.isAllWinnerDevice()) {
|
||||
AllwinnerCubeMdmManager.getInstance().setUsbStatus(state);
|
||||
} else {
|
||||
SuperPower mService = (SuperPower) context.getSystemService("mdm");
|
||||
mService.setUsbDataDisabled(true);
|
||||
// try {
|
||||
// SuperPower mService = (SuperPower) context.getSystemService("mdm");
|
||||
// mService.setUsbDataDisabled(true);
|
||||
// } catch (Exception e) {
|
||||
// Log.e(TAG, "setUsbStatus: " + e.getMessage());
|
||||
// }
|
||||
}
|
||||
} else {
|
||||
if (state == 0) {
|
||||
@@ -257,15 +260,15 @@ public class SysSettingUtils {
|
||||
|
||||
// if (!BuildConfig.DEBUG) {
|
||||
if (JgyUtils.isCubeDevice()) {
|
||||
SuperPower mService = (SuperPower) context.getSystemService("mdm");
|
||||
// SuperPower mService = (SuperPower) context.getSystemService("mdm");
|
||||
switch (setting_usb) {
|
||||
case "usb_mtp":
|
||||
mService.setUsbDataDisabled(false);
|
||||
// mService.setUsbDataDisabled(false);
|
||||
break;
|
||||
default:
|
||||
case "usb_midi":
|
||||
case "usb_charge":
|
||||
mService.setUsbDataDisabled(true);
|
||||
// mService.setUsbDataDisabled(true);
|
||||
break;
|
||||
}
|
||||
} else if (JgyUtils.isAllWinnerDevice()) {
|
||||
@@ -1167,16 +1170,16 @@ public class SysSettingUtils {
|
||||
//MTP模式:usb_mtp
|
||||
//Midi模式:usb_midi
|
||||
if (JgyUtils.isCubeDevice()) {
|
||||
SuperPower mService = (SuperPower) context.getSystemService("mdm");
|
||||
switch (status) {
|
||||
case 0:
|
||||
mService.setUsbDataDisabled(true);
|
||||
break;
|
||||
case 1:
|
||||
mService.setUsbDataDisabled(false);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
// SuperPower mService = (SuperPower) context.getSystemService("mdm");
|
||||
// switch (status) {
|
||||
// case 0:
|
||||
// mService.setUsbDataDisabled(true);
|
||||
// break;
|
||||
// case 1:
|
||||
// mService.setUsbDataDisabled(false);
|
||||
// break;
|
||||
// default:
|
||||
// }
|
||||
} else {
|
||||
String usbStatus;
|
||||
switch (status) {
|
||||
|
||||
@@ -741,7 +741,7 @@ public class Utils {
|
||||
}
|
||||
|
||||
//获取App版本号
|
||||
public static String getAPPVersionName(String pck, Context context) {
|
||||
public static String getAppVersionName(String pck, Context context) {
|
||||
PackageManager pm = context.getPackageManager();
|
||||
String versionName;
|
||||
try {
|
||||
@@ -874,7 +874,7 @@ public class Utils {
|
||||
@SuppressLint({"MissingPermission", "HardwareIds"})
|
||||
public static String getSn() {
|
||||
// if (BuildConfig.DEBUG) {
|
||||
// return "GMG1096250930004";
|
||||
// return "LTPHR23040000006";
|
||||
// }
|
||||
String serial = "unknow";
|
||||
try {
|
||||
@@ -1837,6 +1837,7 @@ public class Utils {
|
||||
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.U1302Platform
|
||||
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.MT6765Platform
|
||||
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.G128TPlatform
|
||||
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.QualcommTPlatform
|
||||
) {
|
||||
return Utils.getProperty("ro.build.display.id", "获取失败");
|
||||
} else {
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ allprojects {
|
||||
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
// mavenCentral()
|
||||
maven { url "https://jitpack.io" }
|
||||
maven { url 'https://developer.huawei.com/repo/' }
|
||||
maven { url 'https://maven.aliyun.com/repository/central/' }
|
||||
|
||||
Reference in new issue
Block a user