version:2.1 MTK

fix:优化获取设备类型逻辑,优化获取设备版本号
update:打包更新
This commit is contained in:
2022-04-25 18:21:25 +08:00
parent 11bad35331
commit 7a1a4fe5a5
24 changed files with 1118 additions and 212 deletions

View File

@@ -115,8 +115,8 @@ public class SysSettingUtils {
// ToastTool.show("qch_call_forbid::"+setting_call+"----setting_phones::"+setting_phones+"----"+qch_white_list_Array+"---"+qch_call_forbid);
Log.e(TAG, "qch_white_list_Array:" + qch_white_list_Array + "---" + qch_white_list_Array);
boolean qch_sdcard_forbid_on = Settings.System.putInt(context.getContentResolver(), "qch_sdcard_forbid_on", state);
Log.e(TAG, "qch_sdcard_forbid_on:" + qch_sdcard_forbid_on);
boolean aole_sdcard_forbid_on = Settings.System.putInt(context.getContentResolver(), "aole_sdcard_forbid_on", state);
Log.e(TAG, "aole_sdcard_forbid_on:" + aole_sdcard_forbid_on);
} catch (Exception e) {
Log.e(TAG, "setPhoneList: " + e.getMessage());
}
@@ -146,8 +146,8 @@ public class SysSettingUtils {
}
//存储卡
int setting_memory = changeNum(jsonObject.getInteger("setting_memory"));
boolean qch_sdcard_forbid_on = Settings.System.putInt(context.getContentResolver(), "qch_sdcard_forbid_on", setting_memory);
Log.e(TAG, "qch_sdcard_forbid_on:" + qch_sdcard_forbid_on);
boolean aole_sdcard_forbid_on = Settings.System.putInt(context.getContentResolver(), "aole_sdcard_forbid_on", setting_memory);
Log.e(TAG, "aole_sdcard_forbid_on:" + aole_sdcard_forbid_on);
} catch (Exception e) {
Log.e(TAG, "setPhoneList: " + e.getMessage());
}
@@ -180,26 +180,36 @@ public class SysSettingUtils {
//Midi模式usb_midi
String setting_usb = jsonObject.getString("setting_usb");
if (!BuildConfig.DEBUG) {
SuperPower mService = (SuperPower) context.getSystemService("mdm");
boolean aole_usb_choose = Settings.System.putString(context.getContentResolver(), "aole_usb_choose", setting_usb);
Log.e("setUSBstate", "aole_usb_choose---------" + aole_usb_choose);
String usbStatus = "";
switch (setting_usb) {
case "usb_charge":
mService.setUSBDataDisabled(true);
usbStatus = "aole_action_usb_usb_charge";
break;
case "usb_mtp":
mService.setUSBDataDisabled(false);
usbStatus = "aole_action_usb_usb_mtp";
break;
case "usb_midi":
usbStatus = "aole_action_usb_usb_midi";
break;
if (JGYUtils.isCubeDevice()) {
SuperPower mService = (SuperPower) context.getSystemService("mdm");
switch (setting_usb) {
case "usb_charge":
mService.setUSBDataDisabled(true);
break;
case "usb_mtp":
mService.setUSBDataDisabled(false);
break;
default:
}
} else {
boolean aole_usb_choose = Settings.System.putString(context.getContentResolver(), "aole_usb_choose", setting_usb);
Log.e("setUSBstate", "aole_usb_choose---------" + aole_usb_choose);
String usbStatus = "aole_action_usb_usb_charge";
switch (setting_usb) {
case "usb_charge":
usbStatus = "aole_action_usb_usb_charge";
break;
case "usb_mtp":
usbStatus = "aole_action_usb_usb_mtp";
break;
case "usb_midi":
usbStatus = "aole_action_usb_usb_midi";
break;
default:
}
Intent usbIntent = new Intent(usbStatus).setPackage("com.android.settings");
context.sendBroadcast(usbIntent);
}
Intent usbIntent = new Intent(usbStatus).setPackage("com.android.settings");
context.sendBroadcast(usbIntent);
}
}
@@ -597,21 +607,21 @@ public class SysSettingUtils {
}
private static void setCanReset(Context context, int state) {
boolean qch_restore_forbid_on = Settings.System.putInt(context.getContentResolver(), "qch_restore_forbid_on", 0);
Log.e(TAG, "qch_restore_forbid_on:" + qch_restore_forbid_on);
boolean aole_restore_forbid_on = Settings.System.putInt(context.getContentResolver(), "aole_restore_forbid_on", 0);
Log.e(TAG, "aole_restore_forbid_on:" + aole_restore_forbid_on);
//默认打开
}
//qch_restore_forbid_on=1禁止恢复出厂设置
//qch_restore_forbid_on=0允许恢复出厂设置
//aole_restore_forbid_on=1禁止恢复出厂设置
//aole_restore_forbid_on=0允许恢复出厂设置
private static void setCanReset(Context context, JSONObject jsonObject) {
int mode = jsonObject.getInteger("qch_restore");
if (mode == 1) {
boolean qch_restore_forbid_on = Settings.System.putInt(context.getContentResolver(), "qch_restore_forbid_on", 0);
Log.e(TAG, "qch_restore_forbid_on:" + qch_restore_forbid_on);
boolean aole_restore_forbid_on = Settings.System.putInt(context.getContentResolver(), "aole_restore_forbid_on", 0);
Log.e(TAG, "aole_restore_forbid_on:" + aole_restore_forbid_on);
} else {
boolean qch_restore_forbid_on = Settings.System.putInt(context.getContentResolver(), "qch_restore_forbid_on", 1);
Log.e(TAG, "qch_restore_forbid_on:" + qch_restore_forbid_on);
boolean aole_restore_forbid_on = Settings.System.putInt(context.getContentResolver(), "aole_restore_forbid_on", 1);
Log.e(TAG, "aole_restore_forbid_on:" + aole_restore_forbid_on);
}
}