version:3.7beta
fix:移除HTTPInterface,所有请求在NetInterfaceManager进行 update:
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package com.aoleyun.sn.activity.checknet;
|
||||
|
||||
import android.os.SystemClock;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.widget.Button;
|
||||
@@ -47,7 +46,6 @@ public class CheckNetActivity extends BaseActivity implements CheckNetContact.Ma
|
||||
Button bt_confirm;
|
||||
|
||||
private CheckNetPresenter mCheckNetPresenter;
|
||||
private boolean netWorkIsRunning = false;
|
||||
private MMKV mMMKV = MMKV.defaultMMKV();
|
||||
|
||||
@Override
|
||||
@@ -58,7 +56,6 @@ public class CheckNetActivity extends BaseActivity implements CheckNetContact.Ma
|
||||
@Override
|
||||
public void onConnected(NetworkUtils.NetworkType networkType) {
|
||||
Log.e("OnNetworkStatusChanged", "onConnected: ");
|
||||
timeMillis = SystemClock.elapsedRealtime();
|
||||
giv_1.setBackgroundResource(R.drawable.successful);
|
||||
//直接获取数据
|
||||
mCheckNetPresenter.getLockedState();
|
||||
@@ -149,13 +146,10 @@ public class CheckNetActivity extends BaseActivity implements CheckNetContact.Ma
|
||||
});
|
||||
}
|
||||
|
||||
//执行所有接口耗时
|
||||
long timeMillis;
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
Log.e("getMacAddress", Utils.getAndroid10MAC(this));
|
||||
timeMillis = SystemClock.elapsedRealtime();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -219,16 +213,10 @@ public class CheckNetActivity extends BaseActivity implements CheckNetContact.Ma
|
||||
//发送设备mac地址和信息
|
||||
mCheckNetPresenter.sendMACAddress();
|
||||
if (loocked) {
|
||||
if (netWorkIsRunning) {
|
||||
//如果正在执行,不执行
|
||||
return;
|
||||
}
|
||||
SaveListUtils.getList();
|
||||
//获取系统管控
|
||||
mCheckNetPresenter.setPushTags();
|
||||
netWorkIsRunning = true;
|
||||
} else {
|
||||
netWorkIsRunning = false;
|
||||
SysSettingUtils.setEnableSetting(this);
|
||||
}
|
||||
}
|
||||
@@ -239,16 +227,14 @@ public class CheckNetActivity extends BaseActivity implements CheckNetContact.Ma
|
||||
*/
|
||||
@Override
|
||||
public void setTagsFinish(boolean noTag) {
|
||||
if (mCheckNetPresenter.isRequestSucceeded()) {
|
||||
Log.e(TAG, "setTagsFinish: " + mCheckNetPresenter.isRequestSucceeded());
|
||||
if (mCheckNetPresenter.isRequestSuccessful()) {
|
||||
Log.e(TAG, "setTagsFinish: " + mCheckNetPresenter.isRequestSuccessful());
|
||||
giv_2.setBackgroundResource(R.drawable.successful);
|
||||
} else {
|
||||
giv_2.setBackgroundResource(R.drawable.failed);
|
||||
}
|
||||
if (noTag) {
|
||||
Log.e(TAG, "setTagsFinished: " + "not set tag");
|
||||
netWorkIsRunning = false;
|
||||
Log.e(TAG, "SettingFinished: " + (SystemClock.elapsedRealtime() - timeMillis) + " ms");
|
||||
} else {
|
||||
mCheckNetPresenter.getSystemSettingbegin();
|
||||
}
|
||||
@@ -260,8 +246,13 @@ public class CheckNetActivity extends BaseActivity implements CheckNetContact.Ma
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getAppLimitFinish(String packageList) {
|
||||
mCheckNetPresenter.getDeviceBatch(packageList);
|
||||
public void getAppLimitFinish() {
|
||||
mCheckNetPresenter.getAllAppList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getAllAppListFinish() {
|
||||
mCheckNetPresenter.getDeviceBatch();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -337,14 +328,12 @@ public class CheckNetActivity extends BaseActivity implements CheckNetContact.Ma
|
||||
|
||||
@Override
|
||||
public void getDefaultDesktopFinish() {
|
||||
netWorkIsRunning = false;
|
||||
if (mCheckNetPresenter.isRequestSucceeded()) {
|
||||
if (mCheckNetPresenter.isRequestSuccessful()) {
|
||||
giv_3.setBackgroundResource(R.drawable.successful);
|
||||
} else {
|
||||
giv_3.setBackgroundResource(R.drawable.failed);
|
||||
}
|
||||
mMMKV.encode(CommonConfig.DEVICES_FRIST_START, 0);
|
||||
Log.e(TAG, "SettingFinished: " + (SystemClock.elapsedRealtime() - timeMillis) + " ms");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -38,8 +38,10 @@ public class CheckNetContact {
|
||||
void getSystemSettingbegin();
|
||||
//获取可被写入的安装包名
|
||||
void getAppLimit();
|
||||
/*获取所有app详细信息*/
|
||||
void getAllAppList();
|
||||
//获取设备批次
|
||||
void getDeviceBatch(String packageList);
|
||||
void getDeviceBatch();
|
||||
//获取强制下载apk
|
||||
void getForceDownload();
|
||||
//获取浏览器上网管控设置
|
||||
@@ -109,7 +111,9 @@ public class CheckNetContact {
|
||||
//设置设备后台设置
|
||||
void getSystemSettingbegin();
|
||||
//获取可被写入的安装包名结束
|
||||
void getAppLimitFinish(String packageList);
|
||||
void getAppLimitFinish();
|
||||
/*获取所有app详细信息*/
|
||||
void getAllAppListFinish();
|
||||
//获取设备批次结束
|
||||
void getDeviceBatchFinish();
|
||||
//获取强制下载apk结束
|
||||
|
||||
@@ -2,50 +2,21 @@ package com.aoleyun.sn.activity.checknet;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.aoleyun.sn.BuildConfig;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.DefaultApp;
|
||||
import com.aoleyun.sn.bean.LogoImg;
|
||||
import com.aoleyun.sn.bean.NetAndLaunchBean;
|
||||
import com.aoleyun.sn.bean.WiFiAlias;
|
||||
import com.aoleyun.sn.comm.CommonConfig;
|
||||
import com.aoleyun.sn.comm.JGYActions;
|
||||
import com.aoleyun.sn.network.NetInterfaceManager;
|
||||
import com.aoleyun.sn.utils.ApkUtils;
|
||||
import com.aoleyun.sn.utils.JGYUtils;
|
||||
import com.aoleyun.sn.utils.SPUtils;
|
||||
import com.aoleyun.sn.utils.SysSettingUtils;
|
||||
import com.aoleyun.sn.utils.ToastUtil;
|
||||
import com.aoleyun.sn.utils.URLUtils;
|
||||
import com.aoleyun.sn.utils.Utils;
|
||||
import com.aoleyun.sn.utils.WiFiUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.trello.rxlifecycle4.LifecycleProvider;
|
||||
import com.trello.rxlifecycle4.RxLifecycle;
|
||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
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;
|
||||
import okhttp3.ResponseBody;
|
||||
|
||||
/**
|
||||
* @author jgy
|
||||
@@ -55,10 +26,10 @@ public class CheckNetPresenter implements CheckNetContact.Presenter {
|
||||
private CheckNetContact.MainView mView;
|
||||
private Context mContext;
|
||||
private ContentResolver crv;
|
||||
private NetInterfaceManager mNetInterfaceManager;
|
||||
|
||||
//是否有接口请求成功
|
||||
public boolean requestSucceeded = false;
|
||||
private final int OK = 200;
|
||||
public boolean requestSucceeded = true;
|
||||
|
||||
private LifecycleProvider<ActivityEvent> provider;
|
||||
|
||||
@@ -82,12 +53,13 @@ public class CheckNetPresenter implements CheckNetContact.Presenter {
|
||||
|
||||
public CheckNetPresenter(Context context) {
|
||||
this.mContext = context;
|
||||
crv = mContext.getContentResolver();
|
||||
this.crv = mContext.getContentResolver();
|
||||
this.mNetInterfaceManager = NetInterfaceManager.getInstance();
|
||||
Log.e(TAG, "MainPresenter: " + context.getClass());
|
||||
}
|
||||
|
||||
public boolean isRequestSucceeded() {
|
||||
Log.e(TAG, "isRequestSucceeded: " + requestSucceeded);
|
||||
public boolean isRequestSuccessful() {
|
||||
Log.e(TAG, "isRequestSuccessful: " + requestSucceeded);
|
||||
return requestSucceeded;
|
||||
}
|
||||
|
||||
@@ -120,7 +92,7 @@ public class CheckNetPresenter implements CheckNetContact.Presenter {
|
||||
|
||||
@Override
|
||||
public void sendMACAddress() {
|
||||
NetInterfaceManager.getInstance().sendMACAddress(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
mNetInterfaceManager.sendMACAddress(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.sendMACFinish();
|
||||
@@ -132,14 +104,14 @@ public class CheckNetPresenter implements CheckNetContact.Presenter {
|
||||
public void updateDeviceInfo() {
|
||||
if (JGYUtils.isOfficialVersion()) {
|
||||
mView.updateDeviceInfoFinish();
|
||||
return;
|
||||
} else {
|
||||
mNetInterfaceManager.updateDeviceInfo(new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.updateDeviceInfoFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
NetInterfaceManager.getInstance().updateDeviceInfo(new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.updateDeviceInfoFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -147,77 +119,46 @@ public class CheckNetPresenter implements CheckNetContact.Presenter {
|
||||
public void getSnTimeControl() {
|
||||
if (JGYUtils.isOfficialVersion()) {
|
||||
mView.getSnTimeControlFinish();
|
||||
return;
|
||||
} else {
|
||||
mNetInterfaceManager.getSnTimeControl(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getSnTimeControlFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
NetInterfaceManager.getInstance()
|
||||
.getSnTimeControl(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getSnTimeControlFinish();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getEBagCode() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getEBagCodeControl()
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
Log.e("getEBagCode", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BaseResponse baseResponse) {
|
||||
requestSucceeded = true;
|
||||
Log.e("getEBagCode", "onNext: " + baseResponse);
|
||||
int code = baseResponse.code;
|
||||
if (code == OK) {
|
||||
JsonObject jsonObject = JsonParser.parseString(new Gson().toJson(baseResponse.data)).getAsJsonObject();
|
||||
String ebagCode = jsonObject.get("ebagCode").getAsString();
|
||||
SPUtils.put(mContext, "ebagCode", ebagCode);
|
||||
} else {
|
||||
Log.e("getEBagCode", "onNext: " + baseResponse.data);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
Log.e("getEBagCode", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getEBagCode", "onComplete: ");
|
||||
mView.getEBagCodeFinish();
|
||||
}
|
||||
});
|
||||
mNetInterfaceManager.getEBagCode(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getEBagCodeFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getLockedState() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getLockedState(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getLockedState", "onComplete: ");
|
||||
int locked = Settings.System.getInt(crv, JGYActions.ACTION_QCH_UNLOCK_IPAD, JGYActions.FRAME_CODE_LOCKED);
|
||||
Log.e("getLockedState", "locked: " + locked);
|
||||
mView.setLockedState(locked == JGYActions.FRAME_CODE_LOCKED);
|
||||
}
|
||||
});
|
||||
mNetInterfaceManager.getLockedState(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getLockedState", "onComplete: ");
|
||||
int locked = Settings.System.getInt(crv, JGYActions.ACTION_QCH_UNLOCK_IPAD, JGYActions.FRAME_CODE_LOCKED);
|
||||
Log.e("getLockedState", "locked: " + locked);
|
||||
mView.setLockedState(locked == JGYActions.FRAME_CODE_LOCKED);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPushTags() {
|
||||
NetInterfaceManager.getInstance().setPushTags(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
mNetInterfaceManager.setPushTags(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("setPushTags", "onComplete: ");
|
||||
mView.setTagsFinish(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -229,13 +170,12 @@ public class CheckNetPresenter implements CheckNetContact.Presenter {
|
||||
|
||||
@Override
|
||||
public void checkAoleyunUpdate() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.checkAoleyunUpdate(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.checkAoleyunUpdateFinish();
|
||||
}
|
||||
});
|
||||
mNetInterfaceManager.checkAoleyunUpdate(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.checkAoleyunUpdateFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -243,13 +183,12 @@ public class CheckNetPresenter implements CheckNetContact.Presenter {
|
||||
*/
|
||||
@Override
|
||||
public void checkTestUpdate() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.checkTestUpdate(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.checkTestUpdateFinish();
|
||||
}
|
||||
});
|
||||
mNetInterfaceManager.checkTestUpdate(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.checkTestUpdateFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -263,55 +202,27 @@ public class CheckNetPresenter implements CheckNetContact.Presenter {
|
||||
|
||||
@Override
|
||||
public void getAppLimit() {
|
||||
mNetInterfaceManager.getAppLimit(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getAppLimitFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getAllAppList() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getAppLimitObservable()
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("getAppLimit", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse baseResponse) {
|
||||
requestSucceeded = true;
|
||||
Log.e("getAppLimit", "onNext: " + baseResponse);
|
||||
int code = baseResponse.code;
|
||||
if (code == OK) {
|
||||
JsonObject jsonObject = JsonParser.parseString(new Gson().toJson(baseResponse.data)).getAsJsonObject();
|
||||
String data = jsonObject.get("result").getAsString();
|
||||
//开机图标
|
||||
boolean write = Settings.System.putString(crv, JGYActions.ACTION_JGY_SHORTCUTLIST, data);
|
||||
Log.e(TAG, "onNext: only_jgy_shortcut_list: " + write);
|
||||
JGYUtils.getInstance().writeAppPackageList(mContext, data);
|
||||
mView.getAppLimitFinish(data);
|
||||
} else {
|
||||
boolean write = Settings.System.putString(crv, JGYActions.ACTION_JGY_SHORTCUTLIST, " ");
|
||||
JGYUtils.getInstance().writeAppPackageList(mContext, "");
|
||||
Log.e(TAG, "onNext: only_jgy_shortcut_list: " + write);
|
||||
Log.e("getAppLimit", "onNext: " + baseResponse);
|
||||
mView.getAppLimitFinish("");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("getAppLimit", "onError: " + e.getMessage());
|
||||
String oldListString = Settings.System.getString(crv, JGYActions.ACTION_JGY_SHORTCUTLIST);
|
||||
Log.e("getAppLimit", "oldListString: " + oldListString);
|
||||
mView.getAppLimitFinish(oldListString);
|
||||
}
|
||||
|
||||
.getAllAppList(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getAppLimit", "onComplete: ");
|
||||
mView.getAllAppListFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDeviceBatch(String packageList) {
|
||||
public void getDeviceBatch() {
|
||||
int locked = Settings.System.getInt(crv, JGYActions.ACTION_QCH_UNLOCK_IPAD, 0);
|
||||
Log.e(TAG, "getDeviceBatch: " + locked);
|
||||
if (locked == 0) {
|
||||
@@ -322,13 +233,12 @@ public class CheckNetPresenter implements CheckNetContact.Presenter {
|
||||
|
||||
@Override
|
||||
public void getForceDownload() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getForceDownload(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getForceDownloadFinish();
|
||||
}
|
||||
});
|
||||
mNetInterfaceManager.getForceDownload(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getForceDownloadFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// TODO: 2021/6/8 使用现有代码会影响浏览器主页管控
|
||||
@@ -349,29 +259,10 @@ public class CheckNetPresenter implements CheckNetContact.Presenter {
|
||||
|
||||
@Override
|
||||
public void getBrowserBookmarks(String whitelist) {
|
||||
NetInterfaceManager.getInstance().getHomePageBookmarks(new NetInterfaceManager.BookmarksCallback() {
|
||||
@Override
|
||||
public void onSubscribe() {
|
||||
Log.e("getBrowserBookmarks", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext() {
|
||||
requestSucceeded = true;
|
||||
Log.e("getBrowserBookmarks", "onNext: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
Log.e("getBrowserBookmarks", "onError: " + e.getMessage());
|
||||
}
|
||||
|
||||
mNetInterfaceManager.getBookMarkBlackWhiteList(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getBrowserBookmarks", "onComplete: ");
|
||||
if (mView != null) {
|
||||
mView.getBrowserBookmarksFinish();
|
||||
}
|
||||
mView.getBrowserBookmarksFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -383,163 +274,39 @@ public class CheckNetPresenter implements CheckNetContact.Presenter {
|
||||
|
||||
@Override
|
||||
public void getDesktopIcon() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getDesktopIconObservable()
|
||||
.observeOn(Schedulers.io())
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("getDesktopIcon", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse response) {
|
||||
requestSucceeded = true;
|
||||
Log.e("getDesktopIcon", "onNext: ");
|
||||
ApkUtils.showAllAPP(mContext);
|
||||
if (response.code == OK) {
|
||||
String data = response.data.toString();
|
||||
Log.e("getDesktopIcon", "data: " + data);
|
||||
if (!TextUtils.isEmpty(data)) {
|
||||
List<String> newList = Arrays.asList(data.split(","));//新的list
|
||||
PackageManager pm = mContext.getPackageManager();
|
||||
for (String pack : newList) {
|
||||
try {
|
||||
// TODO: 2021/5/24 需要后端替换包名,暂时解决方案
|
||||
try {
|
||||
if ("com.mediatek.camera".equals(pack)) {
|
||||
pm.setApplicationEnabledSetting("com.android.camera2", PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
|
||||
}
|
||||
if ("com.android.mms".equals(pack)) {
|
||||
pm.setApplicationEnabledSetting("com.android.messaging", PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Log.e("getDesktopIcon", "Exception: ex: " + ex.getMessage());
|
||||
}
|
||||
pm.setApplicationEnabledSetting(pack, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
|
||||
Log.e("getDesktopIcon", pack);
|
||||
} catch (Exception e) {
|
||||
Log.e("getDesktopIcon", "Exception: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Log.e("getDesktopIcon", "onNext: " + response.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("getDesktopIcon", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getDesktopIcon", "onComplete: ");
|
||||
JGYUtils.getInstance().hideSystemAPP();
|
||||
mView.getDesktopIconFinish();
|
||||
}
|
||||
});
|
||||
mNetInterfaceManager.getDesktopIcon(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
JGYUtils.getInstance().hideSystemAPP();
|
||||
mView.getDesktopIconFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getAppAutoStartUpdateAndNet() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getAppAutoStartUpdateAndNetObservable()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<NetAndLaunchBean>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("getAppAutoStart", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull NetAndLaunchBean netAndLaunchBean) {
|
||||
requestSucceeded = true;
|
||||
Log.e("getAppAutoStart", "onNext: " + netAndLaunchBean.toString());
|
||||
if (netAndLaunchBean.getCode() == OK) {
|
||||
JGYUtils.getInstance().setNetAndlaunch(netAndLaunchBean);
|
||||
} else {
|
||||
Log.e("getAppAutoStart", "onNext: " + netAndLaunchBean.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("getAppAutoStart", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getAppAutoStart", "onComplete: ");
|
||||
mView.getAppAutoStartUpdateAndNetFinish();
|
||||
}
|
||||
});
|
||||
mNetInterfaceManager.getAppAutoStartUpdateAndNet(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getAppAutoStartUpdateAndNetFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getAppIDControl() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getAppIDControlObservable()
|
||||
.observeOn(Schedulers.io())
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<ResponseBody>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("getAppIDControl", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull ResponseBody responseBody) {
|
||||
requestSucceeded = true;
|
||||
Log.e("getAppIDControl", "onNext: ");
|
||||
try {
|
||||
String bodyString = responseBody.string();
|
||||
Log.e("getAppIDControl", "bodyString: " + bodyString);
|
||||
JsonObject jsonObject = JsonParser.parseString(bodyString).getAsJsonObject();
|
||||
int code = jsonObject.get("code").getAsInt();
|
||||
if (code == OK) {
|
||||
JsonObject data = jsonObject.getAsJsonObject("data");
|
||||
JsonElement ids = data.get("ids");
|
||||
JsonElement packages = data.get("package");
|
||||
if (null == ids || null == packages) {
|
||||
JGYUtils.getInstance().writeDeselectIDtoSystem("", "");
|
||||
} else {
|
||||
JGYUtils.getInstance().writeDeselectIDtoSystem(ids.getAsString(), packages.getAsString());
|
||||
}
|
||||
} else {
|
||||
JGYUtils.getInstance().writeDeselectIDtoSystem("", "");
|
||||
Log.e("getAppIDControl", "onNext: " + bodyString);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
Log.e("getAppIDControl", "onNext: IOException: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("getAppIDControl", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getAppIDControl", "onComplete: ");
|
||||
mView.getAppIDControlFinish();
|
||||
}
|
||||
});
|
||||
mNetInterfaceManager.getAppIDControl(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getAppIDControlFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAppinsideWeb() {
|
||||
Log.e(TAG, "setAppinsideWeb: ");
|
||||
NetInterfaceManager.getInstance().getAppinsideWeb(new NetInterfaceManager.GetAppinsideWebCallback() {
|
||||
mNetInterfaceManager.getAppinsideWeb(new NetInterfaceManager.GetAppinsideWebCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e(TAG, "setAppinsideWeb: " + "onComplete");
|
||||
@@ -553,192 +320,76 @@ public class CheckNetPresenter implements CheckNetContact.Presenter {
|
||||
|
||||
@Override
|
||||
public void setSystemSetting() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getSystemSettingObservable()
|
||||
.observeOn(Schedulers.io())
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<ResponseBody>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("setSystemSetting", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull ResponseBody responseBody) {
|
||||
requestSucceeded = true;
|
||||
SPUtils.put(mContext, CommonConfig.JGY_FIRST_CONNECT, 1);
|
||||
try {
|
||||
String bodyString = responseBody.string();
|
||||
Log.e("setSystemSetting", "onNext: " + bodyString);
|
||||
JsonObject jsonObject = JsonParser.parseString(bodyString).getAsJsonObject();
|
||||
int code = jsonObject.get("code").getAsInt();
|
||||
if (code == OK) {
|
||||
String data = jsonObject.getAsJsonObject("data").toString();
|
||||
//结果保存到本地
|
||||
JGYUtils.getInstance().SettingSysData(data);
|
||||
} else {
|
||||
//没有数据全部关闭
|
||||
// SysSettingUtils.setDisableSetting(mContext);
|
||||
// SPUtils.put(mContext, "SystemSettingData", "");
|
||||
JGYUtils.getInstance().SettingSysData("");
|
||||
//获取系统管控先不要关闭开发人员选项
|
||||
if (!BuildConfig.DEBUG) {
|
||||
Settings.System.putInt(crv, "qch_Developeroptions", 1);
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
Log.e("setSystemSetting", "onNext: IOException: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("setSystemSetting", "onError: " + e.getMessage());
|
||||
String oldData = (String) SPUtils.get(mContext, "SystemSettingData", "");
|
||||
Log.e("setSystemSetting", "oldData: " + oldData);
|
||||
JGYUtils.getInstance().SettingSysData(oldData);
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("setSystemSetting", "onComplete: ");
|
||||
mView.setSystemSettingFinish();
|
||||
}
|
||||
});
|
||||
|
||||
mNetInterfaceManager.setSystemSetting(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.setSystemSettingFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDefaultApp() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getDefaultAppApi()
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse<DefaultApp>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
Log.e("getDefaultApp", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BaseResponse<DefaultApp> defaultAppBaseResponse) {
|
||||
requestSucceeded = true;
|
||||
Log.e("getDefaultApp", "onNext: " + JSONObject.toJSONString(defaultAppBaseResponse.data));
|
||||
int code = defaultAppBaseResponse.code;
|
||||
if (code == OK) {
|
||||
DefaultApp defaultApp = defaultAppBaseResponse.data;
|
||||
JGYUtils.getInstance().setDefaultDesktop(defaultApp.getDefault_launcher());
|
||||
if (defaultApp.getDefault_launcher() != null) {
|
||||
SPUtils.put(mContext, "default_launcher", defaultApp.getDefault_launcher());
|
||||
}
|
||||
} else {
|
||||
Log.e("getDefaultApp", "onNext: " + defaultAppBaseResponse.msg);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
Log.e("getDefaultApp", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getDefaultApp", "onComplete: ");
|
||||
mView.setDefaultAppFinish();
|
||||
}
|
||||
});
|
||||
mNetInterfaceManager.getDefaultApp(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.setDefaultAppFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getROMApp() {
|
||||
String customVersion = Utils.getCustomVersion();
|
||||
Log.e(TAG, "getROMApp: " + customVersion);
|
||||
NetInterfaceManager.getInstance().getCustomROMAppApi()
|
||||
.getROMApp(NetInterfaceManager.HTTP_KEY, customVersion)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
Log.e("getROMApp", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BaseResponse baseResponse) {
|
||||
requestSucceeded = true;
|
||||
Log.e("getROMApp", "onNext: " + baseResponse);
|
||||
if (baseResponse.code == OK) {
|
||||
JsonObject jsonObject = JsonParser.parseString(new Gson().toJson(baseResponse.data)).getAsJsonObject();
|
||||
String packageName = jsonObject.get("package_name").getAsString();
|
||||
Settings.System.putString(crv, "jgy_customromapp", packageName);
|
||||
} else {
|
||||
Log.e("getROMApp", "onNext: " + baseResponse.msg);
|
||||
Settings.System.putString(crv, "jgy_customromapp", " ");
|
||||
// onComplete();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
Log.e("getROMApp", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getROMApp", "onComplete: ");
|
||||
mView.getROMAppFinish();
|
||||
}
|
||||
});
|
||||
mNetInterfaceManager.getCustomROMApp(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getROMAppFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDeveloper() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getDeveloper(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getDeveloperFinish();
|
||||
}
|
||||
});
|
||||
mNetInterfaceManager.getDeveloper(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getDeveloperFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLogoImg() {
|
||||
if (JGYUtils.isOfficialVersion()) {
|
||||
mView.setLogoImgFinish();
|
||||
return;
|
||||
} else {
|
||||
mNetInterfaceManager.setLogoImg(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.setLogoImgFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
NetInterfaceManager.getInstance()
|
||||
.setLogoImg(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.setLogoImgFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTopApp() {
|
||||
if (JGYUtils.isOfficialVersion()) {
|
||||
mView.setTopAppFinish();
|
||||
return;
|
||||
|
||||
} else {
|
||||
mNetInterfaceManager.getTopApp(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.setTopAppFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
NetInterfaceManager.getInstance()
|
||||
.getTopApp(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.setTopAppFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
synchronized public void getScreenLockState() {
|
||||
NetInterfaceManager.getInstance().getScreenLockState(true, getLifecycle(), new NetInterfaceManager.ScreenLockStateListener() {
|
||||
mNetInterfaceManager.getScreenLockState(true, getLifecycle(), new NetInterfaceManager.ScreenLockStateListener() {
|
||||
@Override
|
||||
public void setScreenLockState(boolean locked, String tips) {
|
||||
mView.setScreenLockStateFinish(locked, tips);
|
||||
@@ -750,64 +401,39 @@ public class CheckNetPresenter implements CheckNetContact.Presenter {
|
||||
public void getDefaultDesktop() {
|
||||
if (JGYUtils.isOfficialVersion()) {
|
||||
mView.getDefaultDesktopFinish();
|
||||
NetInterfaceManager.getInstance().getAppLimit();
|
||||
return;
|
||||
mNetInterfaceManager.getAppLimit(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
mNetInterfaceManager.getDefaultDesktop(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getDefaultDesktopFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
NetInterfaceManager.getInstance()
|
||||
.getDefaultDesktop(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
NetInterfaceManager.getInstance().getAllAppList();
|
||||
mView.getDefaultDesktopFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getPoweroffTime() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getPoweroffTime(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.setPoweroffTime();
|
||||
}
|
||||
});
|
||||
mNetInterfaceManager.getPoweroffTime(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.setPoweroffTime();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getWiFiPasswd() {
|
||||
NetInterfaceManager.getInstance().getWiFiControl()
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse<List<WiFiAlias>>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
Log.e("getWiFiPasswd", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BaseResponse<List<WiFiAlias>> listBaseResponse) {
|
||||
Log.e("getWiFiPasswd", "onNext: ");
|
||||
if (listBaseResponse.code == 200) {
|
||||
WiFiUtils.saveWiFiPasswd(listBaseResponse.data);
|
||||
MMKV.defaultMMKV().encode("WiFiPassword", JsonParser.parseString(new Gson().toJson(listBaseResponse.data)).toString());
|
||||
} else {
|
||||
Log.e("getWiFiPasswd", "onNext: msg = " + listBaseResponse.msg);
|
||||
WiFiUtils.saveWiFiPasswd(listBaseResponse.data);
|
||||
MMKV.defaultMMKV().encode("WiFiPassword", "");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
Log.e("getWiFiPasswd", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getWiFiPasswd", "onComplete: ");
|
||||
mView.setWiFiPasswd();
|
||||
}
|
||||
});
|
||||
mNetInterfaceManager.getWiFiPasswd(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.setWiFiPasswd();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,21 +12,14 @@ import com.aoleyun.sn.bean.AppUpdateInfo;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.StudentsInfo;
|
||||
import com.aoleyun.sn.comm.JGYActions;
|
||||
import com.aoleyun.sn.disklrucache.CacheHelper;
|
||||
import com.aoleyun.sn.manager.ConnectManager;
|
||||
import com.aoleyun.sn.manager.ConnectMode;
|
||||
import com.aoleyun.sn.network.NetInterfaceManager;
|
||||
import com.aoleyun.sn.utils.GsonUtils;
|
||||
import com.aoleyun.sn.utils.JGYUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.trello.rxlifecycle4.RxLifecycle;
|
||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
|
||||
@@ -16,7 +16,6 @@ import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.manager.AmapManager;
|
||||
import com.aoleyun.sn.manager.ConnectManager;
|
||||
import com.aoleyun.sn.manager.FileManager;
|
||||
import com.aoleyun.sn.network.HTTPInterface;
|
||||
import com.aoleyun.sn.network.NetInterfaceManager;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
import com.aoleyun.sn.rlog.LogDBManager;
|
||||
@@ -378,7 +377,6 @@ public class BaseApplication extends MultiDexApplication {
|
||||
|
||||
public static void setJpushTags() {
|
||||
Log.e(TAG, "30s后重新设置tags");
|
||||
// HTTPInterface.setPushTags(context);
|
||||
}
|
||||
|
||||
private static OnAliasResult onAliasResult;
|
||||
|
||||
29
app/src/main/java/com/aoleyun/sn/bean/AppID.java
Normal file
29
app/src/main/java/com/aoleyun/sn/bean/AppID.java
Normal file
@@ -0,0 +1,29 @@
|
||||
package com.aoleyun.sn.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class AppID implements Serializable {
|
||||
private static final long serialVersionUID = -2177988059115315546L;
|
||||
|
||||
String ids;
|
||||
@SerializedName("package")
|
||||
String packages;
|
||||
|
||||
public String getIds() {
|
||||
return ids;
|
||||
}
|
||||
|
||||
public void setIds(String ids) {
|
||||
this.ids = ids;
|
||||
}
|
||||
|
||||
public String getPackages() {
|
||||
return packages;
|
||||
}
|
||||
|
||||
public void setPackages(String packages) {
|
||||
this.packages = packages;
|
||||
}
|
||||
}
|
||||
17
app/src/main/java/com/aoleyun/sn/bean/AppLimit.java
Normal file
17
app/src/main/java/com/aoleyun/sn/bean/AppLimit.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package com.aoleyun.sn.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class AppLimit implements Serializable {
|
||||
private static final long serialVersionUID = -4550724319678357614L;
|
||||
|
||||
String result;
|
||||
|
||||
public String getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(String result) {
|
||||
this.result = result;
|
||||
}
|
||||
}
|
||||
17
app/src/main/java/com/aoleyun/sn/bean/CustomROMApp.java
Normal file
17
app/src/main/java/com/aoleyun/sn/bean/CustomROMApp.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package com.aoleyun.sn.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class CustomROMApp implements Serializable {
|
||||
private static final long serialVersionUID = 4050973622829547418L;
|
||||
|
||||
String package_name;
|
||||
|
||||
public String getPackage_name() {
|
||||
return package_name;
|
||||
}
|
||||
|
||||
public void setPackage_name(String package_name) {
|
||||
this.package_name = package_name;
|
||||
}
|
||||
}
|
||||
17
app/src/main/java/com/aoleyun/sn/bean/EBagCode.java
Normal file
17
app/src/main/java/com/aoleyun/sn/bean/EBagCode.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package com.aoleyun.sn.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class EBagCode implements Serializable {
|
||||
private static final long serialVersionUID = -5406288064300275496L;
|
||||
|
||||
String ebagCode;
|
||||
|
||||
public String getEbagCode() {
|
||||
return ebagCode;
|
||||
}
|
||||
|
||||
public void setEbagCode(String ebagCode) {
|
||||
this.ebagCode = ebagCode;
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,8 @@ package com.aoleyun.sn.bean;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonParser;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@@ -38,6 +40,7 @@ public class NetAndLaunchBean implements Serializable {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String toString() {
|
||||
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
|
||||
|
||||
@@ -103,6 +103,7 @@ public class CacheHelper {
|
||||
// =======================================
|
||||
|
||||
public void put(String key, String value) {
|
||||
Log.e(TAG, "put: " + key);
|
||||
mMMKV.encode(key, System.currentTimeMillis());
|
||||
|
||||
DiskLruCache.Editor edit = null;
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
package com.aoleyun.sn.network;
|
||||
|
||||
public class HTTPInterface {
|
||||
private static final String TAG = HTTPInterface.class.getSimpleName();
|
||||
private static final int OK = 200;
|
||||
|
||||
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -32,10 +32,10 @@ public class UrlAddress {
|
||||
public static final String GET_DEVICES_TAGS = "Sn/getSnTag";
|
||||
/*浏览器书签主页设置*/
|
||||
public static final String SET_HOMEPAG_TAG = "Label";
|
||||
/*app内部网页管控*/
|
||||
public static final String SET_APPINSIDEWEB = "Appground";
|
||||
/*浏览器黑白名单地址*/
|
||||
public static final String SET_BROWSER_LIST = "browser";
|
||||
/*app内部网页管控*/
|
||||
public static final String SET_APPINSIDEWEB = "Appground";
|
||||
/*强制安装应用*/
|
||||
public static final String GET_FORCE_INSTALL_LIST = "forceinstall/index";
|
||||
/*应用白名单*/
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
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;
|
||||
|
||||
@@ -11,7 +12,7 @@ import retrofit2.http.POST;
|
||||
public interface AppLimitApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.SET_WHITE_PACKAGE_LIST)
|
||||
Observable<BaseResponse> getAppLimitApi(
|
||||
Observable<BaseResponse<AppLimit>> getAppLimitApi(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
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;
|
||||
@@ -11,7 +12,7 @@ import retrofit2.http.POST;
|
||||
public interface CustomROMAppApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_ROM_APP)
|
||||
Observable<BaseResponse> getROMApp(
|
||||
Observable<BaseResponse<CustomROMApp>> getROMApp(
|
||||
@Field("key") String key,
|
||||
@Field("version_number") String version_number
|
||||
);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
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 io.reactivex.rxjava3.core.Observable;
|
||||
@@ -11,7 +13,7 @@ import retrofit2.http.POST;
|
||||
public interface DeselectIDApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_APPID)
|
||||
Observable<ResponseBody> getDeselectIDApi(
|
||||
Observable<BaseResponse<AppID>> getDeselectIDApi(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
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;
|
||||
@@ -11,7 +12,7 @@ import retrofit2.http.POST;
|
||||
public interface GetEBagCodeApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_EBAG_CODE)
|
||||
Observable<BaseResponse> getEBagCode(
|
||||
Observable<BaseResponse<EBagCode>> getEBagCode(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
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 okhttp3.ResponseBody;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
@@ -11,7 +11,7 @@ import retrofit2.http.POST;
|
||||
public interface SystemSettingApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.GET_FIRMWARE)
|
||||
Observable<ResponseBody> getSystemSettingApi(
|
||||
Observable<BaseResponse> getSystemSettingApi(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
);
|
||||
|
||||
@@ -11,7 +11,6 @@ import android.util.Log;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.comm.PackageNames;
|
||||
import com.aoleyun.sn.network.HTTPInterface;
|
||||
import com.aoleyun.sn.network.NetInterfaceManager;
|
||||
import com.aoleyun.sn.utils.ApkUtils;
|
||||
import com.aoleyun.sn.utils.CacheUtils;
|
||||
|
||||
@@ -249,7 +249,6 @@ public class GuardService extends Service {
|
||||
}
|
||||
break;
|
||||
case Intent.ACTION_SCREEN_OFF: {
|
||||
// HTTPInterface.getAppLimit(GuardService.this);
|
||||
long time = System.currentTimeMillis();
|
||||
getLockState("1", String.valueOf(time));
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
|
||||
@@ -32,9 +32,10 @@ public class MainSContact {
|
||||
/*分支4 获取应用*/
|
||||
/*获取设备信息更新*/
|
||||
void checkAoleyunUpdate();
|
||||
|
||||
/*获取测试应用更新*/
|
||||
void checkTestUpdate();
|
||||
/*获取可被写入的安装包名*/
|
||||
void getAppLimit();
|
||||
/*获取强制下载apk*/
|
||||
void getForceDownload();
|
||||
/*获取桌面*/
|
||||
@@ -47,8 +48,8 @@ public class MainSContact {
|
||||
void getDeveloper();
|
||||
/*获取设备后台设置*/
|
||||
void getSystemSettingBegin();
|
||||
/*获取可被写入的安装包名*/
|
||||
void getAppLimit();
|
||||
/*获取所有app详细信息*/
|
||||
void getAllAppList();
|
||||
/*获取自定义内置app*/
|
||||
void getROMApp();
|
||||
/*获取浏览器书签设置管控*/
|
||||
@@ -75,10 +76,10 @@ public class MainSContact {
|
||||
void getSnTimeControl();
|
||||
/*获取电子书包激活码*/
|
||||
void getEBagCode();
|
||||
/*获取wifi密码*/
|
||||
void getWiFiPasswd();
|
||||
/*获取屏幕锁状态*/
|
||||
void getScreenLockState();
|
||||
/*获取wifi密码*/
|
||||
void getWiFiPasswd();
|
||||
}
|
||||
|
||||
public interface MainView extends BaseView {
|
||||
@@ -105,9 +106,10 @@ public class MainSContact {
|
||||
|
||||
/*获取设备信息更新*/
|
||||
void checkAoleyunUpdateFinish();
|
||||
|
||||
/*获取测试应用更新*/
|
||||
void checkTestUpdateFinish();
|
||||
/*获取可被写入的安装包名结束*/
|
||||
void getAppLimitFinish();
|
||||
/*获取强制下载apk结束*/
|
||||
void getForceDownloadFinish();
|
||||
/*获取桌面结束*/
|
||||
@@ -119,8 +121,8 @@ public class MainSContact {
|
||||
void getDeveloperFinish();
|
||||
/*设置设备后台设置*/
|
||||
void setSystemSetting();
|
||||
/*获取可被写入的安装包名结束*/
|
||||
void getAppLimitFinish();
|
||||
/*获取所有app详细信息*/
|
||||
void getAllAppListFinish();
|
||||
/*获取自定义内置app*/
|
||||
void getROMAppFinish();
|
||||
/*获取浏览器书签设置管控结束*/
|
||||
@@ -147,9 +149,9 @@ public class MainSContact {
|
||||
void getSnTimeControlFinish();
|
||||
/*获取电子书包激活码*/
|
||||
void getEBagCodeFinish();
|
||||
/*获取wifi密码结束*/
|
||||
void setWiFiPasswd();
|
||||
/*设置屏幕锁状态结束*/
|
||||
void setScreenLockStateFinish(boolean locked, String tips);
|
||||
/*获取wifi密码结束*/
|
||||
void setWiFiPasswd();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,54 +2,25 @@ package com.aoleyun.sn.service.main;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.aoleyun.sn.BuildConfig;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.DefaultApp;
|
||||
import com.aoleyun.sn.bean.LogoImg;
|
||||
import com.aoleyun.sn.bean.NetAndLaunchBean;
|
||||
import com.aoleyun.sn.bean.StudentsInfo;
|
||||
import com.aoleyun.sn.bean.WiFiAlias;
|
||||
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.utils.ApkUtils;
|
||||
import com.aoleyun.sn.utils.JGYUtils;
|
||||
import com.aoleyun.sn.utils.SPUtils;
|
||||
import com.aoleyun.sn.utils.TimeUtils;
|
||||
import com.aoleyun.sn.utils.ToastUtil;
|
||||
import com.aoleyun.sn.utils.URLUtils;
|
||||
import com.aoleyun.sn.utils.Utils;
|
||||
import com.aoleyun.sn.utils.WiFiUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.trello.rxlifecycle4.RxLifecycle;
|
||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
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;
|
||||
import okhttp3.ResponseBody;
|
||||
|
||||
import static com.google.gson.JsonParser.parseString;
|
||||
|
||||
/**
|
||||
* MainService 的 Presenter
|
||||
@@ -64,9 +35,6 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
private MMKV mMMKV = MMKV.defaultMMKV();
|
||||
private CacheHelper cacheHelper;
|
||||
|
||||
private final String DEFAULT_INFO = "暂无信息";
|
||||
private final int OK = 200;
|
||||
|
||||
private BehaviorSubject<ActivityEvent> lifecycle;
|
||||
|
||||
public void setLifecycle(BehaviorSubject<ActivityEvent> lifecycle) {
|
||||
@@ -237,6 +205,17 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getAppLimit() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getAppLimit(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getAppLimitFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getForceDownload() {
|
||||
NetInterfaceManager.getInstance()
|
||||
@@ -258,7 +237,6 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
.getDefaultDesktop(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
NetInterfaceManager.getInstance().getAllAppList();
|
||||
mView.getDefaultDesktopFinish();
|
||||
}
|
||||
});
|
||||
@@ -303,50 +281,12 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getAppLimit() {
|
||||
public void getAllAppList() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getAppLimitObservable()
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("getAppLimit", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse baseResponse) {
|
||||
|
||||
Log.e("getAppLimit", "onNext: " + baseResponse);
|
||||
if (baseResponse.code == OK) {
|
||||
Log.e("getAppLimit", "onNext: " + baseResponse.data.toString());
|
||||
JsonObject jsonObject = parseString(new Gson().toJson(baseResponse.data)).getAsJsonObject();
|
||||
String data = jsonObject.get("result").getAsString();
|
||||
//开机图标
|
||||
boolean write = Settings.System.putString(mContext.getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST, data);
|
||||
Log.e(TAG, "onNext: only_jgy_shortcut_list: " + write);
|
||||
JGYUtils.getInstance().writeAppPackageList(mContext, data);
|
||||
mView.getAppLimitFinish();
|
||||
} else {
|
||||
boolean write = Settings.System.putString(mContext.getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST, " ");
|
||||
JGYUtils.getInstance().writeAppPackageList(mContext, "");
|
||||
Log.e(TAG, "onNext: only_jgy_shortcut_list: " + write);
|
||||
Log.e("getAppLimit", "onNext: " + baseResponse);
|
||||
mView.getAppLimitFinish();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("getAppLimit", "onError: " + e.getMessage());
|
||||
String oldListString = Settings.System.getString(mContext.getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST);
|
||||
Log.e("getAppLimit", "oldListString: " + oldListString);
|
||||
onComplete();
|
||||
}
|
||||
|
||||
.getAllAppList(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getAppLimit", "onComplete: ");
|
||||
mView.getAppLimitFinish();
|
||||
mView.getAllAppListFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -355,40 +295,10 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
public void getROMApp() {
|
||||
String customVersion = Utils.getCustomVersion();
|
||||
Log.e(TAG, "getROMApp: " + customVersion);
|
||||
NetInterfaceManager.getInstance().getCustomROMAppApi()
|
||||
.getROMApp(NetInterfaceManager.HTTP_KEY, customVersion)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
Log.e("getROMApp", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BaseResponse baseResponse) {
|
||||
|
||||
Log.e("getROMApp", "onNext: " + baseResponse);
|
||||
if (baseResponse.code == OK) {
|
||||
JsonObject jsonObject = parseString(new Gson().toJson(baseResponse.data)).getAsJsonObject();
|
||||
String packageName = jsonObject.get("package_name").getAsString();
|
||||
Settings.System.putString(mContext.getContentResolver(), "jgy_customromapp", packageName);
|
||||
} else {
|
||||
Log.e("getROMApp", "onNext: " + baseResponse.msg);
|
||||
Settings.System.putString(mContext.getContentResolver(), "jgy_customromapp", " ");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
Log.e("getROMApp", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
NetInterfaceManager.getInstance()
|
||||
.getCustomROMApp(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getROMApp", "onComplete: ");
|
||||
mView.getROMAppFinish();
|
||||
}
|
||||
});
|
||||
@@ -396,29 +306,11 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
|
||||
@Override
|
||||
public void getBrowserBookmarks() {
|
||||
NetInterfaceManager.getInstance().getHomePageBookmarks(new NetInterfaceManager.BookmarksCallback() {
|
||||
@Override
|
||||
public void onSubscribe() {
|
||||
Log.e("getBrowserBookmarks", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext() {
|
||||
|
||||
Log.e("getBrowserBookmarks", "onNext: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
Log.e("getBrowserBookmarks", "onError: " + e.getMessage());
|
||||
}
|
||||
|
||||
NetInterfaceManager.getInstance()
|
||||
.getBookMarkBlackWhiteList(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getBrowserBookmarks", "onComplete: ");
|
||||
if (mView != null) {
|
||||
mView.getBrowserBookmarksFinish();
|
||||
}
|
||||
mView.getBrowserBookmarksFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -432,60 +324,9 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
@Override
|
||||
public void getDesktopIcon() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getDesktopIconObservable()
|
||||
.observeOn(Schedulers.io())
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("getDesktopIcon", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse response) {
|
||||
|
||||
Log.e("getDesktopIcon", "onNext: ");
|
||||
ApkUtils.showAllAPP(mContext);
|
||||
if (response.code == OK) {
|
||||
String data = response.data.toString();
|
||||
Log.e("getDesktopIcon", "data: " + data);
|
||||
if (!TextUtils.isEmpty(data)) {
|
||||
List<String> newList = Arrays.asList(data.split(","));//新的list
|
||||
PackageManager pm = mContext.getPackageManager();
|
||||
for (String pack : newList) {
|
||||
try {
|
||||
// TODO: 2021/5/24 需要后端替换包名,暂时解决方案
|
||||
try {
|
||||
if ("com.mediatek.camera".equals(pack)) {
|
||||
pm.setApplicationEnabledSetting("com.android.camera2", PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
|
||||
}
|
||||
if ("com.android.mms".equals(pack)) {
|
||||
pm.setApplicationEnabledSetting("com.android.messaging", PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Log.e("getDesktopIcon", "Exception: ex: " + ex.getMessage());
|
||||
}
|
||||
pm.setApplicationEnabledSetting(pack, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
|
||||
Log.e("getDesktopIcon", pack);
|
||||
} catch (Exception e) {
|
||||
Log.e("getDesktopIcon", "Exception: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Log.e("getDesktopIcon", "onNext: " + response.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("getDesktopIcon", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
.getDesktopIcon(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getDesktopIcon", "onComplete: ");
|
||||
JGYUtils.getInstance().hideSystemAPP();
|
||||
mView.getDesktopIconFinish();
|
||||
}
|
||||
@@ -495,36 +336,9 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
@Override
|
||||
public void getAppAutoStartUpdateAndNet() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getAppAutoStartUpdateAndNetObservable()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<NetAndLaunchBean>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("getAppAutoStart", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull NetAndLaunchBean netAndLaunchBean) {
|
||||
|
||||
Log.e("getAppAutoStart", "onNext: " + netAndLaunchBean.toString());
|
||||
if (netAndLaunchBean.getCode() == OK) {
|
||||
JGYUtils.getInstance().setNetAndlaunch(netAndLaunchBean);
|
||||
} else {
|
||||
Log.e("getAppAutoStart", "onNext: " + netAndLaunchBean.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("getAppAutoStart", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
.getAppAutoStartUpdateAndNet(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getAppAutoStart", "onComplete: ");
|
||||
mView.getAppAutoStartUpdateAndNetFinish();
|
||||
}
|
||||
});
|
||||
@@ -533,52 +347,9 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
@Override
|
||||
public void getAppIDControl() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getAppIDControlObservable()
|
||||
.observeOn(Schedulers.io())
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<ResponseBody>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("getAppIDControl", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull ResponseBody responseBody) {
|
||||
|
||||
Log.e("getAppIDControl", "onNext: ");
|
||||
try {
|
||||
String bodyString = responseBody.string();
|
||||
Log.e("getAppIDControl", "bodyString: " + bodyString);
|
||||
JsonObject jsonObject = parseString(bodyString).getAsJsonObject();
|
||||
int code = jsonObject.get("code").getAsInt();
|
||||
if (code == OK) {
|
||||
JsonObject data = jsonObject.getAsJsonObject("data");
|
||||
JsonElement ids = data.get("ids");
|
||||
JsonElement packages = data.get("package");
|
||||
if (null == ids || null == packages) {
|
||||
JGYUtils.getInstance().writeDeselectIDtoSystem("", "");
|
||||
} else {
|
||||
JGYUtils.getInstance().writeDeselectIDtoSystem(ids.getAsString(), packages.getAsString());
|
||||
}
|
||||
} else {
|
||||
JGYUtils.getInstance().writeDeselectIDtoSystem("", "");
|
||||
Log.e("getAppIDControl", "onNext: " + bodyString);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
Log.e("getAppIDControl", "onNext: IOException: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("getAppIDControl", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
.getAppIDControl(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getAppIDControl", "onComplete: ");
|
||||
mView.getAppIDControlFinish();
|
||||
}
|
||||
});
|
||||
@@ -601,98 +372,20 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
@Override
|
||||
public void setSystemSetting() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getSystemSettingObservable()
|
||||
.observeOn(Schedulers.io())
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<ResponseBody>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("setSystemSetting", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull ResponseBody responseBody) {
|
||||
|
||||
SPUtils.put(mContext, CommonConfig.JGY_FIRST_CONNECT, 1);
|
||||
try {
|
||||
String bodyString = responseBody.string();
|
||||
Log.e("setSystemSetting", "onNext: " + bodyString);
|
||||
JsonObject jsonObject = parseString(bodyString).getAsJsonObject();
|
||||
int code = jsonObject.get("code").getAsInt();
|
||||
if (code == OK) {
|
||||
String data = jsonObject.getAsJsonObject("data").toString();
|
||||
//结果保存到本地
|
||||
JGYUtils.getInstance().SettingSysData(data);
|
||||
} else {
|
||||
//没有数据全部关闭
|
||||
// SysSettingUtils.setDisableSetting(mContext);
|
||||
// SPUtils.put(mContext, "SystemSettingData", "");
|
||||
JGYUtils.getInstance().SettingSysData("");
|
||||
//获取系统管控先不要关闭开发人员选项
|
||||
if (!BuildConfig.DEBUG) {
|
||||
Settings.System.putInt(mContext.getContentResolver(), "qch_Developeroptions", 1);
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
Log.e("setSystemSetting", "onNext: IOException: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("setSystemSetting", "onError: " + e.getMessage());
|
||||
String oldData = (String) SPUtils.get(mContext, "SystemSettingData", "");
|
||||
Log.e("setSystemSetting", "oldData: " + oldData);
|
||||
JGYUtils.getInstance().SettingSysData(oldData);
|
||||
onComplete();
|
||||
}
|
||||
|
||||
.setSystemSetting(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("setSystemSetting", "onComplete: ");
|
||||
mView.setSystemSettingFinish();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDefaultApp() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getDefaultAppApi()
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse<DefaultApp>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
Log.e("getDefaultApp", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BaseResponse<DefaultApp> defaultAppBaseResponse) {
|
||||
|
||||
Log.e("getDefaultApp", "onNext: " + JSONObject.toJSONString(defaultAppBaseResponse.data));
|
||||
int code = defaultAppBaseResponse.code;
|
||||
if (code == OK) {
|
||||
DefaultApp defaultApp = defaultAppBaseResponse.data;
|
||||
JGYUtils.getInstance().setDefaultDesktop(defaultApp.getDefault_launcher());
|
||||
if (defaultApp.getDefault_launcher() != null) {
|
||||
SPUtils.put(mContext, "default_launcher", defaultApp.getDefault_launcher());
|
||||
}
|
||||
} else {
|
||||
Log.e("getDefaultApp", "onNext: " + defaultAppBaseResponse.msg);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
Log.e("getDefaultApp", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
.getDefaultApp(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getDefaultApp", "onComplete: ");
|
||||
mView.setDefaultAppFinish();
|
||||
}
|
||||
});
|
||||
@@ -728,132 +421,28 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
public void getSnTimeControl() {
|
||||
if (JGYUtils.isOfficialVersion()) {
|
||||
mView.getSnTimeControlFinish();
|
||||
return;
|
||||
}
|
||||
NetInterfaceManager.getInstance()
|
||||
.getSnTimeObservable()
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("getSnTimeControl", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse response) {
|
||||
|
||||
Log.e("getSnTimeControl", "onNext: ");
|
||||
int code = response.code;
|
||||
if (code == OK) {
|
||||
JsonObject jsonObject = JsonParser.parseString(new Gson().toJson(response.data)).getAsJsonObject();
|
||||
String start_time = jsonObject.get("start_time").getAsString();
|
||||
String end_time = jsonObject.get("end_time").getAsString();
|
||||
TimeUtils.ContralTime c = TimeUtils.String2ContralTime(mContext, start_time + "-" + end_time);
|
||||
if (null != c) {
|
||||
Log.e("getTimeControl", "OK:" + c.toString());
|
||||
}
|
||||
} else {
|
||||
TimeUtils.setEmpty(mContext);
|
||||
TimeUtils.ContralTime c = TimeUtils.getDefaltContralTime(mContext);
|
||||
if (null != c) {
|
||||
Log.e("getTimeControl", c.toString());
|
||||
}
|
||||
} else {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getSnTimeControl(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getSnTimeControlFinish();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("getSnTimeControl", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getSnTimeControl", "onComplete: ");
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(MainService.TimeChangedReceiver.ACTION_UPDATE);
|
||||
mContext.sendBroadcast(intent);
|
||||
mView.getSnTimeControlFinish();
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getEBagCode() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getEBagCodeControl()
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
Log.e("getEBagCode", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BaseResponse baseResponse) {
|
||||
|
||||
Log.e("getEBagCode", "onNext: " + baseResponse);
|
||||
int code = baseResponse.code;
|
||||
if (code == OK) {
|
||||
JsonObject jsonObject = parseString(new Gson().toJson(baseResponse.data)).getAsJsonObject();
|
||||
String ebagCode = jsonObject.get("ebagCode").getAsString();
|
||||
SPUtils.put(mContext, "ebagCode", ebagCode);
|
||||
} else {
|
||||
Log.e("getEBagCode", "onNext: " + baseResponse.data);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
Log.e("getEBagCode", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
.getEBagCode(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getEBagCode", "onComplete: ");
|
||||
mView.getEBagCodeFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getWiFiPasswd() {
|
||||
NetInterfaceManager.getInstance().getWiFiControl()
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse<List<WiFiAlias>>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
Log.e("getWiFiPasswd", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BaseResponse<List<WiFiAlias>> listBaseResponse) {
|
||||
Log.e("getWiFiPasswd", "onNext: ");
|
||||
if (listBaseResponse.code == OK) {
|
||||
WiFiUtils.saveWiFiPasswd(listBaseResponse.data);
|
||||
mMMKV.encode("WiFiPassword", parseString(new Gson().toJson(listBaseResponse.data)).toString());
|
||||
} else {
|
||||
Log.e("getWiFiPasswd", "onNext: msg = " + listBaseResponse.msg);
|
||||
WiFiUtils.saveWiFiPasswd(listBaseResponse.data);
|
||||
mMMKV.encode("WiFiPassword", "");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
Log.e("getWiFiPasswd", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getWiFiPasswd", "onComplete: ");
|
||||
mView.setWiFiPasswd();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getScreenLockState() {
|
||||
@@ -864,4 +453,15 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getWiFiPasswd() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getWiFiPasswd(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.setWiFiPasswd();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
|
||||
@Override
|
||||
public void onConnected(NetworkUtils.NetworkType networkType) {
|
||||
Debug.waitForDebugger();
|
||||
// Debug.waitForDebugger();
|
||||
ToastUtil.betaShow("网络已连接");
|
||||
String WiFiAlias = Utils.getWifiAlias(this);
|
||||
Log.e("OnNetworkStatusChanged", "onConnected: " + WiFiAlias);
|
||||
@@ -886,6 +886,11 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
|
||||
@Override
|
||||
public void checkTestUpdateFinish() {
|
||||
mPresenter.getAppLimit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getAppLimitFinish() {
|
||||
mPresenter.getForceDownload();
|
||||
}
|
||||
|
||||
@@ -911,11 +916,11 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
|
||||
@Override
|
||||
public void setSystemSetting() {
|
||||
mPresenter.getAppLimit();
|
||||
mPresenter.getAllAppList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getAppLimitFinish() {
|
||||
public void getAllAppListFinish() {
|
||||
mPresenter.getROMApp();
|
||||
}
|
||||
|
||||
@@ -981,11 +986,6 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
|
||||
@Override
|
||||
public void getEBagCodeFinish() {
|
||||
mPresenter.getWiFiPasswd();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWiFiPasswd() {
|
||||
mPresenter.getScreenLockState();
|
||||
}
|
||||
|
||||
@@ -1006,5 +1006,11 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
SPUtils.put(this, "is_screen_lock", false);
|
||||
SPUtils.put(this, "screen_tips", "");
|
||||
}
|
||||
mPresenter.getWiFiPasswd();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWiFiPasswd() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -805,50 +805,10 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
||||
}
|
||||
|
||||
private void getDeselectID() {
|
||||
NetInterfaceManager.getInstance().getDeselectIDApi()
|
||||
.getDeselectIDApi(NetInterfaceManager.HTTP_KEY,
|
||||
Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<ResponseBody>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable param1Disposable) {
|
||||
Log.e("getDeselectID", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(ResponseBody param1ResponseBody) {
|
||||
String ids = "";
|
||||
String packages = "";
|
||||
try {
|
||||
String responString = param1ResponseBody.string();
|
||||
Log.e("getDeselectID", "onNext: " + responString);
|
||||
JSONObject jSONObject = JSON.parseObject(responString);
|
||||
int code = jSONObject.getInteger("code");
|
||||
if (code == 200) {
|
||||
ids = jSONObject.getJSONObject("data").getString("ids");
|
||||
packages = jSONObject.getJSONObject("data").getString("package");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.e("getDeselectID", "onNext: Exception: " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
JGYUtils.getInstance().writeDeselectIDtoSystem(ids, packages);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable param1Throwable) {
|
||||
Log.e("getDeselectID", "onError: " + param1Throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getDeselectID", "onComplete: ");
|
||||
}
|
||||
});
|
||||
NetInterfaceManager.getInstance()
|
||||
.getAppIDControl();
|
||||
}
|
||||
|
||||
|
||||
private void setDisableSlideList(String jsonString) {
|
||||
JSONObject jSONObject = JSON.parseObject(jsonString);
|
||||
Log.e("setDisableSlideList", "jSONObject::" + jSONObject.toString());
|
||||
@@ -949,27 +909,7 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
||||
}
|
||||
|
||||
private void setHomepagtag() {
|
||||
NetInterfaceManager.getInstance().getHomePageBookmarks(new NetInterfaceManager.BookmarksCallback() {
|
||||
@Override
|
||||
public void onSubscribe() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
NetInterfaceManager.getInstance().getBookMarkBlackWhiteList();
|
||||
}
|
||||
|
||||
private void setAPPinsideWebsite(String s) {
|
||||
|
||||
@@ -53,7 +53,6 @@ import com.aoleyun.sn.BuildConfig;
|
||||
import com.aoleyun.sn.R;
|
||||
import com.aoleyun.sn.base.BaseApplication;
|
||||
import com.aoleyun.sn.comm.CommonConfig;
|
||||
import com.aoleyun.sn.network.HTTPInterface;
|
||||
import com.aoleyun.sn.network.NetInterfaceManager;
|
||||
import com.arialyy.aria.core.Aria;
|
||||
import com.blankj.utilcode.util.FileUtils;
|
||||
@@ -1547,7 +1546,7 @@ public class Utils {
|
||||
* @param context
|
||||
*/
|
||||
public static void getPublicIP(Context context) {
|
||||
NetInterfaceManager.getPublicIP(context, new NetInterfaceManager.PublicIP() {
|
||||
NetInterfaceManager.getPublicIP(new NetInterfaceManager.PublicIP() {
|
||||
@Override
|
||||
public void set(String ip) {
|
||||
SPUtils.put(context, "PublicIP", ip);
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
|
||||
<Button
|
||||
android:id="@+id/bt_confirm"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="@dimen/dp_160"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:background="@drawable/bg_sure"
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
|
||||
<Button
|
||||
android:id="@+id/bt_confirm"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="@dimen/dp_160"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:background="@drawable/bg_sure"
|
||||
|
||||
Reference in New Issue
Block a user