Compare commits
4
Commits
d955edce80
...
1.6.0507
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c7851a8a64 | ||
|
|
f42d63e93c | ||
|
|
1aa6016f1e | ||
|
|
055e63d1a0 |
No files matched your search
+2
-2
@@ -29,8 +29,8 @@ android {
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.aoleyun.sn"
|
||||
versionCode 212
|
||||
versionName "1.6.0421"
|
||||
versionCode 216
|
||||
versionName "1.6.0507"
|
||||
|
||||
//There are no CERT files because If the mini sdk version is 23+, the AGP will ignore the V1 scheme signature.
|
||||
minSdkVersion 24
|
||||
|
||||
@@ -3,21 +3,19 @@ package com.aoleyun.sn.activity;
|
||||
import android.app.ActivityManager;
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
import com.aoleyun.sn.BuildConfig;
|
||||
import com.aoleyun.sn.R;
|
||||
import com.aoleyun.sn.base.BaseDataBindingActivity;
|
||||
import com.aoleyun.sn.base.mvp.BaseMvpActivity;
|
||||
import com.aoleyun.sn.databinding.ActivityCleanupBinding;
|
||||
import com.aoleyun.sn.utils.ApkUtils;
|
||||
import com.aoleyun.sn.utils.AppUtil;
|
||||
import com.hjq.toast.Toaster;
|
||||
import com.king.view.circleprogressview.CircleProgressView;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.List;
|
||||
@@ -68,7 +66,7 @@ public class CleanupActivity extends BaseDataBindingActivity {
|
||||
}
|
||||
Toaster.show(String.format(getString(R.string.clear_app_size), pkgList.size()));
|
||||
refreshMemory();
|
||||
Handler.getMain().postDelayed(new Runnable() {
|
||||
new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
finish();
|
||||
|
||||
@@ -10,6 +10,7 @@ import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.provider.Settings;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
@@ -25,7 +26,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;
|
||||
@@ -66,7 +66,7 @@ public class SplashActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_home);
|
||||
initView();
|
||||
debugTest();
|
||||
new Handler().postDelayed(() -> {
|
||||
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
startActivity(new Intent(SplashActivity.this, MainActivity.class));
|
||||
finish();
|
||||
// sendBroadcastStatus("0");
|
||||
@@ -101,7 +101,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 +171,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 {
|
||||
|
||||
@@ -376,7 +376,7 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
||||
public void onServiceConnected(ComponentName name, IBinder service) {
|
||||
Log.e(TAG, "onServiceConnected: ");
|
||||
mMainBinder = (MainService.MainBinder) service;
|
||||
mMainBinder.getService().mPresenter.getLockedState();
|
||||
mMainBinder.getService().mServiceModel.getLockedState();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -81,7 +81,7 @@ public class MainViewModel extends BaseViewModel<ActivityMainBinding, ActivityEv
|
||||
* 通过sn获取用户信息
|
||||
*/
|
||||
public void getStudesInfo() {
|
||||
NetInterfaceManager.getInstance().getStudesInfo(true, getLifecycle(), new NetInterfaceManager.StudesInfoListener() {
|
||||
NetInterfaceManager.getInstance().getStudesInfo(getLifecycle(), new NetInterfaceManager.StudesInfoListener() {
|
||||
@Override
|
||||
public void setStudentsInfo(StudentsInfo studentsInfo) {
|
||||
mStudentsInfoData.setValue(studentsInfo);
|
||||
@@ -97,7 +97,7 @@ public class MainViewModel extends BaseViewModel<ActivityMainBinding, ActivityEv
|
||||
public MutableLiveData<Boolean> mEBagCodeData = new MutableLiveData<>();
|
||||
|
||||
public void getEBagCode() {
|
||||
NetInterfaceManager.getInstance().getEBagCode(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
NetInterfaceManager.getInstance().getEBagCode(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mEBagCodeData.setValue(Settings.Global.getInt(getCtx().getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 0) == 1);
|
||||
@@ -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))
|
||||
@@ -188,7 +186,7 @@ public class MainViewModel extends BaseViewModel<ActivityMainBinding, ActivityEv
|
||||
|
||||
public void checkAoleyunUpdate() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.checkAoleyunUpdate(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
.checkAoleyunUpdate(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
@@ -199,7 +197,7 @@ public class MainViewModel extends BaseViewModel<ActivityMainBinding, ActivityEv
|
||||
public void checkTestUpdate() {
|
||||
if (!JgyUtils.getInstance().tagEmpty()) {
|
||||
NetInterfaceManager.getInstance()
|
||||
.checkTestUpdate(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
.checkTestUpdate(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -234,7 +232,7 @@ public class MainViewModel extends BaseViewModel<ActivityMainBinding, ActivityEv
|
||||
|
||||
public void getDefaultApp() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getDefaultApp(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
.getDefaultApp(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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,13 +2,11 @@ package com.aoleyun.sn.bean;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonParser;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
public class BaseResponse<T> implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 5468533687801294972L;
|
||||
@@ -17,6 +15,10 @@ public class BaseResponse<T> implements Serializable {
|
||||
public String msg;
|
||||
public T data;
|
||||
|
||||
public boolean isSuccess() {
|
||||
return code == 200;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
@@ -115,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*/
|
||||
|
||||
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,11 @@ 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 GROUP_APP_INSTALL_LIST = "forceinstall/group-app";
|
||||
|
||||
/*电子围栏*/
|
||||
public static final String GET_SN_EFENCE = "android/sn/efence";
|
||||
|
||||
@@ -39,15 +52,14 @@ 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_ADMIN_APP = "And/app/getAdminApp";
|
||||
/*公共应用*/
|
||||
public static final String HTTP_TAG_COMMOAPP = "Rank/commonApp";
|
||||
/*强制安装应用*/
|
||||
public static final String GET_FORCE_INSTALL_LIST = "forceinstall/index";
|
||||
/*分组应用强制安装*/
|
||||
public static final String GROUP_APP_INSTALL_LIST = "forceinstall/group-app";
|
||||
|
||||
/*通过固件名获取内置应用*/
|
||||
@Deprecated
|
||||
public static final String GET_ROM_APP = "And/getFirmwareApp";
|
||||
|
||||
/*获取应用升级自启*/
|
||||
public static final String NET_AND_LAUNCH_API = "automatic/get";
|
||||
/*获取禁用的app包名*/
|
||||
@@ -58,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
|
||||
@@ -70,36 +81,30 @@ 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";
|
||||
/*获取系统设置*/
|
||||
@@ -134,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,61 @@
|
||||
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
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SEND_DOWNLOAD_TIMES)
|
||||
@Deprecated
|
||||
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,22 +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.bean.TimeControlData;
|
||||
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
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_TIME_CONTROL)
|
||||
Observable<BaseResponse<TimeControlData>> getTimeControl(
|
||||
@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.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.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface RankCommonAppApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.HTTP_TAG_COMMOAPP)
|
||||
Observable<BaseResponse<List<AppDateInfo>>> getRankApp(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn,
|
||||
@Field("page") String page
|
||||
);
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,7 @@ import android.media.MediaPlayer;
|
||||
import android.os.BatteryManager;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.PowerManager;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
@@ -35,13 +36,11 @@ import com.aoleyun.sn.bean.ScreenLockState;
|
||||
import com.aoleyun.sn.comm.CommonConfig;
|
||||
import com.aoleyun.sn.comm.JGYActions;
|
||||
import com.aoleyun.sn.dialog.CustomDialog;
|
||||
import com.aoleyun.sn.disklrucache.CacheHelper;
|
||||
import com.aoleyun.sn.gson.GsonUtils;
|
||||
import com.aoleyun.sn.gson.NullStringToEmptyAdapterFactory;
|
||||
import com.aoleyun.sn.manager.MapManager;
|
||||
import com.aoleyun.sn.network.NetInterfaceManager;
|
||||
import com.aoleyun.sn.network.RetryCallback;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
import com.aoleyun.sn.service.main.MainService;
|
||||
import com.aoleyun.sn.utils.ApkUtils;
|
||||
import com.aoleyun.sn.utils.BatteryUtils;
|
||||
@@ -96,8 +95,8 @@ import retrofit2.Response;
|
||||
public class PushManager {
|
||||
private static final String TAG = "PushManager";
|
||||
|
||||
public static final String ACTION_REFRESH_BINDING_STATUS = "RefreshBindingStatus";
|
||||
public static final String AOLEYUN_REFRESH_DESKTOP = "aoleyun_refresh_desktop_action";
|
||||
private static final String ACTION_REFRESH_BINDING_STATUS = "RefreshBindingStatus";
|
||||
private static final String AOLEYUN_REFRESH_DESKTOP = "aoleyun_refresh_desktop_action";
|
||||
|
||||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
@@ -105,7 +104,6 @@ public class PushManager {
|
||||
private Context mContext;
|
||||
private PackageManager mPackageManager;
|
||||
private ContentResolver mResolver;
|
||||
private CacheHelper mCacheHelper;
|
||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
|
||||
private PushManager(Context context) {
|
||||
@@ -114,7 +112,6 @@ public class PushManager {
|
||||
}
|
||||
this.mContext = context;
|
||||
this.mResolver = context.getContentResolver();
|
||||
this.mCacheHelper = new CacheHelper(context);
|
||||
this.mPackageManager = mContext.getPackageManager();
|
||||
}
|
||||
|
||||
@@ -320,7 +317,7 @@ public class PushManager {
|
||||
case MSG_INSTALL:
|
||||
Toaster.debugShow("收到管控:应用安装");
|
||||
doDownloadAndInstall(extras);
|
||||
Handler.getMain().postDelayed(new Runnable() {
|
||||
new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
NetInterfaceManager.getInstance().getDesktopIcon();
|
||||
@@ -355,7 +352,7 @@ public class PushManager {
|
||||
downloadForceInstallApk(extras);
|
||||
break;
|
||||
case SET_HOMEPAG_TAG:
|
||||
Handler.getMain().postDelayed(new Runnable() {
|
||||
new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
@@ -380,7 +377,7 @@ public class PushManager {
|
||||
break;
|
||||
case HIDE_DESKTOP_ICON:
|
||||
Toaster.debugShow("收到管控:隐藏应用设置");
|
||||
Handler.getMain().postDelayed(() -> {
|
||||
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
//后台发送时数据库未改变,有时候可能获取到的数据时上一次的
|
||||
Log.e(TAG, "run: HIDE_DESKTOP_ICON ");
|
||||
NetInterfaceManager.getInstance().getDesktopIcon();
|
||||
@@ -616,7 +613,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) {
|
||||
@@ -732,7 +729,7 @@ public class PushManager {
|
||||
}
|
||||
}
|
||||
ApkUtils.UninstallAPP(mContext, pkg);
|
||||
Handler.getMain().postDelayed(new Runnable() {
|
||||
new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
NetInterfaceManager.getInstance().getDesktopIcon();
|
||||
@@ -757,7 +754,7 @@ public class PushManager {
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "disableApp: " + e.getMessage());
|
||||
}
|
||||
Handler.getMain().postDelayed(() -> NetInterfaceManager.getInstance().getSnAppAttr(), 1234);
|
||||
new Handler(Looper.getMainLooper()).postDelayed(() -> NetInterfaceManager.getInstance().getSnAppAttr(), 1234);
|
||||
}
|
||||
|
||||
private void setLock_screen(int state, String name) {
|
||||
@@ -767,7 +764,6 @@ public class PushManager {
|
||||
ScreenLockState screenLockState = new ScreenLockState();
|
||||
screenLockState.setIs_screen_lock(state);
|
||||
screenLockState.setName(name);
|
||||
mCacheHelper.put(UrlAddress.GET_LOCK_SCREEN_STATE, GsonUtils.toJSONString(screenLockState));
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra("name", name);
|
||||
if (state == 1) {
|
||||
@@ -1000,7 +996,7 @@ public class PushManager {
|
||||
JgyUtils.release(mWakeLock);
|
||||
if (createTime != 0) {
|
||||
Log.e("createTime", String.valueOf(createTime));
|
||||
Handler.getMain().postDelayed(new Runnable() {
|
||||
new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
doscreenshot(createTime);
|
||||
@@ -1066,7 +1062,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) {
|
||||
@@ -1118,7 +1114,6 @@ public class PushManager {
|
||||
|
||||
private void getTopApp(String extras) {
|
||||
JsonObject jsonObject = GsonUtils.getJsonObject(extras);
|
||||
mCacheHelper.put(UrlAddress.GET_TOP_APP_CONTROL, extras);
|
||||
|
||||
String packageName = jsonObject.get("app_package").getAsString();
|
||||
if (TextUtils.isEmpty(packageName)) {
|
||||
@@ -1504,7 +1499,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())
|
||||
|
||||
@@ -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>() {
|
||||
|
||||
@@ -1,188 +0,0 @@
|
||||
package com.aoleyun.sn.service.main;
|
||||
|
||||
import com.aoleyun.sn.base.mvp.BasePresenter;
|
||||
import com.aoleyun.sn.base.mvp.BaseView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MainSContact {
|
||||
public interface Presenter extends BasePresenter<MainView> {
|
||||
/*分支1*/
|
||||
/*获取设备锁定状态*/
|
||||
void getLockedState();
|
||||
/*设置极光推送标签*/
|
||||
void setPushTags();
|
||||
|
||||
|
||||
/*分支2 基本信息*/
|
||||
/*是否第一次联网*/
|
||||
void getFirstConnect();
|
||||
/*获取学生信息*/
|
||||
void getStudesInfo();
|
||||
|
||||
/*分支3 上传信息*/
|
||||
/*上传联网时间*/
|
||||
void sendNetwork(List<Long> time);
|
||||
/*发送mac地址*/
|
||||
void sendMacAddress();
|
||||
/*更新设备信息*/
|
||||
void updateDeviceInfo();
|
||||
/*上传安装的应用列表*/
|
||||
void sendInstalled();
|
||||
/*获取设备信息更新*/
|
||||
void checkAoleyunUpdate();
|
||||
/*获取测试应用更新*/
|
||||
void checkTestUpdate();
|
||||
|
||||
/*分支4 根据SN获取*/
|
||||
/*获取开发者选项*/
|
||||
void getDeveloper();
|
||||
/*获取自定义内置app*/
|
||||
void getRomApp();
|
||||
/*获取屏幕锁状态*/
|
||||
void getScreenLockState();
|
||||
/*电子围栏*/
|
||||
void geteFence();
|
||||
|
||||
/*分支5 根据批次获取*/
|
||||
/*获取设备后台设置*/
|
||||
void getSystemSettingBegin();
|
||||
/*获取可被写入的安装包名*/
|
||||
void getAppLimit();
|
||||
/*获取强制下载apk*/
|
||||
void getForceDownload();
|
||||
/*获取桌面*/
|
||||
void getDefaultDesktop();
|
||||
/*设置开机动画*/
|
||||
void setLogoImg();
|
||||
/*获取壁纸*/
|
||||
void getWallpaper();
|
||||
/*获取所有app详细信息*/
|
||||
void getAllAppList();
|
||||
/*获取浏览器书签设置管控*/
|
||||
void getBrowserBookmarks();
|
||||
/*设置白名单的url 单独*/
|
||||
void getBrowserWhiteList();
|
||||
/*获取应用图标桌面可见性管控*/
|
||||
void getDesktopIcon();
|
||||
/*获取应用自启升级和网络权限管理*/
|
||||
void getAppAutoStartUpdateAndNet();
|
||||
/*获取禁用app*/
|
||||
void getSnAppAttr();
|
||||
/*获取第三方应用子页面ID连网限制*/
|
||||
void getAppIdControl();
|
||||
/*获取第三方应用内部网页跳转屏蔽*/
|
||||
void setAppinsideWeb();
|
||||
/*获取系统其他管控设置*/
|
||||
void getSystemSetting();
|
||||
/*获取系统默认程序设置*/
|
||||
void getDefaultApp();
|
||||
/*应用霸屏*/
|
||||
void setTopApp();
|
||||
/*获取关机时间*/
|
||||
void getPoweroffTime();
|
||||
/*获取时间管控*/
|
||||
void getSnTimeControl();
|
||||
void getSnSetting();
|
||||
/*获取网课模式*/
|
||||
void getCloudLessonSettings();
|
||||
/*获取电子书包激活码*/
|
||||
void getEbagCode();
|
||||
/*获取学习应用*/
|
||||
void getExclusiveAdminApp();
|
||||
/*获取全局黑名单*/
|
||||
void getBlackList();
|
||||
/*获取全局白名单*/
|
||||
void getWhiteList();
|
||||
/*获取wifi密码*/
|
||||
void getWiFiPasswd();
|
||||
|
||||
}
|
||||
|
||||
public interface MainView extends BaseView {
|
||||
/*获取设备锁定状态*/
|
||||
void setLockedState(boolean loocked);
|
||||
/*设置极光推送标签*/
|
||||
void setTagsFinish(boolean noTag);
|
||||
|
||||
|
||||
/*是否第一次联网*/
|
||||
void setFirstConnect(boolean state);
|
||||
/*获取学生信息*/
|
||||
void setStudesInfo();
|
||||
|
||||
/*上传联网时间*/
|
||||
void sendNetworkFinish();
|
||||
/*发送mac地址*/
|
||||
void sendMacFinish();
|
||||
/*更新设备信息*/
|
||||
void updateDeviceInfoFinish();
|
||||
/*上传安装的应用列表*/
|
||||
void sendInstalledFinish();
|
||||
|
||||
/*获取设备信息更新*/
|
||||
void checkAoleyunUpdateFinish();
|
||||
/*获取测试应用更新*/
|
||||
void checkTestUpdateFinish();
|
||||
/*获取开发者选项结束*/
|
||||
void getDeveloperFinish();
|
||||
/*获取自定义内置app*/
|
||||
void getRomAppFinish();
|
||||
/*设置屏幕锁状态结束*/
|
||||
void setScreenLockStateFinish(boolean locked, String tips);
|
||||
/*获取电子围栏结束*/
|
||||
void geteFenceFinish();
|
||||
|
||||
/*设置设备后台设置*/
|
||||
void setSystemSetting();
|
||||
/*获取可被写入的安装包名结束*/
|
||||
void getAppLimitFinish();
|
||||
/*获取强制下载apk结束*/
|
||||
void getForceDownloadFinish();
|
||||
/*获取桌面结束*/
|
||||
void getDefaultDesktopFinish();
|
||||
/*设置开机动画*/
|
||||
void setLogoImgFinish();
|
||||
/*获取开机动画结束*/
|
||||
void getWallpaperFinish();
|
||||
/*获取所有app详细信息*/
|
||||
void getAllAppListFinish();
|
||||
/*获取浏览器书签设置管控结束*/
|
||||
void getBrowserBookmarksFinish();
|
||||
/*设置白名单的url 单独*/
|
||||
void setBrowserWhiteList();
|
||||
/*获取应用图标桌面可见性管控结束*/
|
||||
void getDesktopIconFinish();
|
||||
/*获取应用自启升级和网络权限管理结束*/
|
||||
void getAppAutoStartUpdateAndNetFinish();
|
||||
/*获取禁用app*/
|
||||
void getSnAppAttrFinish();
|
||||
/*获取第三方应用子页面ID连网限制结束*/
|
||||
void getAppIdControlFinish();
|
||||
/*获取第三方应用内部网页跳转屏蔽结束*/
|
||||
void setAppinsideWebFinish();
|
||||
/*获取系统其他管控设置结束*/
|
||||
void getSystemSettingFinish();
|
||||
/*获取系统默认程序设置*/
|
||||
void setDefaultAppFinish();
|
||||
/*获取应用霸屏结束*/
|
||||
void setTopAppFinish();
|
||||
/*获取关机时间*/
|
||||
void setPoweroffTime();
|
||||
/*获取时间管控*/
|
||||
void getSnTimeControlFinish();
|
||||
void getSnSettingFinish();
|
||||
void setCloudLessonSettings();
|
||||
/*获取电子书包激活码*/
|
||||
void getEbagCodeFinish(boolean activation);
|
||||
/*获取学习应用*/
|
||||
void getExclusiveAdminAppFinish();
|
||||
/*获取全局黑名单结束*/
|
||||
void getBlackListFinish();
|
||||
/*获取全局白名单结束*/
|
||||
void getWhiteListFinish();
|
||||
/*获取wifi密码结束*/
|
||||
void setWiFiPasswd();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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,7 +43,9 @@ 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.bean.ScreenLockState;
|
||||
import com.aoleyun.sn.comm.CommonConfig;
|
||||
import com.aoleyun.sn.comm.JGYActions;
|
||||
import com.aoleyun.sn.comm.PackageNames;
|
||||
@@ -67,11 +68,6 @@ import com.google.gson.JsonObject;
|
||||
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,15 +82,15 @@ 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 NetworkUtils.OnNetworkStatusChangedListener {
|
||||
private static final String TAG = "MainService";
|
||||
|
||||
public MainSPresenter mPresenter;
|
||||
private static final String JXW_LAUNCHER = "com.wyt.wangkexueximvvm";
|
||||
|
||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
|
||||
private static final String JXW_LAUNCHER = "com.wyt.wangkexueximvvm";
|
||||
public MainServiceModel mServiceModel;
|
||||
|
||||
@Override
|
||||
public void onDisconnected() {
|
||||
@@ -114,7 +110,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
TimeTask task = new TimeTask();
|
||||
task.execute("ntp.aliyun.com");
|
||||
if (!checkAoleyunApp()) {
|
||||
mPresenter.checkAoleyunUpdate();
|
||||
mServiceModel.checkAoleyunUpdate();
|
||||
}
|
||||
}
|
||||
mInternetConnected.onConnected(WiFiAlias);
|
||||
@@ -131,7 +127,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
super.onPostExecute(aLong);
|
||||
AlarmManager am = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
|
||||
am.setTime(aLong);
|
||||
Handler.getMain().postDelayed(new Runnable() {
|
||||
new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// aliyunPushInit();
|
||||
@@ -187,47 +183,26 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
});
|
||||
}
|
||||
|
||||
private InternetConnected mInternetConnected;
|
||||
|
||||
public interface InternetConnected {
|
||||
void onConnected(String alias);
|
||||
}
|
||||
|
||||
private final ObservableOnSubscribe<String> networkSubscribe = new ObservableOnSubscribe<String>() {
|
||||
@Override
|
||||
public void subscribe(ObservableEmitter emitter) throws Exception {
|
||||
mInternetConnected = new InternetConnected() {
|
||||
@Override
|
||||
public void onConnected(String alias) {
|
||||
Log.e(TAG, "networkSubscribe: onConnected " + alias);
|
||||
emitter.onNext(alias);
|
||||
private void checkAliyunPushStatus() {
|
||||
CloudPushService mPushService = PushServiceFactory.getCloudPushService();
|
||||
mPushService.checkPushChannelStatus(new CommonCallback() {
|
||||
@Override
|
||||
public void onSuccess(String response) {
|
||||
Log.e("checkAliyunPushStatus", "onSuccess: " + response);
|
||||
if ("on".equals(response)) {
|
||||
// 当前是打开状态
|
||||
} else {
|
||||
// 当前是关闭状态
|
||||
aliyunPushInit();
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private Observer<String> networkObserver = new Observer<String>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
Log.e("networkObserver", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(String action) {
|
||||
Log.e("networkObserver", "onNext: " + action);
|
||||
mPresenter.getLockedState();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
Log.e("networkObserver", "onError: " + e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("networkObserver", "onComplete: ");
|
||||
}
|
||||
};
|
||||
@Override
|
||||
public void onFailed(String errorCode, String errorMessage) {
|
||||
Log.e("checkAliyunPushStatus", "onFailed: errorCode = " + errorCode + " errorMessage = " + errorMessage);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private KillAppListener killAppListener;
|
||||
|
||||
@@ -278,180 +253,47 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
}
|
||||
};
|
||||
|
||||
private final BehaviorSubject<ActivityEvent> lifecycleSubject = BehaviorSubject.create();
|
||||
private InternetConnected mInternetConnected;
|
||||
|
||||
@Override
|
||||
public Observable<ActivityEvent> lifecycle() {
|
||||
return lifecycleSubject.hide();
|
||||
public interface InternetConnected {
|
||||
void onConnected(String alias);
|
||||
}
|
||||
|
||||
@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() {
|
||||
if (mWifiReceiver == null) {
|
||||
mWifiReceiver = new WifiReceiver();
|
||||
}
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION);
|
||||
filter.addAction(WifiManager.WIFI_STATE_CHANGED_ACTION);
|
||||
filter.addAction(WifiManager.RSSI_CHANGED_ACTION);
|
||||
filter.addAction(WifiManager.NETWORK_IDS_CHANGED_ACTION);
|
||||
filter.addAction(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION);
|
||||
filter.addAction(WifiManager.CONFIGURED_NETWORKS_CHANGED_ACTION);
|
||||
filter.addAction(WifiManager.LINK_CONFIGURATION_CHANGED_ACTION);
|
||||
filter.addAction(WifiManager.SUPPLICANT_STATE_CHANGED_ACTION);
|
||||
filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
|
||||
registerReceiver(mWifiReceiver, filter);
|
||||
}
|
||||
|
||||
public class WifiReceiver extends BroadcastReceiver {
|
||||
private static final String TAG = "wifiReceiver";
|
||||
|
||||
private final ObservableOnSubscribe<String> networkSubscribe = new ObservableOnSubscribe<String>() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
switch (intent.getAction()) {
|
||||
case WifiManager.RSSI_CHANGED_ACTION:
|
||||
Log.e(TAG, "wifi信号强度变化");
|
||||
break;
|
||||
//wifi连接上与否
|
||||
case WifiManager.NETWORK_STATE_CHANGED_ACTION:
|
||||
NetworkInfo info = intent.getParcelableExtra(WifiManager.EXTRA_NETWORK_INFO);
|
||||
if (info.getState().equals(NetworkInfo.State.DISCONNECTED)) {
|
||||
Log.e(TAG, "wifi断开");
|
||||
LogDBManager.getInstance().creatNetChangeLog("wifi断开", TimeUtils.transferLongToDate(System.currentTimeMillis()));
|
||||
} else if (info.getState().equals(NetworkInfo.State.CONNECTED)) {
|
||||
WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
|
||||
WifiInfo wifiInfo = wifiManager.getConnectionInfo();
|
||||
//获取当前wifi名称
|
||||
String oldSSID = mMMKV.decodeString("WiFiSSID", "");
|
||||
Log.e(TAG, "oldSSID " + oldSSID);
|
||||
String newSSID = wifiInfo.getSSID();
|
||||
Log.e(TAG, "连接到网络 " + newSSID);
|
||||
if (!oldSSID.equals(newSSID)) {
|
||||
LogDBManager.getInstance().creatNetChangeLog("", oldSSID + " change to: " + newSSID);
|
||||
//直接获取数据
|
||||
} else {
|
||||
LogDBManager.getInstance().creatNetChangeLog("接入WiFi",
|
||||
"connect to: " + newSSID + " time: "
|
||||
+ TimeUtils.transferLongToDate(System.currentTimeMillis()));
|
||||
}
|
||||
mMMKV.encode("WiFiSSID", Utils.getWifiAlias(context));
|
||||
}
|
||||
break;
|
||||
//wifi打开与否
|
||||
case WifiManager.WIFI_STATE_CHANGED_ACTION:
|
||||
int wifistate = intent.getIntExtra(WifiManager.EXTRA_WIFI_STATE, WifiManager.WIFI_STATE_DISABLED);
|
||||
if (wifistate == WifiManager.WIFI_STATE_DISABLED) {
|
||||
Log.e(TAG, "系统关闭wifi");
|
||||
} else if (wifistate == WifiManager.WIFI_STATE_ENABLED) {
|
||||
Log.e(TAG, "系统开启wifi");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private RefreshReceiver mRefreshReceiver;
|
||||
|
||||
private void registerRefreshReceiver() {
|
||||
if (mRefreshReceiver == null) {
|
||||
mRefreshReceiver = new RefreshReceiver();
|
||||
}
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.addAction(RefreshReceiver.REFRESH_RECEIVER_ACTION);
|
||||
registerReceiver(mRefreshReceiver, filter);
|
||||
}
|
||||
|
||||
|
||||
public class RefreshReceiver extends BroadcastReceiver {
|
||||
public static final String REFRESH_RECEIVER_ACTION = "Receiver_Refresh_Action";
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
String action = intent.getAction();
|
||||
Log.e("RefreshReceiver", "onReceive: " + action);
|
||||
if (!TextUtils.isEmpty(action)) {
|
||||
mPresenter.getLockedState();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private ScreenLockReceiver screenLockReceiver;
|
||||
|
||||
private void registerScreenLockReceiver() {
|
||||
if (null == screenLockReceiver) {
|
||||
screenLockReceiver = new ScreenLockReceiver();
|
||||
}
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY);
|
||||
filter.addAction(Intent.ACTION_SCREEN_ON);
|
||||
filter.addAction(Intent.ACTION_SCREEN_OFF);
|
||||
registerReceiver(screenLockReceiver, filter);
|
||||
}
|
||||
|
||||
private class ScreenLockReceiver extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
String action = intent.getAction();
|
||||
Log.e(TAG, "onReceive:" + action);
|
||||
if (TextUtils.isEmpty(action)) {
|
||||
Log.e(TAG, "onReceive: is NULL");
|
||||
return;
|
||||
}
|
||||
switch (action) {
|
||||
case Intent.ACTION_SCREEN_ON:
|
||||
checkAliyunPushStatus();
|
||||
break;
|
||||
case Intent.ACTION_SCREEN_OFF:
|
||||
killAppListener.killApp(action);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void checkAliyunPushStatus() {
|
||||
CloudPushService mPushService = PushServiceFactory.getCloudPushService();
|
||||
mPushService.checkPushChannelStatus(new CommonCallback() {
|
||||
@Override
|
||||
public void onSuccess(String response) {
|
||||
Log.e("checkAliyunPushStatus", "onSuccess: " + response);
|
||||
if ("on".equals(response)) {
|
||||
// 当前是打开状态
|
||||
} else {
|
||||
// 当前是关闭状态
|
||||
aliyunPushInit();
|
||||
public void subscribe(ObservableEmitter emitter) throws Exception {
|
||||
mInternetConnected = new InternetConnected() {
|
||||
@Override
|
||||
public void onConnected(String alias) {
|
||||
Log.e(TAG, "networkSubscribe: onConnected " + alias);
|
||||
emitter.onNext(alias);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public void onFailed(String errorCode, String errorMessage) {
|
||||
Log.e("checkAliyunPushStatus", "onFailed: errorCode = " + errorCode + " errorMessage = " + errorMessage);
|
||||
}
|
||||
});
|
||||
}
|
||||
private Observer<String> networkObserver = new Observer<String>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
Log.e("networkObserver", "onSubscribe: ");
|
||||
}
|
||||
|
||||
public MainService() {
|
||||
@Override
|
||||
public void onNext(String action) {
|
||||
Log.e("networkObserver", "onNext: " + action);
|
||||
mServiceModel.getLockedState();
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
Log.e("networkObserver", "onError: " + e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
return mMainBinder;
|
||||
}
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("networkObserver", "onComplete: ");
|
||||
}
|
||||
};
|
||||
|
||||
public MainBinder mMainBinder = new MainBinder();
|
||||
|
||||
@@ -461,14 +303,19 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
return mMainBinder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
Log.e(TAG, "onCreate: ");
|
||||
lifecycleSubject.onNext(ActivityEvent.CREATE);
|
||||
mPresenter = new MainSPresenter(this);
|
||||
mPresenter.attachView(this);
|
||||
mPresenter.setLifecycle(lifecycleSubject);
|
||||
mServiceModel = new MainServiceModel(this);
|
||||
mServiceModel.setLifecycle(getLifecycleSubject());
|
||||
initLiveData();
|
||||
|
||||
if ("YX-T01".equalsIgnoreCase(Build.MODEL)) {
|
||||
JgyUtils.getInstance().setTongyiAppTop();
|
||||
}
|
||||
@@ -498,7 +345,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mPresenter.getLockedState();
|
||||
mServiceModel.getLockedState();
|
||||
}
|
||||
}, 20000);
|
||||
|
||||
@@ -603,7 +450,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
setStatusbar();
|
||||
setFloatingWindow();
|
||||
JgyUtils.getInstance().writeAppPackageList();
|
||||
notificationManager = NotificationManagerCompat.from(this);
|
||||
mNotificationManagerCompat = NotificationManagerCompat.from(this);
|
||||
createNotificationChannel();
|
||||
sendSimpleNotification();
|
||||
|
||||
@@ -630,6 +477,119 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
JgyUtils.getInstance().checkAoleyunApp();
|
||||
}
|
||||
|
||||
private void initLiveData() {
|
||||
mServiceModel.mLockedStateData.observe(this, new androidx.lifecycle.Observer<Boolean>() {
|
||||
@Override
|
||||
public void onChanged(Boolean loocked) {
|
||||
Log.e(TAG, "setLockedState: " + loocked);
|
||||
if (loocked) {
|
||||
Toaster.debugShow("设备已上锁");
|
||||
mServiceModel.setPushTags();
|
||||
ApkUtils.UninstallAPP(MainService.this, "com.joytv.live");
|
||||
ApkUtils.UninstallAPP(MainService.this, "com.tencent.android.qqdownloader");
|
||||
} else {
|
||||
Toaster.debugShow("设备已解锁");
|
||||
// notificationManager.cancel(NotificationID);
|
||||
JgyUtils.getInstance().writeAppPackageList();
|
||||
SysSettingUtils.setEnableSetting(MainService.this);
|
||||
}
|
||||
|
||||
//更新主页锁定状态
|
||||
Intent intent = new Intent(MainActivity.UPDATE_LOCKED_STATUS);
|
||||
sendBroadcast(intent);
|
||||
}
|
||||
});
|
||||
|
||||
mServiceModel.mTagData.observe(this, new androidx.lifecycle.Observer<String>() {
|
||||
@Override
|
||||
public void onChanged(String tag) {
|
||||
if (TextUtils.isEmpty(tag)) {
|
||||
//没有批次就没有管控
|
||||
Log.e(TAG, "setTagsFinish: not set tag");
|
||||
// SysSettingUtils.setEnableSetting(this);
|
||||
Settings.System.putString(getContentResolver(), CommonConfig.AOLE_ACTION_FORCE_APP, "");
|
||||
} else {
|
||||
mServiceModel.getForceDownload();
|
||||
mServiceModel.getWallpaper();
|
||||
mServiceModel.setLogoImg();
|
||||
mServiceModel.getAllAppList();
|
||||
mServiceModel.getBrowserBookmarks();
|
||||
mServiceModel.getDesktopIcon();
|
||||
mServiceModel.getAppAutoStartUpdateAndNet();
|
||||
mServiceModel.setAppinsideWeb();
|
||||
mServiceModel.getAppIdControl();
|
||||
mServiceModel.getSystemSetting();
|
||||
mServiceModel.getWiFiPasswd();
|
||||
mServiceModel.getDefaultApp();
|
||||
mServiceModel.getSnTimeControl();
|
||||
mServiceModel.setTopApp();
|
||||
mServiceModel.getBlackList();
|
||||
mServiceModel.getWhiteList();
|
||||
mServiceModel.getPoweroffTime();
|
||||
|
||||
}
|
||||
mServiceModel.getStudesInfo();
|
||||
mServiceModel.checkAoleyunUpdate();
|
||||
mServiceModel.checkTestUpdate();
|
||||
mServiceModel.getDeveloper();
|
||||
mServiceModel.getRomApp();
|
||||
mServiceModel.getScreenLockState();
|
||||
mServiceModel.geteFence();
|
||||
mServiceModel.getDefaultDesktop();
|
||||
|
||||
mServiceModel.sendMacAddress();
|
||||
mServiceModel.updateDeviceInfo();
|
||||
mServiceModel.sendInstalled();
|
||||
|
||||
mServiceModel.getSnAppAttr();
|
||||
mServiceModel.getAppLimit();
|
||||
mServiceModel.getCloudLessonSettings();
|
||||
|
||||
mServiceModel.getEbagCode();
|
||||
|
||||
//没绑定不请求
|
||||
mServiceModel.getSnSetting();
|
||||
}
|
||||
});
|
||||
|
||||
mServiceModel.mScreenLockStateData.observe(this, new androidx.lifecycle.Observer<ScreenLockState>() {
|
||||
@Override
|
||||
public void onChanged(ScreenLockState screenLockState) {
|
||||
if (screenLockState != null) {
|
||||
int screen_lock = screenLockState.getIs_screen_lock();
|
||||
String tips = screenLockState.getLock_content();
|
||||
if (screen_lock == 1) {
|
||||
if (!timelocked) {
|
||||
showFloatingWindow(tips);
|
||||
}
|
||||
screenlocked = true;
|
||||
SPUtils.put(MainService.this, "is_screen_lock", true);
|
||||
SPUtils.put(MainService.this, "screen_tips", tips);
|
||||
} else {
|
||||
if (!timelocked) {
|
||||
hideFloatingWindow();
|
||||
}
|
||||
screenlocked = false;
|
||||
SPUtils.put(MainService.this, "is_screen_lock", false);
|
||||
SPUtils.put(MainService.this, "screen_tips", "");
|
||||
}
|
||||
} else {
|
||||
if (!timelocked) {
|
||||
hideFloatingWindow();
|
||||
}
|
||||
screenlocked = false;
|
||||
SPUtils.put(MainService.this, "is_screen_lock", false);
|
||||
SPUtils.put(MainService.this, "screen_tips", "");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
private void deprecatedInit() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
Log.e(TAG, "onStartCommand: ");
|
||||
@@ -647,10 +607,8 @@ 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();
|
||||
}
|
||||
|
||||
// TODO: 2022/3/31 暂时不检测版本
|
||||
@@ -674,12 +632,12 @@ 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.createNotificationChannel(channel);
|
||||
mNotificationManagerCompat.createNotificationChannel(channel);
|
||||
}
|
||||
}
|
||||
|
||||
private NotificationManagerCompat notificationManager;
|
||||
private int NotificationID = 1;
|
||||
private NotificationManagerCompat mNotificationManagerCompat;
|
||||
private int mNotificationId = 1;
|
||||
|
||||
private void sendSimpleNotification() {
|
||||
NotificationCompat.Builder builder = new NotificationCompat.Builder(this, CHANNEL_ID)
|
||||
@@ -692,7 +650,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
.setPriority(NotificationCompat.PRIORITY_MAX);
|
||||
// notificationId is a unique int for each notification that you must define
|
||||
// notificationManager.notify(NotificationID, builder.build());
|
||||
startForeground(NotificationID, builder.build());
|
||||
startForeground(mNotificationId, builder.build());
|
||||
}
|
||||
|
||||
private void setStatusbar() {
|
||||
@@ -742,6 +700,133 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
}
|
||||
}
|
||||
|
||||
private WifiReceiver mWifiReceiver;
|
||||
|
||||
private void registerWiFiReceiver() {
|
||||
if (mWifiReceiver == null) {
|
||||
mWifiReceiver = new WifiReceiver();
|
||||
}
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION);
|
||||
filter.addAction(WifiManager.WIFI_STATE_CHANGED_ACTION);
|
||||
filter.addAction(WifiManager.RSSI_CHANGED_ACTION);
|
||||
filter.addAction(WifiManager.NETWORK_IDS_CHANGED_ACTION);
|
||||
filter.addAction(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION);
|
||||
filter.addAction(WifiManager.CONFIGURED_NETWORKS_CHANGED_ACTION);
|
||||
filter.addAction(WifiManager.LINK_CONFIGURATION_CHANGED_ACTION);
|
||||
filter.addAction(WifiManager.SUPPLICANT_STATE_CHANGED_ACTION);
|
||||
filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
|
||||
registerReceiver(mWifiReceiver, filter);
|
||||
}
|
||||
|
||||
public class WifiReceiver extends BroadcastReceiver {
|
||||
private static final String TAG = "wifiReceiver";
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
switch (intent.getAction()) {
|
||||
case WifiManager.RSSI_CHANGED_ACTION:
|
||||
Log.e(TAG, "wifi信号强度变化");
|
||||
break;
|
||||
//wifi连接上与否
|
||||
case WifiManager.NETWORK_STATE_CHANGED_ACTION:
|
||||
NetworkInfo info = intent.getParcelableExtra(WifiManager.EXTRA_NETWORK_INFO);
|
||||
if (info.getState().equals(NetworkInfo.State.DISCONNECTED)) {
|
||||
Log.e(TAG, "wifi断开");
|
||||
LogDBManager.getInstance().creatNetChangeLog("wifi断开", TimeUtils.transferLongToDate(System.currentTimeMillis()));
|
||||
} else if (info.getState().equals(NetworkInfo.State.CONNECTED)) {
|
||||
WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
|
||||
WifiInfo wifiInfo = wifiManager.getConnectionInfo();
|
||||
//获取当前wifi名称
|
||||
String oldSSID = mMMKV.decodeString("WiFiSSID", "");
|
||||
Log.e(TAG, "oldSSID " + oldSSID);
|
||||
String newSSID = wifiInfo.getSSID();
|
||||
Log.e(TAG, "连接到网络 " + newSSID);
|
||||
if (!oldSSID.equals(newSSID)) {
|
||||
LogDBManager.getInstance().creatNetChangeLog("", oldSSID + " change to: " + newSSID);
|
||||
//直接获取数据
|
||||
} else {
|
||||
LogDBManager.getInstance().creatNetChangeLog("接入WiFi",
|
||||
"connect to: " + newSSID + " time: "
|
||||
+ TimeUtils.transferLongToDate(System.currentTimeMillis()));
|
||||
}
|
||||
mMMKV.encode("WiFiSSID", Utils.getWifiAlias(context));
|
||||
}
|
||||
break;
|
||||
//wifi打开与否
|
||||
case WifiManager.WIFI_STATE_CHANGED_ACTION:
|
||||
int wifistate = intent.getIntExtra(WifiManager.EXTRA_WIFI_STATE, WifiManager.WIFI_STATE_DISABLED);
|
||||
if (wifistate == WifiManager.WIFI_STATE_DISABLED) {
|
||||
Log.e(TAG, "系统关闭wifi");
|
||||
} else if (wifistate == WifiManager.WIFI_STATE_ENABLED) {
|
||||
Log.e(TAG, "系统开启wifi");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private RefreshReceiver mRefreshReceiver;
|
||||
|
||||
private void registerRefreshReceiver() {
|
||||
if (mRefreshReceiver == null) {
|
||||
mRefreshReceiver = new RefreshReceiver();
|
||||
}
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.addAction(RefreshReceiver.REFRESH_RECEIVER_ACTION);
|
||||
registerReceiver(mRefreshReceiver, filter);
|
||||
}
|
||||
|
||||
public class RefreshReceiver extends BroadcastReceiver {
|
||||
public static final String REFRESH_RECEIVER_ACTION = "Receiver_Refresh_Action";
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
String action = intent.getAction();
|
||||
Log.e("RefreshReceiver", "onReceive: " + action);
|
||||
if (!TextUtils.isEmpty(action)) {
|
||||
NetInterfaceManager.clearAllCache();
|
||||
mServiceModel.getLockedState();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private ScreenLockReceiver screenLockReceiver;
|
||||
|
||||
private void registerScreenLockReceiver() {
|
||||
if (null == screenLockReceiver) {
|
||||
screenLockReceiver = new ScreenLockReceiver();
|
||||
}
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY);
|
||||
filter.addAction(Intent.ACTION_SCREEN_ON);
|
||||
filter.addAction(Intent.ACTION_SCREEN_OFF);
|
||||
registerReceiver(screenLockReceiver, filter);
|
||||
}
|
||||
|
||||
private class ScreenLockReceiver extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
String action = intent.getAction();
|
||||
Log.e(TAG, "onReceive:" + action);
|
||||
if (TextUtils.isEmpty(action)) {
|
||||
Log.e(TAG, "onReceive: is NULL");
|
||||
return;
|
||||
}
|
||||
switch (action) {
|
||||
case Intent.ACTION_SCREEN_ON:
|
||||
checkAliyunPushStatus();
|
||||
break;
|
||||
case Intent.ACTION_SCREEN_OFF:
|
||||
killAppListener.killApp(action);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static WindowManager windowManager;
|
||||
private View topView;
|
||||
boolean screenlocked = false;
|
||||
@@ -968,7 +1053,6 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
|
||||
private DisplayReceiver mDisplayReceiver;
|
||||
|
||||
|
||||
public void registerDisplayReceiver() {
|
||||
mDisplayReceiver = new DisplayReceiver();
|
||||
IntentFilter filter = new IntentFilter();
|
||||
@@ -985,7 +1069,6 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
public static final String READ_MODEL_ENABLED = "READ_MODEL_ENABLED";
|
||||
public static final String READ_MODEL_DISABLED = "READ_MODEL_DISABLED";
|
||||
|
||||
|
||||
private class DisplayReceiver extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
@@ -1064,7 +1147,6 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private interface TopApp {
|
||||
void open(Long time);
|
||||
}
|
||||
@@ -1101,7 +1183,6 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
private void registerInstallReceiver() {
|
||||
if (mInstallReceiver == null) {
|
||||
mInstallReceiver = new InstallReceiver();
|
||||
@@ -1164,298 +1245,4 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLockedState(boolean loocked) {
|
||||
Log.e(TAG, "setLockedState: " + loocked);
|
||||
if (loocked) {
|
||||
Toaster.debugShow("设备已上锁");
|
||||
mPresenter.setPushTags();
|
||||
ApkUtils.UninstallAPP(this, "com.joytv.live");
|
||||
ApkUtils.UninstallAPP(this, "com.tencent.android.qqdownloader");
|
||||
} else {
|
||||
Toaster.debugShow("设备已解锁");
|
||||
// notificationManager.cancel(NotificationID);
|
||||
JgyUtils.getInstance().writeAppPackageList();
|
||||
SysSettingUtils.setEnableSetting(this);
|
||||
}
|
||||
|
||||
//更新主页锁定状态
|
||||
Intent intent = new Intent(MainActivity.UPDATE_LOCKED_STATUS);
|
||||
sendBroadcast(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTagsFinish(boolean noTag) {
|
||||
if (noTag) {
|
||||
//没有批次就没有管控
|
||||
Log.e(TAG, "setTagsFinish: " + "not set tag");
|
||||
// mPresenter.getStudesInfo(true);
|
||||
mPresenter.checkAoleyunUpdate();
|
||||
// SysSettingUtils.setEnableSetting(this);
|
||||
} else {
|
||||
mPresenter.getFirstConnect();
|
||||
mPresenter.getStudesInfo();
|
||||
|
||||
mPresenter.getSystemSettingBegin();
|
||||
mPresenter.getAppLimit();
|
||||
mPresenter.getForceDownload();
|
||||
mPresenter.getDefaultDesktop();
|
||||
mPresenter.setLogoImg();
|
||||
mPresenter.getWallpaper();
|
||||
mPresenter.getAllAppList();
|
||||
mPresenter.getBrowserBookmarks();
|
||||
mPresenter.getBrowserWhiteList();
|
||||
mPresenter.getDesktopIcon();
|
||||
mPresenter.getAppAutoStartUpdateAndNet();
|
||||
mPresenter.getSnAppAttr();
|
||||
mPresenter.getAppIdControl();
|
||||
mPresenter.setAppinsideWeb();
|
||||
mPresenter.getSystemSetting();
|
||||
mPresenter.getDefaultApp();
|
||||
mPresenter.setTopApp();
|
||||
mPresenter.getPoweroffTime();
|
||||
mPresenter.getSnTimeControl();
|
||||
mPresenter.getSnSetting();
|
||||
mPresenter.getCloudLessonSettings();
|
||||
mPresenter.getEbagCode();
|
||||
mPresenter.getBlackList();
|
||||
mPresenter.getWhiteList();
|
||||
mPresenter.getWiFiPasswd();
|
||||
}
|
||||
mPresenter.sendMacAddress();
|
||||
mPresenter.updateDeviceInfo();
|
||||
mPresenter.sendInstalled();
|
||||
mPresenter.checkAoleyunUpdate();
|
||||
mPresenter.checkTestUpdate();
|
||||
|
||||
mPresenter.getDeveloper();
|
||||
mPresenter.getRomApp();
|
||||
mPresenter.getScreenLockState();
|
||||
mPresenter.geteFence();
|
||||
}
|
||||
|
||||
/**
|
||||
* 首次使用默认关闭所有功能
|
||||
*
|
||||
* @param state
|
||||
*/
|
||||
@Override
|
||||
public void setFirstConnect(boolean state) {
|
||||
Log.e(TAG, "isFirstConnect: " + "end request: " + state);
|
||||
if (state) {
|
||||
Log.e(TAG, "setDisableSetting: ");
|
||||
//设置系统管控
|
||||
SysSettingUtils.setDisableSetting(this);
|
||||
JgyUtils.getInstance().writeAppPackageList();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStudesInfo() {
|
||||
Log.e(TAG, "setStudesInfo: " + "基本信息获取完毕");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendNetworkFinish() {
|
||||
Log.e(TAG, "sendNetworkFinish: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMacFinish() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDeviceInfoFinish() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendInstalledFinish() {
|
||||
Log.e(TAG, "sendInstalledFinish: ");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkAoleyunUpdateFinish() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkTestUpdateFinish() {
|
||||
Log.e(TAG, "checkTestUpdateFinish: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDeveloperFinish() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getRomAppFinish() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setScreenLockStateFinish(boolean locked, String tips) {
|
||||
if (locked) {
|
||||
if (!timelocked) {
|
||||
showFloatingWindow(tips);
|
||||
}
|
||||
screenlocked = true;
|
||||
SPUtils.put(this, "is_screen_lock", true);
|
||||
SPUtils.put(this, "screen_tips", tips);
|
||||
} else {
|
||||
if (!timelocked) {
|
||||
hideFloatingWindow();
|
||||
}
|
||||
screenlocked = false;
|
||||
SPUtils.put(this, "is_screen_lock", false);
|
||||
SPUtils.put(this, "screen_tips", "");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void geteFenceFinish() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSystemSetting() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getAppLimitFinish() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getForceDownloadFinish() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDefaultDesktopFinish() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLogoImgFinish() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getWallpaperFinish() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getAllAppListFinish() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBrowserBookmarksFinish() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBrowserWhiteList() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDesktopIconFinish() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getAppAutoStartUpdateAndNetFinish() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSnAppAttrFinish() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getAppIdControlFinish() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAppinsideWebFinish() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSystemSettingFinish() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDefaultAppFinish() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTopAppFinish() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPoweroffTime() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSnTimeControlFinish() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSnSettingFinish() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCloudLessonSettings() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getEbagCodeFinish(boolean activation) {
|
||||
if (activation) {
|
||||
// mPresenter.getExclusiveAdminApp();
|
||||
Log.e(TAG, "getEBagCodeFinish: " + "已激活");
|
||||
} else {
|
||||
// mPresenter.getBlackList();
|
||||
Log.e(TAG, "getEBagCodeFinish: " + "未激活");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void getExclusiveAdminAppFinish() {
|
||||
Log.e(TAG, "getAdminAppFinish: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBlackListFinish() {
|
||||
Log.e(TAG, "getBlackListFinish: ");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getWhiteListFinish() {
|
||||
Log.e(TAG, "getWhiteListFinish: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWiFiPasswd() {
|
||||
Log.e(TAG, "setWiFiPasswd: ");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+113
-198
@@ -6,19 +6,23 @@ import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
import androidx.lifecycle.ViewModel;
|
||||
|
||||
import com.alibaba.sdk.android.push.CloudPushService;
|
||||
import com.alibaba.sdk.android.push.CommonCallback;
|
||||
import com.alibaba.sdk.android.push.noonesdk.PushServiceFactory;
|
||||
import com.aoleyun.sn.bean.AdminAppInfo;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.ScreenLockState;
|
||||
import com.aoleyun.sn.bean.StudentsInfo;
|
||||
import com.aoleyun.sn.comm.CommonConfig;
|
||||
import com.aoleyun.sn.comm.JGYActions;
|
||||
import com.aoleyun.sn.disklrucache.CacheHelper;
|
||||
import com.aoleyun.sn.network.NetInterfaceManager;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
import com.aoleyun.sn.utils.JgyUtils;
|
||||
import com.aoleyun.sn.utils.SPUtils;
|
||||
import com.aoleyun.sn.utils.SysSettingUtils;
|
||||
import com.aoleyun.sn.utils.URLUtils;
|
||||
import com.aoleyun.sn.utils.Utils;
|
||||
import com.hjq.toast.Toaster;
|
||||
@@ -33,25 +37,18 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
import io.reactivex.rxjava3.subjects.BehaviorSubject;
|
||||
|
||||
/**
|
||||
* MainService 的 Presenter
|
||||
*
|
||||
* @author jgy02
|
||||
*/
|
||||
public class MainSPresenter implements MainSContact.Presenter {
|
||||
private static final String TAG = "MainSPresenter";
|
||||
public class MainServiceModel extends ViewModel {
|
||||
private static final String TAG = "MainServiceModel";
|
||||
|
||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
|
||||
private MainSContact.MainView mView;
|
||||
private Context mContext;
|
||||
private ContentResolver crv;
|
||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
private CacheHelper cacheHelper;
|
||||
|
||||
private BehaviorSubject<ActivityEvent> lifecycle;
|
||||
|
||||
@@ -63,27 +60,14 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
return lifecycle;
|
||||
}
|
||||
|
||||
public MainSPresenter(Context context) {
|
||||
public MainServiceModel(Context context) {
|
||||
this.mContext = context;
|
||||
this.crv = mContext.getContentResolver();
|
||||
this.cacheHelper = new CacheHelper(mContext);
|
||||
Log.e(TAG, "MainSPresenter: " + context.getClass());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void attachView(@androidx.annotation.NonNull MainSContact.MainView view) {
|
||||
this.mView = view;
|
||||
}
|
||||
public MutableLiveData<Boolean> mLockedStateData = new MutableLiveData<>();
|
||||
|
||||
@Override
|
||||
public void detachView() {
|
||||
this.mView = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1
|
||||
*/
|
||||
@Override
|
||||
public void getLockedState() {
|
||||
Log.e(TAG, "getLockedState: ");
|
||||
if (JgyUtils.getInstance().isAihuaFramework()) {
|
||||
@@ -99,28 +83,27 @@ 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();
|
||||
}
|
||||
mView.setLockedState(locked == JGYActions.FRAME_CODE_LOCKED);
|
||||
// if (locked == 0) {
|
||||
// JgyUtils.getInstance().deleteOtherApp();
|
||||
// }
|
||||
mLockedStateData.postValue(locked == JGYActions.FRAME_CODE_LOCKED);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public MutableLiveData<String> mTagData = new MutableLiveData<>();
|
||||
|
||||
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));
|
||||
mTagData.postValue(tag);
|
||||
}
|
||||
});
|
||||
String tagSets = mMMKV.decodeString(CommonConfig.DEVICES_TAG);
|
||||
Log.e(TAG, "setPushTags: tagSets =" + tagSets);
|
||||
Set<String> groupTagSets = mMMKV.decodeStringSet(CommonConfig.DEVICES_GROUP_TAG, new HashSet<>());
|
||||
Log.e(TAG, "setPushTags: groupTagSets = " + groupTagSets);
|
||||
String tagstring = cacheHelper.getAsString(UrlAddress.GET_DEVICES_TAGS);
|
||||
Log.e(TAG, "setPushTags: tagstring = " + tagstring);
|
||||
Set<String> tags = new HashSet<>();
|
||||
tags.addAll(groupTagSets);
|
||||
if (!TextUtils.isEmpty(tagSets)) {
|
||||
@@ -146,45 +129,43 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 2
|
||||
*/
|
||||
|
||||
/**
|
||||
* 第一次连接
|
||||
*/
|
||||
@Override
|
||||
public void getFirstConnect() {
|
||||
int first = (int) SPUtils.get(mContext, CommonConfig.JGY_FIRST_CONNECT, 0);
|
||||
Log.e(TAG, "getFirstConnect: " + "first_connect = " + first);
|
||||
mView.setFirstConnect(first == 0);
|
||||
if (first == 0) {
|
||||
Log.e(TAG, "setDisableSetting: ");
|
||||
//设置系统管控
|
||||
SysSettingUtils.setDisableSetting(mContext);
|
||||
JgyUtils.getInstance().writeAppPackageList();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过sn获取用户信息
|
||||
*/
|
||||
@Override
|
||||
public void getStudesInfo() {
|
||||
NetInterfaceManager.getInstance().getStudesInfo(false, getLifecycle(), new NetInterfaceManager.StudesInfoListener() {
|
||||
NetInterfaceManager.getInstance().getStudesInfo(getLifecycle(), new NetInterfaceManager.StudesInfoListener() {
|
||||
@Override
|
||||
public void setStudentsInfo(StudentsInfo studentsInfo) {
|
||||
mView.setStudesInfo();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
// mView.setStudesInfo();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendNetwork(List<Long> time) {
|
||||
if (time == null || time.size() == 0) {
|
||||
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
|
||||
@@ -211,239 +192,197 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("sendNetwork", "onComplete: ");
|
||||
mView.sendNetworkFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 3
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void sendMacAddress() {
|
||||
NetInterfaceManager.getInstance().sendMACAddress(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
NetInterfaceManager.getInstance().sendMACAddress(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.sendMacFinish();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDeviceInfo() {
|
||||
if (JgyUtils.isOfficialVersion()) {
|
||||
mView.updateDeviceInfoFinish();
|
||||
}
|
||||
// if (!JgyUtils.getInstance().tagEmpty()) {
|
||||
NetInterfaceManager.getInstance().updateDeviceInfo(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.updateDeviceInfoFinish();
|
||||
}
|
||||
});
|
||||
NetInterfaceManager.getInstance().updateDeviceInfo(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传安装的应用列表
|
||||
*/
|
||||
@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() {
|
||||
}
|
||||
});
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
* 4
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void checkAoleyunUpdate() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.checkAoleyunUpdate(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
.checkAoleyunUpdate(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.checkAoleyunUpdateFinish();
|
||||
|
||||
}
|
||||
});
|
||||
// mView.checkAoleyunUpdateFinish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkTestUpdate() {
|
||||
if (!JgyUtils.getInstance().tagEmpty()) {
|
||||
NetInterfaceManager.getInstance()
|
||||
.checkTestUpdate(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
.checkTestUpdate(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.checkTestUpdateFinish();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 5
|
||||
*/
|
||||
@Override
|
||||
public void getDeveloper() {
|
||||
Log.e(TAG, "getDeveloper: ");
|
||||
NetInterfaceManager.getInstance()
|
||||
.getDeveloper(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getDeveloperFinish();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getRomApp() {
|
||||
String customVersion = Utils.getCustomVersion();
|
||||
Log.e(TAG, "getROMApp: " + customVersion);
|
||||
NetInterfaceManager.getInstance()
|
||||
.getCustomROMApp(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
.getCustomRomApp(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getRomAppFinish();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public MutableLiveData<ScreenLockState> mScreenLockStateData = new MutableLiveData<>();
|
||||
|
||||
public void getScreenLockState() {
|
||||
NetInterfaceManager.getInstance().getScreenLockState(true, getLifecycle(), new NetInterfaceManager.ScreenLockStateListener() {
|
||||
NetInterfaceManager.getInstance().getScreenLockState(getLifecycle(), new NetInterfaceManager.ScreenLockStateListener() {
|
||||
@Override
|
||||
public void setScreenLockState(boolean locked, String tips) {
|
||||
mView.setScreenLockStateFinish(locked, tips);
|
||||
public void setScreenLockState(ScreenLockState screenLockState) {
|
||||
mScreenLockStateData.postValue(screenLockState);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void geteFence() {
|
||||
NetInterfaceManager.getInstance().geElectronicFence(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.geteFenceFinish();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSystemSettingBegin() {
|
||||
//重置设备
|
||||
JgyUtils.getInstance().resetDevice();
|
||||
Toaster.debugShow("开始获取管控");
|
||||
mView.setSystemSetting();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getAppLimit() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getAppLimit(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getAppLimitFinish();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getForceDownload() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getForceDownload(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getForceDownloadFinish();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDefaultDesktop() {
|
||||
Log.e(TAG, "getDefaultDesktop: ");
|
||||
if (JgyUtils.isOfficialVersion() || !JgyUtils.getInstance().getDeviceIsLocked()) {
|
||||
Log.e(TAG, "getDefaultDesktop: " + "Device unLocked");
|
||||
mView.getDefaultDesktopFinish();
|
||||
} else {
|
||||
int aihuaUnlock = Settings.System.getInt(mContext.getContentResolver(), CommonConfig.AIHUA_UNLOCK, 0);
|
||||
if (JgyUtils.getInstance().isAihuaFramework() && aihuaUnlock == 1) {
|
||||
Log.e(TAG, "getDefaultDesktop: " + "Device aihua");
|
||||
mView.getDefaultDesktopFinish();
|
||||
|
||||
} else {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getDefaultDesktop( getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
.getDefaultDesktop(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getDefaultDesktopFinish();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLogoImg() {
|
||||
if (JgyUtils.isOfficialVersion()) {
|
||||
mView.setLogoImgFinish();
|
||||
} else {
|
||||
NetInterfaceManager.getInstance()
|
||||
.setLogoImg(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.setLogoImgFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
NetInterfaceManager.getInstance()
|
||||
.setLogoImg(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getWallpaper() {
|
||||
NetInterfaceManager.getInstance().getWallpaper(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getWallpaperFinish();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getAllAppList() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getAllAppList(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
.getAllAppList(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getAllAppListFinish();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBrowserBookmarks() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getBookMarkBlackWhiteList(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
.getBookMarkBlackWhiteList(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getBrowserBookmarksFinish();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBrowserWhiteList() {
|
||||
new URLUtils(mContext).setBrowserBlackList();
|
||||
mView.setBrowserWhiteList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDesktopIcon() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getDesktopIcon(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@@ -451,161 +390,141 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
public void onComplete() {
|
||||
Log.e("getDesktopIcon", "onComplete: ");
|
||||
// JgyUtils.getInstance().hideSystemAPP();
|
||||
mView.getDesktopIconFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getAppAutoStartUpdateAndNet() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getAppAutoStartUpdateAndNet( getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
.getAppAutoStartUpdateAndNet(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getAppAutoStartUpdateAndNetFinish();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSnAppAttr() {
|
||||
NetInterfaceManager.getInstance().getSnAppAttr(new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getSnAppAttrFinish();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getAppIdControl() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getAppIDControl(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
.getAppIDControl(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getAppIdControlFinish();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAppinsideWeb() {
|
||||
Log.e(TAG, "setAppinsideWeb: ");
|
||||
NetInterfaceManager.getInstance().getAppinsideWeb(new NetInterfaceManager.GetAppinsideWebCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e(TAG, "setAppinsideWeb: " + "onComplete");
|
||||
if (mView != null) {
|
||||
mView.setAppinsideWebFinish();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSystemSetting() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.setSystemSetting(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getSystemSettingFinish();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDefaultApp() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getDefaultApp(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
.getDefaultApp(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.setDefaultAppFinish();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTopApp() {
|
||||
if (JgyUtils.isOfficialVersion()) {
|
||||
mView.setTopAppFinish();
|
||||
return;
|
||||
}
|
||||
NetInterfaceManager.getInstance()
|
||||
.getTopApp(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
.getTopApp(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.setTopAppFinish();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getPoweroffTime() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getPoweroffTime(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
.getPoweroffTime(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.setPoweroffTime();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSnTimeControl() {
|
||||
if (JgyUtils.isOfficialVersion()) {
|
||||
mView.getSnTimeControlFinish();
|
||||
} else {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getSnTimeControl(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getSnTimeControlFinish();
|
||||
}
|
||||
});
|
||||
NetInterfaceManager.getInstance()
|
||||
.getTimeControl(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getSnTimeControlFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
NetInterfaceManager.getInstance()
|
||||
.getSnTimeControl(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
NetInterfaceManager.getInstance()
|
||||
.getTimeControl(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSnSetting() {
|
||||
NetInterfaceManager.getInstance().getSnSetting(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getSnSettingFinish();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getCloudLessonSettings() {
|
||||
NetInterfaceManager.getInstance().getCloudLessonSettings(lifecycle, new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
if (mView != null) {
|
||||
mView.setCloudLessonSettings();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getEbagCode() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getEBagCode(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
.getEBagCode(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getEbagCodeFinish(Settings.Global.getInt(mContext.getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 0) == 1);
|
||||
if (Settings.Global.getInt(mContext.getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 0) == 1) {
|
||||
// getExclusiveAdminApp();
|
||||
Log.e(TAG, "getEBagCodeFinish: " + "已激活");
|
||||
} else {
|
||||
// getBlackList();
|
||||
Log.e(TAG, "getEBagCodeFinish: " + "未激活");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getExclusiveAdminApp() {
|
||||
NetInterfaceManager.getInstance().getExclusiveAdminAppObservable()
|
||||
.subscribeOn(Schedulers.io())
|
||||
@@ -635,38 +554,34 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getExclusiveAdminApp", "onComplete: ");
|
||||
mView.getExclusiveAdminAppFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBlackList() {
|
||||
NetInterfaceManager.getInstance().getBlackList(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getBlackListFinish();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getWhiteList() {
|
||||
NetInterfaceManager.getInstance().getWhiteList(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getWhiteListFinish();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getWiFiPasswd() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getWiFiPasswd(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
.getWiFiPasswd(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.setWiFiPasswd();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -536,7 +536,7 @@ public class ApkUtils {
|
||||
this.add("com.aoleyun.browser");
|
||||
this.add("com.android.music");
|
||||
this.add("com.android.fmradio");
|
||||
this.add("com.android.gallery3d");
|
||||
// this.add("com.android.gallery3d");
|
||||
this.add("com.android.calendar");
|
||||
this.add("com.android.calculator2");
|
||||
this.add("com.android.deskclock");
|
||||
|
||||
@@ -434,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() {
|
||||
@@ -1808,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);
|
||||
@@ -2943,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, ""));
|
||||
|
||||
@@ -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 {
|
||||
|
||||
+7
-5
@@ -4,10 +4,10 @@ buildscript {
|
||||
repositories {
|
||||
google()
|
||||
// mavenCentral()
|
||||
maven { url "https://jitpack.io" }
|
||||
maven { url 'https://jitpack.io' }
|
||||
maven { url 'https://developer.huawei.com/repo/' }
|
||||
maven { url 'https://maven.aliyun.com/repository/central' }
|
||||
maven { url "https://maven.aliyun.com/repository/jcenter" }
|
||||
maven { url 'https://maven.aliyun.com/repository/jcenter' }
|
||||
maven { url 'https://maven.aliyun.com/repository/public' }
|
||||
maven { url 'https://maven.aliyun.com/repository/google' }
|
||||
}
|
||||
@@ -29,10 +29,12 @@ allprojects {
|
||||
repositories {
|
||||
google()
|
||||
// mavenCentral()
|
||||
maven { url "https://jitpack.io" }
|
||||
maven { url 'https://jitpack.io' }
|
||||
maven { url 'https://developer.huawei.com/repo/' }
|
||||
maven { url 'https://maven.aliyun.com/repository/central/' }
|
||||
maven { url 'https://maven.aliyun.com/repository/public/' }
|
||||
maven { url 'https://maven.aliyun.com/repository/central' }
|
||||
maven { url 'https://maven.aliyun.com/repository/jcenter' }
|
||||
maven { url 'https://maven.aliyun.com/repository/public' }
|
||||
maven { url 'https://maven.aliyun.com/repository/google' }
|
||||
}
|
||||
gradle.projectsEvaluated {
|
||||
tasks.withType(JavaCompile) {
|
||||
|
||||
Reference in new issue
Block a user