增加远程获取sn,台电设备适配

This commit is contained in:
2022-06-13 21:42:42 +08:00
parent 0d324c17a4
commit 7e95fd1181
14 changed files with 256 additions and 197 deletions

View File

@@ -70,8 +70,8 @@ android {
productFlavors {
beta {
flavorDimensions "default"
versionCode 11
versionName "2.0"
versionCode 12
versionName "2.1"
}
official {

View File

@@ -11,6 +11,8 @@ interface IGetInfoInterface {
void basicTypes(int anInt, long aLong, boolean aBoolean, float aFloat,
double aDouble, String aString);
//获取sn
String getSerial();
//获取用户信息
String getUserInfo();
//获取隐藏APP

View File

@@ -132,8 +132,8 @@ public class MainAPresenter implements MainAContact.Presenter {
NetInterfaceManager.getInstance().getForceInstallState(appInfos);
}
} else {
boolean qch_force_app = JGYUtils.putString(mContext.getContentResolver(), "qch_force_app", "invalid");
Log.e(TAG + TAG, "qch_force_app: invalid: " + qch_force_app);
boolean aole_force_app = JGYUtils.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_FORCE_APP, "invalid");
Log.e(TAG + TAG, "aole_force_app: invalid: " + aole_force_app);
}
}

View File

@@ -152,7 +152,7 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView,
}
JPushInterface.init(this);
if (DeviceManager.isDebugMode()) {
JGYUtils.putInt(getContentResolver(), "qch_Developeroptions", 0);
JGYUtils.putInt(getContentResolver(), CommonConfig.AOLE_ACTION_DEVELOPER_OPTIONS, 0);
}
startService();
registerReceiver();

View File

@@ -7,8 +7,6 @@ public class CommonConfig {
public final static String JGY_FIRST_CONNECT = "first_connect";
/*后台的白名单*/
public final static String ONLY_SHORTCUT_LIST = "only_jgy_shortcut_list";
/*底层白名单*/
public final static String QCH_APP_FORBID = "qch_app_forbid";
/*获取设备的标签*/
public final static String DEVICES_TAG = "DEVICES_TAG";
@@ -21,4 +19,66 @@ public class CommonConfig {
public static String userDebugMode = "ZUOYEOS_DEBUG";
public static String EnableDebug = "EnableDebug";
public static String SP_Userinfo_json = "USERINFO_JSON";
/**
* 管控系统指令
*/
/*USB模式-充电*/
public final static String AOLE_ACTION_USB_USB_CHARGE = "aole_action_usb_usb_charge";
/*USB模式-MTP*/
public final static String AOLE_ACTION_USB_USB_MTP = "aole_action_usb_usb_mtp";
/*USB模式-MIDI*/
public final static String AOLE_ACTION_USB_USB_MIDI = "aole_action_usb_usb_midi";
/*应用安装白名单*/
public final static String AOLE_ACTION_APP_FORBID = "aole_app_forbid";
/*强制安装应用,禁止卸载*/
public final static String AOLE_ACTION_FORCE_APP = "aole_force_app";
/*应用ID管控*/
public final static String AOLE_ACTION_APP_FORBID_ID = "aole_app_forbid_id";
/*应用ID管控*/
public final static String AOLE_ACTION_APP_FORBID_ARRAY = "DeselectViewArray";
/*禁止应用滑动*/
public final static String AOLE_ACTION_DISABLE_SLIDE = "aole_disable_slide";
/*开机自启应用*/
public final static String AOLE_ACTION_APP_POWER_ON = "aole_app_power_on";
/*禁止联网应用*/
public final static String AOLE_ACTION_NETWORK_DISALLOW = "aole_network_disallow";
/*允许联网应用*/
public final static String AOLE_ACTION_NETWORK_ALLOW = "aole_network_allow";
/*存储卡管控*/
public final static String AOLE_ACTION_SDCARD_FORBID_ON = "aole_sdcard_forbid_on";
/*开发者选项管控*/
public final static String AOLE_ACTION_DEVELOPER_OPTIONS = "aole_Developeroptions";
/*显示导航栏*/
public final static String AOLE_ACTION_SHOW_NAVIGATION_BAR = "aole_show_NavigationBar";
/*隐藏导航栏*/
public final static String AOLE_ACTION_HIDE_NAVIGATION_BAR = "aole_hide_NavigationBar";
/*显示状态栏*/
public final static String AOLE_ACTION_SHOW_STATUS_BAR = "aole_show_statusBar";
/*隐藏状态栏*/
public final static String AOLE_ACTION_HIDE_STATUS_BAR = "aole_hide_statusBar";
/*热点*/
public final static String AOLE_ACTION_HOTSPOT_FORBID_ON = "aole_hotspot_forbid_on";
/*蓝牙总开关*/
public final static String AOLE_ACTION_BHT_FORBID_ON = "aole_bht_forbid_on";
/*蓝牙传输开关*/
public final static String AOLE_ACTION_BT_FORBID_ON = "aole_bt_forbid_on";
/*蓝牙音频开关*/
public final static String AOLE_ACTION_BHTVIDEO_FORBID_ON = "aole_bhtvideo_forbid_on";
/*电话白名单开关*/
public final static String AOLE_ACTION_WHITE_LIST_ON = "aole_white_list_on";
/*电话白名单列表*/
public final static String AOLE_ACTION_WHITE_LIST_ARRAY = "aole_white_list_Array";
/*恢复出厂设置开关*/
public final static String AOLE_ACTION_RESTORE_FORBID_ON = "aole_restore_forbid_on";
/*WiFi白名单*/
public final static String AOLE_ACTION_AOLE_SSID_WHITE_LIST = "aole_ssid_whiteList";
}

View File

@@ -13,6 +13,7 @@ import android.util.Log;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.uiui.sn.bean.SystemSettings;
import com.uiui.sn.config.CommonConfig;
import com.uiui.sn.utils.ApkUtils;
import com.uiui.sn.utils.JGYUtils;
import com.uiui.sn.utils.SPUtils;
@@ -130,16 +131,16 @@ public class ControlManager {
String usbStatus = "";
switch (setting_usb) {
case "usb_charge":
usbStatus = "qch_action_usb_usb_charge";
usbStatus = CommonConfig.AOLE_ACTION_USB_USB_CHARGE;
break;
case "usb_mtp":
usbStatus = "qch_action_usb_usb_mtp";
usbStatus = CommonConfig.AOLE_ACTION_USB_USB_MTP;
break;
// case "usb_midi":
// usbStatus = "qch_action_usb_usb_midi";
// usbStatus = CommonConfig.AOLE_ACTION_USB_USB_MIDI;
// break;
default:
usbStatus = "qch_action_usb_usb_charge";
usbStatus = CommonConfig.AOLE_ACTION_USB_USB_CHARGE;
break;
}
Intent usbIntent = new Intent(usbStatus).setPackage("com.android.settings");
@@ -164,7 +165,7 @@ public class ControlManager {
try {
boolean qch_usb_choose = Settings.System.putString(mResolver, "qch_usb_choose", "usb_charge");
Log.e(TAG, "qch_usb_choose:" + qch_usb_choose);
String usbStatus = "qch_action_usb_usb_charge";
String usbStatus = CommonConfig.AOLE_ACTION_USB_USB_CHARGE;
Intent usbIntent = new Intent(usbStatus).setPackage("com.android.settings");
mContext.sendBroadcast(usbIntent);
} catch (Exception e) {
@@ -180,16 +181,16 @@ public class ControlManager {
Log.e("SystemSetting", "qch_call_forbid: " + setting_call);
int setting_phone = changeNum(settings.getSetting_phone());
boolean qch_white_list_on = JGYUtils.putInt(mResolver, "qch_white_list_on", setting_phone);
Log.e("SystemSetting", "qch_white_list_on: " + setting_phone);
boolean aole_white_list_on = JGYUtils.putInt(mResolver, CommonConfig.AOLE_ACTION_WHITE_LIST_ON, setting_phone);
Log.e("SystemSetting", "aole_white_list_on: " + setting_phone);
String setting_phones = settings.getSetting_phones();
boolean qch_white_list_Array = JGYUtils.putString(mResolver, "qch_white_list_Array", setting_phones);
Log.e("SystemSetting", "qch_white_list_Array: " + qch_white_list_Array + "=" + setting_phones);
boolean aole_white_list_Array = JGYUtils.putString(mResolver, CommonConfig.AOLE_ACTION_WHITE_LIST_ARRAY, setting_phones);
Log.e("SystemSetting", "aole_white_list_Array: " + aole_white_list_Array + "=" + setting_phones);
int setting_memory = changeNum(settings.getSetting_memory());
boolean qch_sdcard_forbid_on = JGYUtils.putInt(mResolver, "qch_sdcard_forbid_on", setting_memory);
Log.e("SystemSetting", "qch_sdcard_forbid_on: " + setting_memory);
boolean aole_sdcard_forbid_on = JGYUtils.putInt(mResolver, CommonConfig.AOLE_ACTION_SDCARD_FORBID_ON, setting_memory);
Log.e("SystemSetting", "aole_sdcard_forbid_on: " + setting_memory);
}
private void setPhoneList(int state) {
@@ -198,15 +199,15 @@ public class ControlManager {
boolean qch_call_forbid = Settings.System.putInt(mResolver, "qch_call_forbid", state);
Log.e(TAG, "qch_call_forbid:" + qch_call_forbid);
boolean qch_white_list_on = Settings.System.putInt(mResolver, "qch_white_list_on", state);
Log.e(TAG, "qch_white_list_on:" + qch_white_list_on);
boolean aole_white_list_on = Settings.System.putInt(mResolver, CommonConfig.AOLE_ACTION_WHITE_LIST_ON, state);
Log.e(TAG, "aole_white_list_on:" + aole_white_list_on);
boolean qch_white_list_Array = Settings.System.putString(mResolver, "qch_white_list_Array", "");
// 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 aole_white_list_Array = Settings.System.putString(mResolver, CommonConfig.AOLE_ACTION_WHITE_LIST_ARRAY, "");
// ToastTool.show("qch_call_forbid::"+setting_call+"----setting_phones::"+setting_phones+"----"+aole_white_list_Array+"---"+qch_call_forbid);
Log.e(TAG, "aole_white_list_Array:" + aole_white_list_Array + "---" + aole_white_list_Array);
boolean qch_sdcard_forbid_on = Settings.System.putInt(mResolver, "qch_sdcard_forbid_on", state);
Log.e(TAG, "qch_sdcard_forbid_on:" + qch_sdcard_forbid_on);
boolean aole_sdcard_forbid_on = Settings.System.putInt(mResolver, CommonConfig.AOLE_ACTION_SDCARD_FORBID_ON, state);
Log.e(TAG, "aole_sdcard_forbid_on:" + aole_sdcard_forbid_on);
} catch (Exception e) {
Log.e(TAG, "setPhoneList: " + e.getMessage());
}
@@ -221,11 +222,11 @@ public class ControlManager {
//蓝牙音频开关
int setting_bluetooth = changeNum(settings.getSetting_bluetooth());
//蓝牙传输开关
boolean qch_bht_forbid_on = JGYUtils.putInt(mResolver, "qch_bht_forbid_on", setting_bht);
boolean aole_bht_forbid_on = JGYUtils.putInt(mResolver, CommonConfig.AOLE_ACTION_BHT_FORBID_ON, setting_bht);
//写入系统数据库
Log.e("SystemSetting", "qch_bht_forbid_on:" + qch_bht_forbid_on);
Log.e("SystemSetting", "aole_bht_forbid_on:" + aole_bht_forbid_on);
BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
if (qch_bht_forbid_on) {
if (aole_bht_forbid_on) {
//成功
if (null == mBluetoothAdapter) {
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
@@ -237,14 +238,14 @@ public class ControlManager {
if (setting_bhtvideo == 0) {
if (null != setting_context && !"".equals(setting_context) && !" ".equals(setting_context) && !"null".equals(setting_context)) {
Log.e("SystemSetting", "setting_context:" + setting_context);
JGYUtils.putString(mResolver, "qch_bhtvideo_forbid_on", setting_context);
JGYUtils.putString(mResolver, CommonConfig.AOLE_ACTION_BHTVIDEO_FORBID_ON, setting_context);
} else {
JGYUtils.putString(mResolver, "qch_bhtvideo_forbid_on", "Empty");
JGYUtils.putString(mResolver, CommonConfig.AOLE_ACTION_BHTVIDEO_FORBID_ON, "Empty");
}
} else if (setting_bhtvideo == 1) {
JGYUtils.putString(mResolver, "qch_bhtvideo_forbid_on", "Empty");
JGYUtils.putString(mResolver, CommonConfig.AOLE_ACTION_BHTVIDEO_FORBID_ON, "Empty");
}
JGYUtils.putInt(mResolver, "qch_bt_forbid_on", setting_bluetooth);
JGYUtils.putInt(mResolver, CommonConfig.AOLE_ACTION_BT_FORBID_ON, setting_bluetooth);
} else {
mBluetoothAdapter.disable();
//设置关闭时关闭蓝牙
@@ -257,19 +258,19 @@ public class ControlManager {
private void setBluetooth(int state) {
try {
boolean qch_bht_forbid_on = Settings.System.putInt(mResolver, "qch_bht_forbid_on", state);
boolean aole_bht_forbid_on = Settings.System.putInt(mResolver, CommonConfig.AOLE_ACTION_BHT_FORBID_ON, state);
//写入系统数据库
Log.e(TAG, "qch_bht_forbid_on:" + qch_bht_forbid_on);
Log.e(TAG, "aole_bht_forbid_on:" + aole_bht_forbid_on);
BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
if (qch_bht_forbid_on) {
if (aole_bht_forbid_on) {
//成功
if (null == mBluetoothAdapter) {
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
//获取默认蓝牙适配器
}
//蓝牙总开关开启
Settings.System.putString(mResolver, "qch_bhtvideo_forbid_on", "Empty");
Settings.System.putInt(mResolver, "qch_bt_forbid_on", state);
Settings.System.putString(mResolver, CommonConfig.AOLE_ACTION_BHTVIDEO_FORBID_ON, "Empty");
Settings.System.putInt(mResolver, CommonConfig.AOLE_ACTION_BT_FORBID_ON, state);
mBluetoothAdapter.disable();
//设置关闭时关闭蓝牙
}
@@ -287,9 +288,9 @@ public class ControlManager {
intent.setPackage("com.android.settings");
mContext.sendStickyBroadcast(intent);
}
boolean qch_hotspot_forbid_on = JGYUtils.putInt(mResolver, "qch_hotspot_forbid_on", setting_hotspot);//写入系统数据库
Log.e("SystemSetting", "qch_hotspot_forbid_on:" + setting_hotspot);
Log.e("SystemSetting", "qch_hotspot_forbid_on:" + qch_hotspot_forbid_on);
boolean aole_hotspot_forbid_on = JGYUtils.putInt(mResolver, CommonConfig.AOLE_ACTION_HOTSPOT_FORBID_ON, setting_hotspot);//写入系统数据库
Log.e("SystemSetting", "aole_hotspot_forbid_on:" + setting_hotspot);
Log.e("SystemSetting", "aole_hotspot_forbid_on:" + aole_hotspot_forbid_on);
} catch (Exception e) {
Log.e(TAG, "setHotspot: " + e.getMessage());
}
@@ -301,8 +302,8 @@ public class ControlManager {
intent.setAction("qch_hotspot_close");
intent.setPackage("com.android.settings");
mContext.sendStickyBroadcast(intent);
boolean qch_hotspot_forbid_on = Settings.System.putInt(mResolver, "qch_hotspot_forbid_on", state);
Log.e(TAG, "qch_hotspot_forbid_on:" + qch_hotspot_forbid_on);
boolean aole_hotspot_forbid_on = Settings.System.putInt(mResolver, CommonConfig.AOLE_ACTION_HOTSPOT_FORBID_ON, state);
Log.e(TAG, "aole_hotspot_forbid_on:" + aole_hotspot_forbid_on);
} catch (Exception e) {
Log.e(TAG, "setHotspot: " + e.getMessage());
}
@@ -311,36 +312,37 @@ public class ControlManager {
private void setBar(SystemSettings settings) {
//系统导航条显示开关
int setting_navigation = changeNum(settings.getSetting_navigation());
boolean qch_hide_navigationBar = JGYUtils.putInt(mResolver, "qch_hide_NavigationBar", setting_navigation);
Log.e("SystemSetting", "qch_hide_navigationBar:" + qch_hide_navigationBar);
boolean aole_hide_NavigationBar = JGYUtils.putInt(mResolver, CommonConfig.AOLE_ACTION_HIDE_NAVIGATION_BAR, setting_navigation);
Log.e("SystemSetting", "aole_hide_NavigationBar:" + aole_hide_NavigationBar);
String navigationStatus = "";
switch (setting_navigation) {
case 0:
navigationStatus = "qch_show_NavigationBar";
navigationStatus = CommonConfig.AOLE_ACTION_SHOW_NAVIGATION_BAR;
break;
case 1:
navigationStatus = "qch_hide_NavigationBar";
navigationStatus = CommonConfig.AOLE_ACTION_HIDE_NAVIGATION_BAR;
break;
default:
}
Intent navIntent = new Intent(navigationStatus).setPackage("com.android.systemui");
mContext.sendBroadcast(navIntent);
//状态栏显示开关
int setting_statusbar = changeNum(settings.getSetting_statusbar());
int oldNum = JGYUtils.getInt(mResolver, "qch_hide_statusBar", 0);
int oldNum = JGYUtils.getInt(mResolver, CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR, 0);
if (oldNum != setting_statusbar) {
boolean qch_hide_statusBar = JGYUtils.putInt(mResolver, "qch_hide_statusBar", setting_statusbar);
Log.e("SystemSetting", "qch_hide_statusBar:" + qch_hide_statusBar);
boolean aole_hide_statusBar = JGYUtils.putInt(mResolver, CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR, setting_statusbar);
Log.e("SystemSetting", "aole_hide_statusBar:" + aole_hide_statusBar);
String statusbarStatus = "";
switch (setting_statusbar) {
case 0:
statusbarStatus = "qch_show_statusBar";
statusbarStatus = CommonConfig.AOLE_ACTION_SHOW_STATUS_BAR;
break;
case 1:
statusbarStatus = "qch_hide_statusBar";
statusbarStatus = CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR;
break;
default:
}
Intent statusIntent = new Intent(statusbarStatus).setPackage("com.android.systemui");
mContext.sendBroadcast(statusIntent);
@@ -558,16 +560,16 @@ public class ControlManager {
private void setCanReset(SystemSettings settings) {
int mode = settings.getQch_restore();
if (mode == 1) {
Settings.System.putInt(mResolver, "qch_restore_forbid_on", 0);
Settings.System.putInt(mResolver, CommonConfig.AOLE_ACTION_RESTORE_FORBID_ON, 0);
} else {
Settings.System.putInt(mResolver, "qch_restore_forbid_on", 1);
Settings.System.putInt(mResolver, CommonConfig.AOLE_ACTION_RESTORE_FORBID_ON, 1);
}
Log.e(TAG, "qch_restore_forbid_on:" + mode);
Log.e(TAG, "aole_restore_forbid_on:" + mode);
}
private void setCanReset(int state) {
boolean qch_restore_forbid_on = Settings.System.putInt(mResolver, "qch_restore_forbid_on", 0);
Log.e(TAG, "qch_restore_forbid_on:" + qch_restore_forbid_on);
boolean aole_restore_forbid_on = Settings.System.putInt(mResolver, CommonConfig.AOLE_ACTION_RESTORE_FORBID_ON, 0);
Log.e(TAG, "aole_restore_forbid_on:" + aole_restore_forbid_on);
//默认打开
}
@@ -585,7 +587,7 @@ public class ControlManager {
int dev_mode = changeNum(jsonObject.getIntValue("dev_mode"));
Log.e(TAG, "getDeveloper: " + dev_mode);
if (!DeviceManager.isDebugMode()) {
JGYUtils.putInt(mResolver, "qch_Developeroptions", dev_mode);
JGYUtils.putInt(mResolver, CommonConfig.AOLE_ACTION_DEVELOPER_OPTIONS, dev_mode);
if (dev_mode == 1) {
Intent intent = new Intent();
intent.setAction("qch_developeroptions_close");
@@ -603,7 +605,7 @@ public class ControlManager {
public void setDeveloperOptions(int state) {
Log.e(TAG, "getDeveloper: " + state);
if (!DeviceManager.isDebugMode()) {
Settings.System.putInt(mResolver, "qch_Developeroptions", state);
Settings.System.putInt(mResolver, CommonConfig.AOLE_ACTION_DEVELOPER_OPTIONS, state);
if (state == 1) {
Intent intent = new Intent();
intent.setAction("qch_developeroptions_close");
@@ -641,21 +643,21 @@ public class ControlManager {
Log.e("SystemSetting", "setting_usb:" + setting_usb);
String usbStatus = "";
if (TextUtils.isEmpty(setting_usb)) {
usbStatus = "qch_action_usb_usb_charge";
usbStatus = CommonConfig.AOLE_ACTION_USB_USB_CHARGE;
} else {
if (!DeviceManager.isDebugMode()) {
switch (setting_usb) {
case "usb_charge":
usbStatus = "qch_action_usb_usb_charge";
usbStatus = CommonConfig.AOLE_ACTION_USB_USB_CHARGE;
break;
case "usb_mtp":
usbStatus = "qch_action_usb_usb_mtp";
usbStatus = CommonConfig.AOLE_ACTION_USB_USB_MTP;
break;
// case "usb_midi":
// usbStatus = "qch_action_usb_usb_midi";
// usbStatus = CommonConfig.AOLE_ACTION_USB_USB_MIDI;
// break;
default:
usbStatus = "qch_action_usb_usb_charge";
usbStatus = CommonConfig.AOLE_ACTION_USB_USB_CHARGE;
break;
}
}

View File

@@ -15,9 +15,6 @@ import android.util.Log;
import androidx.core.content.ContextCompat;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.bumptech.glide.Glide;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
@@ -28,7 +25,6 @@ import com.tencent.mmkv.MMKV;
import com.trello.rxlifecycle4.RxLifecycle;
import com.trello.rxlifecycle4.android.ActivityEvent;
import com.uiui.sn.BuildConfig;
import com.uiui.sn.R;
import com.uiui.sn.bean.AppInfo;
import com.uiui.sn.bean.AppStart;
import com.uiui.sn.bean.AppUploadInfo;
@@ -104,7 +100,6 @@ import java.util.stream.Collectors;
import cn.jpush.android.api.JPushInterface;
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
import io.reactivex.rxjava3.annotations.NonNull;
import io.reactivex.rxjava3.core.Flowable;
import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.core.ObservableEmitter;
import io.reactivex.rxjava3.core.ObservableOnSubscribe;
@@ -112,7 +107,6 @@ import io.reactivex.rxjava3.core.ObservableSource;
import io.reactivex.rxjava3.core.Observer;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.functions.BiFunction;
import io.reactivex.rxjava3.functions.Consumer;
import io.reactivex.rxjava3.functions.Function;
import io.reactivex.rxjava3.functions.Function3;
import io.reactivex.rxjava3.schedulers.Schedulers;
@@ -1408,7 +1402,7 @@ public class NetInterfaceManager {
}
if (!TextUtils.isEmpty(auto_allow) && auto_allow.endsWith(",")) {
auto_allow = auto_allow.substring(0, auto_allow.length() - 1);
boolean qch_app_power_on = JGYUtils.putString(crv, "qch_app_power_on", auto_allow);
boolean aole_app_power_on = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_APP_POWER_ON, auto_allow);
}
if (!TextUtils.isEmpty(auto_not) && auto_not.endsWith(",")) {
auto_not = auto_not.substring(0, auto_not.length() - 1);
@@ -1436,12 +1430,12 @@ public class NetInterfaceManager {
}
if (!TextUtils.isEmpty(network_allow) && network_allow.endsWith(",")) {
network_allow = network_allow.substring(0, network_allow.length() - 1);
JGYUtils.putString(crv, "qch_jgy_network_allow", network_allow);
JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, network_allow);
Log.e(TAG, "not::" + network_allow);
}
if (!TextUtils.isEmpty(network_not) && network_not.endsWith(",")) {
network_not = network_not.substring(0, network_not.length() - 1);
JGYUtils.putString(crv, "qch_jgy_network_disallow", network_not);
JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, network_not);
Log.e(TAG, "ban::" + network_not);
}
}
@@ -1494,11 +1488,11 @@ public class NetInterfaceManager {
}
if (!TextUtils.isEmpty(slide_not) && slide_not.endsWith(",")) {
slide_not = slide_not.substring(0, slide_not.length() - 1);
boolean writeSucceed = JGYUtils.putString(crv, "qch_disable_slide", slide_not);
Log.e(TAG, "qch_disable_slide=" + writeSucceed + ":" + slide_not);
boolean writeSucceed = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_DISABLE_SLIDE, slide_not);
Log.e(TAG, "aole_disable_slide=" + writeSucceed + ":" + slide_not);
} else {
boolean writeSucceed = JGYUtils.putString(crv, "qch_disable_slide", "Invalid");
Log.e(TAG, "qch_disable_slide ok=" + writeSucceed + ":" + slide_allow);
boolean writeSucceed = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_DISABLE_SLIDE, "Invalid");
Log.e(TAG, "aole_disable_slide ok=" + writeSucceed + ":" + slide_allow);
}
} else {
@@ -1587,20 +1581,20 @@ public class NetInterfaceManager {
Log.e(TAG, "setAPPIDJump: " + packages);
Log.e(TAG, "setAPPIDJump: " + ids);
if (TextUtils.isEmpty(ids)) {
JGYUtils.putString(crv, "qch_app_forbid_id", "Invalid");
JGYUtils.putString(crv, "DeselectViewArray", "Invalid");
JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID_ID, "Invalid");
JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID_ARRAY, "Invalid");
} else {
JGYUtils.putString(crv, "qch_app_forbid_id", packages);
JGYUtils.putString(crv, "DeselectViewArray", ids);
JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID_ID, packages);
JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID_ARRAY, ids);
}
}
}
public void setInvalid() {
boolean qch_app_power_on = JGYUtils.putString(crv, "qch_app_power_on", "Invalid");
boolean qch_jgy_network_allow = JGYUtils.putString(crv, "qch_jgy_network_allow", "Invalid");
boolean qch_jgy_network_disallow = JGYUtils.putString(crv, "qch_jgy_network_disallow", "Invalid");
boolean writeSucceed = JGYUtils.putString(crv, "qch_disable_slide", "Invalid");
boolean aole_app_power_on = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_APP_POWER_ON, "Invalid");
boolean aole_network_allow = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, "Invalid");
boolean aole_network_disallow = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, "Invalid");
boolean writeSucceed = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_DISABLE_SLIDE, "Invalid");
}
private void sendAllweb() {
@@ -1744,8 +1738,8 @@ public class NetInterfaceManager {
}
// JGYUtils.getInstance().deleteOtherApp();
} else {
boolean qch_force_app = JGYUtils.putString(crv, "qch_force_app", "invalid");
Log.e(TAG, "qch_force_app:" + qch_force_app + ":" + "invalid");
boolean aole_force_app = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_FORCE_APP, "invalid");
Log.e(TAG, "aole_force_app:" + aole_force_app + ":" + "invalid");
}
}
@@ -1792,10 +1786,10 @@ public class NetInterfaceManager {
}
String packageList = String.join(",", forceAppSet);
Log.e(TAG, "getForceInstallState: " + packageList);
boolean qch_force_app = JGYUtils.putString(crv, "qch_force_app", packageList);
boolean aole_force_app = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_FORCE_APP, packageList);
} else {
boolean qch_force_app = JGYUtils.putString(crv, "qch_force_app", "invalid");
Log.e(TAG, "getForceInstallState:" + qch_force_app + ":" + "invalid");
boolean aole_force_app = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_FORCE_APP, "invalid");
Log.e(TAG, "getForceInstallState:" + aole_force_app + ":" + "invalid");
}
}
@@ -1937,8 +1931,8 @@ public class NetInterfaceManager {
JGYUtils.getInstance().writeDeselectIDtoSystem(ids, packages);
} else {
Log.e("getAppInside", "onNext: " + baseResponse.msg);
JGYUtils.putString(crv, "qch_app_forbid_id", " ");
JGYUtils.putString(crv, "DeselectViewArray", " ");
JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID_ID, " ");
JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID_ARRAY, " ");
}
}

View File

@@ -577,16 +577,16 @@ public class MyJPushReceiver extends BroadcastReceiver {
// String usbStatus = "";
// switch (setting_usb) {
// case "usb_charge":
// usbStatus = "qch_action_usb_usb_charge";
// usbStatus = AOLE_ACTION_USB_USB_CHARGE;
// break;
// case "usb_mtp":
// usbStatus = "qch_action_usb_usb_mtp";
// usbStatus = AOLE_ACTION_USB_USB_MTP;
// break;
//// case "usb_midi":
//// usbStatus = "qch_action_usb_usb_midi";
//// usbStatus = CommonConfig.AOLE_ACTION_USB_USB_MIDI;
//// break;
// default:
// usbStatus = "qch_action_usb_usb_charge";
// usbStatus = AOLE_ACTION_USB_USB_CHARGE;
// break;
// }
// Intent usbIntent = new Intent(usbStatus).setPackage("com.android.settings");
@@ -600,9 +600,9 @@ public class MyJPushReceiver extends BroadcastReceiver {
if (!TextUtils.isEmpty(jsonString)) {
JSONObject extra = JSON.parseObject(jsonString);
int is_tf = extra.getIntValue("setting_memory");
boolean qch_sdcard_forbid_on = JGYUtils.putInt(context.getContentResolver(), "qch_sdcard_forbid_on", changeNum(is_tf));
if (qch_sdcard_forbid_on) {
Log.e("setTfcardState:", JGYUtils.getString(context.getContentResolver(), "qch_sdcard_forbid_on"));
boolean aole_sdcard_forbid_on = JGYUtils.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_SDCARD_FORBID_ON, changeNum(is_tf));
if (aole_sdcard_forbid_on) {
Log.e("setTfcardState:", JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_SDCARD_FORBID_ON));
} else {
ToastUtil.debugShow("setTfcardState failed,state:" + is_tf);
}
@@ -620,21 +620,21 @@ public class MyJPushReceiver extends BroadcastReceiver {
}
JSONObject extra = JSON.parseObject(jsonString);
int is_bluetooth = changeNum(extra.getIntValue("setting_bluetooth"));
Log.e(TAG, "qch_bht_forbid_on:" + is_bluetooth);
Log.e(TAG, "aole_bht_forbid_on:" + is_bluetooth);
try {
//写入系统数据库
boolean qch_bht_forbid_on = JGYUtils.putInt(context.getContentResolver(), "qch_bht_forbid_on", is_bluetooth);
Log.e(TAG, "qch_bht_forbid_on:" + qch_bht_forbid_on);
boolean aole_bht_forbid_on = JGYUtils.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_BHT_FORBID_ON, is_bluetooth);
Log.e(TAG, "aole_bht_forbid_on:" + aole_bht_forbid_on);
BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
if (qch_bht_forbid_on) {
if (aole_bht_forbid_on) {
//成功
if (null == mBluetoothAdapter) {
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
//获取默认蓝牙适配器
}
//蓝牙总开关开启
JGYUtils.putString(context.getContentResolver(), "qch_bhtvideo_forbid_on", "Empty");
JGYUtils.putInt(context.getContentResolver(), "qch_bt_forbid_on", is_bluetooth);
JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_BHTVIDEO_FORBID_ON, "Empty");
JGYUtils.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_BT_FORBID_ON, is_bluetooth);
//设置关闭时关闭蓝牙
mBluetoothAdapter.disable();
}
@@ -652,18 +652,18 @@ public class MyJPushReceiver extends BroadcastReceiver {
String package0 = extra.getString("package0");
String package1 = extra.getString("package1");
if (package0.length() != 0) {
boolean qch_jgy_network_allow = JGYUtils.putString(context.getContentResolver(), "qch_jgy_network_allow", package0);
Log.e("fht", "qch_jgy_network_allow::" + qch_jgy_network_allow + ":" + JGYUtils.getString(context.getContentResolver(), "qch_jgy_network_allow"));
boolean aole_network_allow = JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_ALLOW, package0);
Log.e("fht", "aole_network_allow::" + aole_network_allow + ":" + JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_ALLOW));
} else {
boolean qch_jgy_network_allow = JGYUtils.putString(context.getContentResolver(), "qch_jgy_network_allow", "invalid");
Log.e("fht", "qch_jgy_network_allow::" + qch_jgy_network_allow + ":" + JGYUtils.getString(context.getContentResolver(), "qch_jgy_network_allow"));
boolean aole_network_allow = JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_ALLOW, "invalid");
Log.e("fht", "aole_network_allow::" + aole_network_allow + ":" + JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_ALLOW));
}
if (package1.length() != 0) {
boolean qch_jgy_network_disallow = JGYUtils.putString(context.getContentResolver(), "qch_jgy_network_disallow", package1);
Log.e("fht", "qch_jgy_network_disallow::" + qch_jgy_network_disallow + ":" + JGYUtils.getString(context.getContentResolver(), "qch_jgy_network_disallow"));
boolean aole_network_disallow = JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, package1);
Log.e("fht", "aole_network_disallow::" + aole_network_disallow + ":" + JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_DISALLOW));
} else {
boolean qch_jgy_network_disallow = JGYUtils.putString(context.getContentResolver(), "qch_jgy_network_disallow", "invalid");
Log.e("fht", "qch_jgy_network_disallow::" + qch_jgy_network_disallow + ":" + JGYUtils.getString(context.getContentResolver(), "qch_jgy_network_disallow"));
boolean aole_network_disallow = JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, "invalid");
Log.e("fht", "aole_network_disallow::" + aole_network_disallow + ":" + JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_DISALLOW));
}
} else {
ToastUtil.debugShow("setAppNetworkstate jsonString is NULL");
@@ -873,7 +873,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
JSONObject jsonObject = JSON.parseObject(jsonString);
String is_upgrade = jsonObject.getString("is_upgrade");
String packageName = jsonObject.getString("package");
String nowApplist = JGYUtils.getString(context.getContentResolver(), CommonConfig.QCH_APP_FORBID);
String nowApplist = JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID);
List<String> applist = new ArrayList<>(Arrays.asList(nowApplist.split(",")));
if ("0".equals(is_upgrade)) {
if (applist.contains(packageName)) {
@@ -886,8 +886,8 @@ public class MyJPushReceiver extends BroadcastReceiver {
applist.add(packageName);
}
}
JGYUtils.putString(context.getContentResolver(), CommonConfig.QCH_APP_FORBID, String.join(",", applist));
Log.e("setAppUpdate", JGYUtils.getString(context.getContentResolver(), CommonConfig.QCH_APP_FORBID));
JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID, String.join(",", applist));
Log.e("setAppUpdate", JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID));
}
private void setLock_screen(Context context, String jsonString) {
@@ -1048,9 +1048,9 @@ public class MyJPushReceiver extends BroadcastReceiver {
intent.setPackage("com.android.settings");
context.sendStickyBroadcast(intent);
}
boolean qch_hotspot_forbid_on = JGYUtils.putInt(context.getContentResolver(), "qch_hotspot_forbid_on", setting_hotspot);
Log.e("SystemSetting", "qch_hotspot_forbid_on---------" + setting_hotspot);
Log.e("SystemSetting", "qch_hotspot_forbid_on---------" + qch_hotspot_forbid_on);
boolean aole_hotspot_forbid_on = JGYUtils.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_HOTSPOT_FORBID_ON, setting_hotspot);
Log.e("SystemSetting", "aole_hotspot_forbid_on---------" + setting_hotspot);
Log.e("SystemSetting", "aole_hotspot_forbid_on---------" + aole_hotspot_forbid_on);
} catch (Exception e) {
Log.e(TAG, "setHotspot: " + e.getMessage());
}
@@ -1059,8 +1059,8 @@ public class MyJPushReceiver extends BroadcastReceiver {
private void setRestore(Context context, String jsonString) {
JSONObject jsonObject = JSON.parseObject(jsonString);
int mode = jsonObject.getIntValue("qch_restore");
boolean qch_restore_forbid_on = JGYUtils.putInt(context.getContentResolver(), "qch_restore_forbid_on", changeNum(mode));
Log.e(TAG, "qch_restore_forbid_on:" + qch_restore_forbid_on);
boolean aole_restore_forbid_on = JGYUtils.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_RESTORE_FORBID_ON, changeNum(mode));
Log.e(TAG, "aole_restore_forbid_on:" + aole_restore_forbid_on);
}
private void setBrowserInput(Context context, String jsonString) {
@@ -1074,7 +1074,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
int dev_mode = changeNum(jsonObject.getIntValue("dev_mode"));
Log.e(TAG, "getDeveloper: " + dev_mode);
if (!DeviceManager.isDebugMode()) {
JGYUtils.putInt(context.getContentResolver(), "qch_Developeroptions", dev_mode);
JGYUtils.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_DEVELOPER_OPTIONS, dev_mode);
if (dev_mode == 1) {
Intent intent = new Intent();
intent.setAction("qch_developeroptions_close");

View File

@@ -46,6 +46,11 @@ public class RemoteService extends Service {
}
@Override
public String getSerial() throws RemoteException {
return Utils.getSerial();
}
@Override
public String getUserInfo() throws RemoteException {
if (MainService.getPresenter() != null) {

View File

@@ -189,8 +189,8 @@ public class MainSPresenter implements MainSContact.Presenter {
JGYUtils.getInstance().writeDeselectIDtoSystem(ids, packages);
} else {
Log.e("getAppInside", "onNext: " + baseResponse.msg);
JGYUtils.putString(mContext.getContentResolver(), "qch_app_forbid_id", " ");
JGYUtils.putString(mContext.getContentResolver(), "DeselectViewArray", " ");
JGYUtils.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID_ID, " ");
JGYUtils.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID_ARRAY, " ");
}
}
@@ -229,8 +229,8 @@ public class MainSPresenter implements MainSContact.Presenter {
NetInterfaceManager.getInstance().getForceInstallState(appInfos);
}
} else {
boolean qch_force_app = JGYUtils.putString(mContext.getContentResolver(), "qch_force_app", "invalid");
Log.e("getForceInstall", "qch_force_app: invalid: " + qch_force_app);
boolean aole_force_app = JGYUtils.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_FORCE_APP, "invalid");
Log.e("getForceInstall", "aole_force_app: invalid: " + aole_force_app);
}
}

View File

@@ -816,16 +816,16 @@ public class MessageReceiver extends XGPushBaseReceiver {
// String usbStatus = "";
// switch (setting_usb) {
// case "usb_charge":
// usbStatus = "qch_action_usb_usb_charge";
// usbStatus = AOLE_ACTION_USB_USB_CHARGE;
// break;
// case "usb_mtp":
// usbStatus = "qch_action_usb_usb_mtp";
// usbStatus = AOLE_ACTION_USB_USB_MTP;
// break;
//// case "usb_midi":
//// usbStatus = "qch_action_usb_usb_midi";
//// usbStatus = CommonConfig.AOLE_ACTION_USB_USB_MIDI;
//// break;
// default:
// usbStatus = "qch_action_usb_usb_charge";
// usbStatus = AOLE_ACTION_USB_USB_CHARGE;
// break;
// }
// Intent usbIntent = new Intent(usbStatus).setPackage("com.android.settings");
@@ -839,9 +839,9 @@ public class MessageReceiver extends XGPushBaseReceiver {
if (!TextUtils.isEmpty(jsonString)) {
JSONObject extra = JSON.parseObject(jsonString);
int is_tf = extra.getIntValue("setting_memory");
boolean qch_sdcard_forbid_on = JGYUtils.putInt(context.getContentResolver(), "qch_sdcard_forbid_on", changeNum(is_tf));
if (qch_sdcard_forbid_on) {
Log.e("setTfcardState:", JGYUtils.getString(context.getContentResolver(), "qch_sdcard_forbid_on"));
boolean aole_sdcard_forbid_on = JGYUtils.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_SDCARD_FORBID_ON, changeNum(is_tf));
if (aole_sdcard_forbid_on) {
Log.e("setTfcardState:", JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_SDCARD_FORBID_ON));
} else {
ToastUtil.debugShow("setTfcardState failed,state:" + is_tf);
}
@@ -859,21 +859,21 @@ public class MessageReceiver extends XGPushBaseReceiver {
}
JSONObject extra = JSON.parseObject(jsonString);
int is_bluetooth = changeNum(extra.getIntValue("setting_bluetooth"));
Log.e(TAG, "qch_bht_forbid_on:" + is_bluetooth);
Log.e(TAG, "aole_bht_forbid_on: " + is_bluetooth);
try {
//写入系统数据库
boolean qch_bht_forbid_on = JGYUtils.putInt(context.getContentResolver(), "qch_bht_forbid_on", is_bluetooth);
Log.e(TAG, "qch_bht_forbid_on:" + qch_bht_forbid_on);
boolean aole_bht_forbid_on = JGYUtils.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_BHT_FORBID_ON, is_bluetooth);
Log.e(TAG, "aole_bht_forbid_on: " + aole_bht_forbid_on);
BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
if (qch_bht_forbid_on) {
if (aole_bht_forbid_on) {
//成功
if (null == mBluetoothAdapter) {
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
//获取默认蓝牙适配器
}
//蓝牙总开关开启
JGYUtils.putString(context.getContentResolver(), "qch_bhtvideo_forbid_on", "Empty");
JGYUtils.putInt(context.getContentResolver(), "qch_bt_forbid_on", is_bluetooth);
JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_BHTVIDEO_FORBID_ON, "Empty");
JGYUtils.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_BT_FORBID_ON, is_bluetooth);
//设置关闭时关闭蓝牙
mBluetoothAdapter.disable();
}
@@ -891,18 +891,18 @@ public class MessageReceiver extends XGPushBaseReceiver {
String package0 = extra.getString("package0");
String package1 = extra.getString("package1");
if (package0.length() != 0) {
boolean qch_jgy_network_allow = JGYUtils.putString(context.getContentResolver(), "qch_jgy_network_allow", package0);
Log.e("fht", "qch_jgy_network_allow::" + qch_jgy_network_allow + ":" + JGYUtils.getString(context.getContentResolver(), "qch_jgy_network_allow"));
boolean aole_network_allow = JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_ALLOW, package0);
Log.e("fht", "aole_network_allow::" + aole_network_allow + ":" + JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_ALLOW));
} else {
boolean qch_jgy_network_allow = JGYUtils.putString(context.getContentResolver(), "qch_jgy_network_allow", "invalid");
Log.e("fht", "qch_jgy_network_allow::" + qch_jgy_network_allow + ":" + JGYUtils.getString(context.getContentResolver(), "qch_jgy_network_allow"));
boolean aole_network_allow = JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_ALLOW, "invalid");
Log.e("fht", "aole_network_allow::" + aole_network_allow + ":" + JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_ALLOW));
}
if (package1.length() != 0) {
boolean qch_jgy_network_disallow = JGYUtils.putString(context.getContentResolver(), "qch_jgy_network_disallow", package1);
Log.e("fht", "qch_jgy_network_disallow::" + qch_jgy_network_disallow + ":" + JGYUtils.getString(context.getContentResolver(), "qch_jgy_network_disallow"));
boolean aole_network_disallow = JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, package1);
Log.e("fht", "aole_network_disallow::" + aole_network_disallow + ":" + JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_DISALLOW));
} else {
boolean qch_jgy_network_disallow = JGYUtils.putString(context.getContentResolver(), "qch_jgy_network_disallow", "invalid");
Log.e("fht", "qch_jgy_network_disallow::" + qch_jgy_network_disallow + ":" + JGYUtils.getString(context.getContentResolver(), "qch_jgy_network_disallow"));
boolean aole_network_disallow = JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, "invalid");
Log.e("fht", "aole_network_disallow::" + aole_network_disallow + ":" + JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_DISALLOW));
}
} else {
ToastUtil.debugShow("setAppNetworkstate jsonString is NULL");
@@ -1112,7 +1112,7 @@ public class MessageReceiver extends XGPushBaseReceiver {
JSONObject jsonObject = JSON.parseObject(jsonString);
String is_upgrade = jsonObject.getString("is_upgrade");
String packageName = jsonObject.getString("package");
String nowApplist = JGYUtils.getString(context.getContentResolver(), CommonConfig.QCH_APP_FORBID);
String nowApplist = JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID);
List<String> applist = new ArrayList<>(Arrays.asList(nowApplist.split(",")));
if ("0".equals(is_upgrade)) {
if (applist.contains(packageName)) {
@@ -1125,8 +1125,8 @@ public class MessageReceiver extends XGPushBaseReceiver {
applist.add(packageName);
}
}
JGYUtils.putString(context.getContentResolver(), CommonConfig.QCH_APP_FORBID, String.join(",", applist));
Log.e("setAppUpdate", JGYUtils.getString(context.getContentResolver(), CommonConfig.QCH_APP_FORBID));
JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID, String.join(",", applist));
Log.e("setAppUpdate", JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID));
}
private void setLock_screen(Context context, String jsonString) {
@@ -1287,9 +1287,9 @@ public class MessageReceiver extends XGPushBaseReceiver {
intent.setPackage("com.android.settings");
context.sendStickyBroadcast(intent);
}
boolean qch_hotspot_forbid_on = JGYUtils.putInt(context.getContentResolver(), "qch_hotspot_forbid_on", setting_hotspot);
Log.e("SystemSetting", "qch_hotspot_forbid_on---------" + setting_hotspot);
Log.e("SystemSetting", "qch_hotspot_forbid_on---------" + qch_hotspot_forbid_on);
boolean aole_hotspot_forbid_on = JGYUtils.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_HOTSPOT_FORBID_ON, setting_hotspot);
Log.e("SystemSetting", "aole_hotspot_forbid_on---------" + setting_hotspot);
Log.e("SystemSetting", "aole_hotspot_forbid_on---------" + aole_hotspot_forbid_on);
} catch (Exception e) {
Log.e(TAG, "setHotspot: " + e.getMessage());
}
@@ -1298,8 +1298,8 @@ public class MessageReceiver extends XGPushBaseReceiver {
private void setRestore(Context context, String jsonString) {
JSONObject jsonObject = JSON.parseObject(jsonString);
int mode = jsonObject.getIntValue("qch_restore");
boolean qch_restore_forbid_on = JGYUtils.putInt(context.getContentResolver(), "qch_restore_forbid_on", changeNum(mode));
Log.e(TAG, "qch_restore_forbid_on:" + qch_restore_forbid_on);
boolean aole_restore_forbid_on = JGYUtils.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_RESTORE_FORBID_ON, changeNum(mode));
Log.e(TAG, "aole_restore_forbid_on:" + aole_restore_forbid_on);
}
private void setBrowserInput(Context context, String jsonString) {
@@ -1313,7 +1313,7 @@ public class MessageReceiver extends XGPushBaseReceiver {
int dev_mode = changeNum(jsonObject.getIntValue("dev_mode"));
Log.e(TAG, "getDeveloper: " + dev_mode);
if (!DeviceManager.isDebugMode()) {
JGYUtils.putInt(context.getContentResolver(), "qch_Developeroptions", dev_mode);
JGYUtils.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_DEVELOPER_OPTIONS, dev_mode);
if (dev_mode == 1) {
Intent intent = new Intent();
intent.setAction("qch_developeroptions_close");

View File

@@ -793,11 +793,11 @@ public class ApkUtils {
Log.e("addShortcut", "packages: " + s);
}
String installedList = installedListBuilder.toString();
boolean qch_force_app = JGYUtils.putString(context.getContentResolver(), "qch_launcher_icon_app", installedList);
boolean aole_force_app = JGYUtils.putString(context.getContentResolver(), "qch_launcher_icon_app", installedList);
// String old = JGYUtils.getString(context.getContentResolver(), "qch_launcher_icon_app");
// Log.e("addShortcut", old);
Log.e("addShortcut", "installedList:" + installedList);
Log.e("addShortcut", "putstring:" + qch_force_app);
Log.e("addShortcut", "putstring:" + aole_force_app);
}
@SuppressLint("NewApi")
@@ -808,10 +808,10 @@ public class ApkUtils {
HashSet<String> writeAppSet = new HashSet<>(Arrays.asList(result.split(",")));
writeAppSet.addAll(factoryAppList);
String pkgString = String.join(",", writeAppSet);
Log.e("fht", "qch_app_forbid :" + pkgString);
boolean qch_app_forbid = JGYUtils.putString(context.getContentResolver(), CommonConfig.QCH_APP_FORBID, pkgString);
Log.e("fht", "aole_app_forbid: " + pkgString);
boolean aole_app_forbid = JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID, pkgString);
} else {
JGYUtils.putString(context.getContentResolver(), CommonConfig.QCH_APP_FORBID, String.join(",", factoryAppList));
JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID, String.join(",", factoryAppList));
Log.e("fht", "writeAppPackageList is null:");
}
Utils.writeDisableUpdateList(context);

View File

@@ -228,17 +228,17 @@ public class JGYUtils {
}
String olddeselectViewArray = JGYUtils.getString(resolver, "qch_app_forbid_id");
String olddeselectViewArray = JGYUtils.getString(resolver, CommonConfig.AOLE_ACTION_APP_FORBID_ID);
Log.e("writeDeselectIDtoSystem", "olddeselectViewArray: " + olddeselectViewArray);
JGYUtils.putString(resolver, "qch_app_forbid_id", packageStringBuilder.toString());
JGYUtils.putString(resolver, "DeselectViewArray", idStringBuilder.toString());
Log.e("writeDeselectIDtoSystem", "qch_app_forbid_id: " + packageStringBuilder.toString());
JGYUtils.putString(resolver, CommonConfig.AOLE_ACTION_APP_FORBID_ID, packageStringBuilder.toString());
JGYUtils.putString(resolver, CommonConfig.AOLE_ACTION_APP_FORBID_ARRAY, idStringBuilder.toString());
Log.e("writeDeselectIDtoSystem", "aole_app_forbid_id: " + packageStringBuilder.toString());
Log.e("writeDeselectIDtoSystem", "deselectViewArray: " + idStringBuilder.toString());
} else {
Log.e("writeDeselectIDtoSystem", "writeDeselectIDtoSystem is null:");
JGYUtils.putString(resolver, "qch_app_forbid_id", " ");
JGYUtils.putString(resolver, "DeselectViewArray", " ");
JGYUtils.putString(resolver, CommonConfig.AOLE_ACTION_APP_FORBID_ID, " ");
JGYUtils.putString(resolver, CommonConfig.AOLE_ACTION_APP_FORBID_ARRAY, " ");
}
}
@@ -698,27 +698,23 @@ public class JGYUtils {
mContext.sendBroadcast(intent);
}
//应用管理-允许联网
public final static String ACTION_HrReceiver_JGY = "qch_jgy_network_allow";
//应用管理-禁止联网
public final static String ACTION_HrReceiver_JGY_DIS = "qch_jgy_network_disallow";
@SuppressLint("NewApi")
synchronized public void setAppNetwork(HashSet<String> blackList) {
Log.e(TAG, "setAppNetwork: " + "设置应用联网管控" + blackList);
String dis = Settings.System.getString(resolver, ACTION_HrReceiver_JGY_DIS);
String not = Settings.System.getString(resolver, ACTION_HrReceiver_JGY);
String dis = Settings.System.getString(resolver, CommonConfig.AOLE_ACTION_NETWORK_DISALLOW);
String not = Settings.System.getString(resolver, CommonConfig.AOLE_ACTION_NETWORK_ALLOW);
//清除旧数据
if (!TextUtils.isEmpty(dis)) {
Log.e(TAG, "setAppNetwork: dis = " + dis);
Settings.System.putString(resolver, ACTION_HrReceiver_JGY_DIS, "Invalid");
Settings.System.putString(resolver, CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, "Invalid");
}
if (!TextUtils.isEmpty(not)) {
Log.e(TAG, "setAppNetwork: not = " + not);
Settings.System.putString(resolver, ACTION_HrReceiver_JGY, "Invalid");
Settings.System.putString(resolver, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, "Invalid");
}
String oldBlackList = (String) SPUtils.get(mContext, ACTION_HrReceiver_JGY_DIS, "");
String oldBlackList = (String) SPUtils.get(mContext, CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, "");
HashSet<String> oldBlackListSet = new HashSet<>(Arrays.asList(oldBlackList.split(",")));
//去空
oldBlackListSet.removeIf(s -> TextUtils.isEmpty(s.trim()));
@@ -735,7 +731,7 @@ public class JGYUtils {
} else {
Log.e(TAG, "setAppNetwork: " + pkg + " 已安装");
}
Intent netControlNotIntent = new Intent(ACTION_HrReceiver_JGY_DIS);
Intent netControlNotIntent = new Intent(CommonConfig.AOLE_ACTION_NETWORK_DISALLOW);
netControlNotIntent.putExtra("package_name", pkg);
netControlNotIntent.setPackage("com.android.settings");
mContext.sendBroadcast(netControlNotIntent);
@@ -758,7 +754,7 @@ public class JGYUtils {
Log.e(TAG, "setAppNetwork: addedNet: " + addedNet);
for (String pkg : removedNet) {
if (TextUtils.isEmpty(pkg)) continue;
Intent netControlNotIntent = new Intent(ACTION_HrReceiver_JGY);
Intent netControlNotIntent = new Intent(CommonConfig.AOLE_ACTION_NETWORK_ALLOW);
netControlNotIntent.putExtra("package_name", pkg);
netControlNotIntent.setPackage("com.android.settings");
mContext.sendBroadcast(netControlNotIntent);
@@ -771,7 +767,7 @@ public class JGYUtils {
} else {
Log.e(TAG, "setAppNetwork: " + pkg + " 已安装");
}
Intent netControlNotIntent = new Intent(ACTION_HrReceiver_JGY_DIS);
Intent netControlNotIntent = new Intent(CommonConfig.AOLE_ACTION_NETWORK_DISALLOW);
netControlNotIntent.putExtra("package_name", pkg);
netControlNotIntent.setPackage("com.android.settings");
mContext.sendBroadcast(netControlNotIntent);
@@ -779,22 +775,22 @@ public class JGYUtils {
}
String net_not = String.join(",", blackList);
SPUtils.put(mContext, ACTION_HrReceiver_JGY_DIS, net_not);
//Settings.System.putString(resolver, JGYActions.ACTION_HrReceiver_JGY_DIS, net_not);
SPUtils.put(mContext, CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, net_not);
//Settings.System.putString(resolver, CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, net_not);
Log.e("fht", "not::" + net_not);
//Intent netControlIntent = new Intent(CommonDatas.ACTION_HrReceiver_JGY_DIS);
//Intent netControlIntent = new Intent(CommonConfig.AOLE_ACTION_NETWORK_DISALLOW);
//netControlIntent.putExtra("package_name", net_not);
//sendBroadcast(netControlIntent);
//Intent netControlNotIntent = new Intent(CommonDatas.ACTION_HrReceiver_JGY);
//Intent netControlNotIntent = new Intent(CommonConfig.AOLE_ACTION_NETWORK_ALLOW);
//netControlNotIntent.putExtra("package_name", net_ok);
//sendBroadcast(netControlNotIntent);
}
@SuppressLint("NewApi")
synchronized public void onBootSendNetwork() {
String oldBlackListString = (String) SPUtils.get(mContext, ACTION_HrReceiver_JGY_DIS, "");
String oldBlackListString = (String) SPUtils.get(mContext, CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, "");
HashSet<String> oldBlackListSet = new HashSet<>(Arrays.asList(oldBlackListString.split(",")));
Log.e(TAG, "setAppNetwork: oldBlackListSet: " + oldBlackListSet);
oldBlackListSet.removeIf(s -> TextUtils.isEmpty(s.trim()));
@@ -804,7 +800,7 @@ public class JGYUtils {
Log.e(TAG, "setAppNetwork: skip: " + pkg);
continue;
}
Intent netControlNotIntent = new Intent(ACTION_HrReceiver_JGY_DIS);
Intent netControlNotIntent = new Intent(CommonConfig.AOLE_ACTION_NETWORK_DISALLOW);
netControlNotIntent.putExtra("package_name", pkg);
netControlNotIntent.setPackage("com.android.settings");
mContext.sendBroadcast(netControlNotIntent);
@@ -824,14 +820,14 @@ public class JGYUtils {
only_jgy_shortcut_list = "";
}
//获取可以被安装的包名
String qch_app_forbid = Settings.System.getString(resolver, CommonConfig.QCH_APP_FORBID);
if (qch_app_forbid == null) {
qch_app_forbid = "";
String aole_app_forbid = Settings.System.getString(resolver, CommonConfig.AOLE_ACTION_APP_FORBID);
if (aole_app_forbid == null) {
aole_app_forbid = "";
}
Log.e("deleteOtherApp", "only_jgy_shortcut_list:" + only_jgy_shortcut_list);
Log.e("deleteOtherApp", "qch_app_forbid:" + qch_app_forbid);
Log.e("deleteOtherApp", "only_jgy_shortcut_list: " + only_jgy_shortcut_list);
Log.e("deleteOtherApp", "aole_app_forbid: " + aole_app_forbid);
String[] result_white = only_jgy_shortcut_list.split(",");
String[] result_forbid = qch_app_forbid.split(",");
String[] result_forbid = aole_app_forbid.split(",");
List<String> resulWhitetList = new ArrayList<>(Arrays.asList(result_white));
List<String> resulForbidtList = new ArrayList<>(Arrays.asList(result_forbid));
resulWhitetList.addAll(resulForbidtList);

View File

@@ -862,12 +862,12 @@ public class Utils {
@SuppressLint("NewApi")
static synchronized public boolean writeDisableUpdateList(Context context) {
//允许安装的app
String now = JGYUtils.getString(context.getContentResolver(), CommonConfig.QCH_APP_FORBID);
String now = JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID);
//禁止升级的app
String upgrade_disallow = Settings.System.getString(context.getContentResolver(), "upgrade_disallow");
//所有app
String only_jgy_shortcut_list = Settings.System.getString(context.getContentResolver(), CommonConfig.ONLY_SHORTCUT_LIST);
Log.e("writeDisableUpdateList", "qch_app_forbid: " + now);
Log.e("writeDisableUpdateList", "aole_app_forbid: " + now);
HashSet<String> nowList = new HashSet<>();
HashSet<String> disallowList = new HashSet<>();
HashSet<String> allList = new HashSet<>();
@@ -905,12 +905,12 @@ public class Utils {
}
boolean writeSucceed = false;
if (allList.size() > 0) {
Log.e("writeDisableUpdateList", "allList:" + allList);
Log.e("writeDisableUpdateList", "allList: " + allList);
String list = String.join(",", allList);
writeSucceed = JGYUtils.putString(context.getContentResolver(), CommonConfig.QCH_APP_FORBID, list);
Log.e("writeDisableUpdateList", "qch_app_forbid:" + list);
writeSucceed = JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID, list);
Log.e("writeDisableUpdateList", "aole_app_forbid: " + list);
} else {
writeSucceed = JGYUtils.putString(context.getContentResolver(), CommonConfig.QCH_APP_FORBID, "Invalid");
writeSucceed = JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID, "Invalid");
}
return writeSucceed;
/*功能和应用安装白名单一样首先会写入所有的app名单。