version:m40se 2.9.2
fix:修复m40se 管控失效问题,修复魔术appsd卡问题 update:优化网络请求
This commit is contained in:
@@ -18,6 +18,7 @@ public class MainSContact {
|
||||
void setLockScreenPwd();
|
||||
void setAppInside();
|
||||
void setForceInstall();
|
||||
void setSnBind();
|
||||
void setSystemSettings();
|
||||
void setBrowserLabel();
|
||||
void setBrowserWhiteList();
|
||||
@@ -56,6 +57,8 @@ public class MainSContact {
|
||||
void getForceInstall();
|
||||
//获取id管控
|
||||
void getAppInside();
|
||||
//获取设备绑定状态
|
||||
void getSnBind();
|
||||
//获取系统设置
|
||||
void getSystemSettings();
|
||||
//获取浏览器书签
|
||||
|
||||
@@ -8,6 +8,7 @@ import android.util.Log;
|
||||
import com.fuying.sn.bean.AppStart;
|
||||
import com.fuying.sn.bean.BaseResponse;
|
||||
import com.fuying.sn.bean.MyAppUsageBean;
|
||||
import com.fuying.sn.bean.SnBindState;
|
||||
import com.fuying.sn.config.CommonConfig;
|
||||
import com.fuying.sn.desktop.RunningAppManager;
|
||||
import com.fuying.sn.disklrucache.CacheHelper;
|
||||
@@ -26,6 +27,7 @@ import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||
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;
|
||||
@@ -207,6 +209,42 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSnBind() {
|
||||
NetInterfaceManager.getInstance().getSnBindObservable()
|
||||
.compose(RxLifecycle.bindUntilEvent(lifecycle, ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse<SnBindState>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("getSnBind", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse<SnBindState> snBindStateBaseResponse) {
|
||||
Log.e("getSnBind", "onNext: " + snBindStateBaseResponse);
|
||||
if (snBindStateBaseResponse.code == 200) {
|
||||
SnBindState snBindState = snBindStateBaseResponse.data;
|
||||
int is_bind = snBindState.getIs_bind();
|
||||
mMMKV.encode(CommonConfig.DEVICES_IS_BIND_KEY, is_bind);
|
||||
} else {
|
||||
mMMKV.encode(CommonConfig.DEVICES_IS_BIND_KEY, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("getSnBind", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getSnBind", "onComplete: ");
|
||||
mView.setSnBind();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSystemSettings() {
|
||||
NetInterfaceManager.getInstance()
|
||||
|
||||
@@ -122,7 +122,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
Handler.getMain().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
NetInterfaceManager.getInstance().updateAdminInfo();
|
||||
// NetInterfaceManager.getInstance().updateAdminInfo();
|
||||
if (JGYUtils.getInstance().isScreenOn()) {
|
||||
mPresenter.getSnInfo();
|
||||
mPresenter.getAppAndWhite();
|
||||
@@ -155,10 +155,17 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
mPresenter.setLifecycle(lifecycleSubject);
|
||||
mPresenter.attachView(this);
|
||||
|
||||
// if (BuildConfig.DEBUG){
|
||||
// Settings.Global.putInt(getContentResolver(), Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 1);
|
||||
// Settings.Global.putInt(getContentResolver(), Settings.Global.ADB_ENABLED, 1);
|
||||
// Settings.System.putInt(getContentResolver(), CommonConfig.AOLE_ACTION_DEVELOPER_OPTIONS, 1);
|
||||
// }
|
||||
|
||||
Log.e(TAG, "onCreate run: 20秒后请求网络");
|
||||
Handler.getMain().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Log.e("TimeObserver", "run: "+NetStateUtils.isNetworkConnected(MainService.this) );
|
||||
if (NetStateUtils.isNetworkConnected(MainService.this)) {
|
||||
NetInterfaceManager.getInstance().getAppWhiteList(() -> {
|
||||
Log.e("TimeObserver", "onNext: getAppWhiteList");
|
||||
@@ -499,10 +506,12 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
}
|
||||
//设备没有绑定
|
||||
else if (code == 300) {
|
||||
NetInterfaceManager.getInstance().updateAdminInfo();
|
||||
ControlManager.getInstance().setDisableSetting();
|
||||
}
|
||||
//没有授权的设备
|
||||
else if (code == 401) {
|
||||
NetInterfaceManager.getInstance().updateAdminInfo();
|
||||
ControlManager.getInstance().setDisableSetting();
|
||||
}
|
||||
}
|
||||
@@ -543,6 +552,11 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
|
||||
@Override
|
||||
public void setAppInside() {
|
||||
mPresenter.getSnBind();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSnBind() {
|
||||
mPresenter.getSystemSettings();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user