version:3.1.0

fix:默认打开重置选项
update:
This commit is contained in:
2023-11-20 15:02:29 +08:00
parent 94cfe5e6b0
commit 576419bbf2
5 changed files with 30 additions and 36 deletions

View File

@@ -481,6 +481,8 @@ dependencies {
implementation "org.java-websocket:Java-WebSocket:1.5.3"
//MMKV
implementation 'com.tencent:mmkv-static:1.2.13'
//bugly
implementation 'com.tencent.bugly:crashreport:4.1.9.2'
//腾讯移动推送 TPNS
implementation 'com.tencent.tpns:tpns:1.3.2.0-release'
//百度地图

View File

@@ -19,6 +19,7 @@ import com.fuying.sn.service.main.MainService;
import com.tencent.android.tpush.XGIOperateCallback;
import com.tencent.android.tpush.XGPushConfig;
import com.tencent.android.tpush.XGPushManager;
import com.tencent.bugly.crashreport.CrashReport;
import com.tencent.mmkv.MMKV;
import com.fuying.sn.BuildConfig;
import com.fuying.sn.desktop.RunningAppManager;
@@ -72,11 +73,14 @@ public class BaseApplication extends Application {
String rootDir = MMKV.initialize(this);
Log.i(TAG, "mmkv root: " + rootDir);
JGYUtils.init(this);
CrashReport.initCrashReport(getApplicationContext(), "e5f026c8d5", false);
CrashReport.setDeviceId(this, Utils.getSerial());
LogDBManager.init(this);
ConnectManager.init(this);
Aria.init(this);
Aria.download(this).resumeAllTask();
JGYUtils.init(this);
RunningAppManager.init(this);
TimeControlManager.init(this);
ControlManager.init(this);

View File

@@ -583,6 +583,17 @@ public class RunningAppManager {
boolean havaConfigure = TimeControlManager.getInstance().havaConfigure(pkg);
MachineControl machineControl = TimeControlManager.getInstance().getGlobalMachineControl();
Log.e(TAG, "inControlTime: globalRemainingTime = " + globalRemainingTime);
if (globalRemainingTime <= 0) {
if (machineControl != null) {
if (machineControl.getIs_part() == 0 && machineControl.getIs_quota() == 0) {
return;
}
} else {
ToastUtil.show("今日可使用时间已用完");
return;
}
}
if (havaConfigure) {
AppTimeControl appTimeControl = TimeControlManager.getInstance().getAppTimeControl(pkg);
//全局配置的
@@ -604,19 +615,6 @@ public class RunningAppManager {
} else {
mGlobalUsageTime.remove(pkg);
}
Log.e(TAG, "inControlTime: globalRemainingTime = " + globalRemainingTime);
if (globalRemainingTime <= 0) {
if (machineControl != null) {
if (machineControl.getIs_part() == 0 && machineControl.getIs_quota() == 0) {
return;
}
} else {
ToastUtil.show("今日可使用时间已用完");
return;
}
}
//单个app的
AppUsageTime singleAppUsageTime;
if (mAllAppUsageTime.get(pkg) == null) {
@@ -648,17 +646,6 @@ public class RunningAppManager {
if (machineControl == null) {
return;
}
Log.e(TAG, "inControlTime: globalRemainingTime = " + globalRemainingTime);
if (globalRemainingTime <= 0) {
if (machineControl != null) {
if (machineControl.getIs_part() == 0 && machineControl.getIs_quota() == 0) {
return;
}
} else {
ToastUtil.show("今日可使用时间已用完");
return;
}
}
Log.i(TAG, "reduceAppRemainingTime: " + machineControl.getToday_time());
long remainingTime = machineControl.getToday_time() - time;
if (remainingTime < 0) {

View File

@@ -631,12 +631,12 @@ public class ControlManager {
private void setCanReset(SystemSettings settings) {
int mode = settings.getQch_restore();
if (mode == 1) {
// if (mode == 1) {
// Settings.System.putInt(mResolver, CommonConfig.AOLE_ACTION_RESTORE_FORBID_ON, 0);
// } else {
Settings.System.putInt(mResolver, CommonConfig.AOLE_ACTION_RESTORE_FORBID_ON, 0);
} else {
Settings.System.putInt(mResolver, CommonConfig.AOLE_ACTION_RESTORE_FORBID_ON, 1);
}
closeSettingsApp();
// }
// closeSettingsApp();
Log.e(TAG, "aole_restore_forbid_on:" + mode);
}

View File

@@ -58,12 +58,12 @@ public class DeviceManager {
* 重置,恢复出厂设置
*/
synchronized public static void doMasterClear() {
if (isDebugMode()) {
ToastUtil.show("收到重置设备推送消息");
return;
}
// if (isDebugMode()) {
// ToastUtil.show("收到重置设备推送消息");
// return;
// }
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.N_MR1) {
Intent intent = new Intent("android.intent.action.FACTORY_RESET");
Intent intent = new Intent(Intent.ACTION_FACTORY_RESET);
intent.setPackage("android");
intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
intent.putExtra("android.intent.extra.REASON", "MasterClearConfirm");
@@ -71,8 +71,9 @@ public class DeviceManager {
intent.putExtra("com.android.internal.intent.extra.WIPE_ESIMS", false);
mContext.sendBroadcast(intent);
} else {
Intent intent = new Intent("android.intent.action.MASTER_CLEAR");
Intent intent = new Intent(Intent.ACTION_MASTER_CLEAR);
// intent.setPackage("com.android.settings");
// intent.setPackage("android");
mContext.sendBroadcast(intent);
}
}