version:2.5
fix:修复开机删除扶小鹰app,改回Settings写入数据 add:增加台电userdebug版本
This commit is contained in:
@@ -2,6 +2,7 @@ package com.uiui.sn.activity.main;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.provider.Settings;
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
@@ -16,7 +17,6 @@ import com.uiui.sn.disklrucache.CacheHelper;
|
||||
import com.uiui.sn.network.NetInterfaceManager;
|
||||
import com.uiui.sn.network.UrlAddress;
|
||||
import com.uiui.sn.utils.CXAESUtil;
|
||||
import com.uiui.sn.utils.JGYUtils;
|
||||
import com.uiui.sn.utils.Utils;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
@@ -151,7 +151,7 @@ public class MainAPresenter implements MainAContact.Presenter {
|
||||
NetInterfaceManager.getInstance().getForceInstallState(appInfos);
|
||||
}
|
||||
} else {
|
||||
boolean aole_force_app = JGYUtils.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_FORCE_APP, "");
|
||||
boolean aole_force_app = Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_FORCE_APP, "");
|
||||
Log.e("getForceInstall", "aole_force_app: invalid: " + aole_force_app);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import android.graphics.Bitmap;
|
||||
import android.media.AudioManager;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.SystemClock;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
@@ -169,7 +170,7 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView,
|
||||
Log.e(TAG, "getWeekDayString: " + new TimeUtils().getWeekDayString(1627702095000L));
|
||||
}
|
||||
if (DeviceManager.isDebugMode()) {
|
||||
JGYUtils.putInt(getContentResolver(), CommonConfig.AOLE_ACTION_DEVELOPER_OPTIONS, 0);
|
||||
Settings.System.putInt(getContentResolver(), CommonConfig.AOLE_ACTION_DEVELOPER_OPTIONS, 0);
|
||||
}
|
||||
startService();
|
||||
registerReceiver();
|
||||
|
||||
@@ -7,6 +7,7 @@ public class AppUploadInfo implements Serializable {
|
||||
|
||||
String app_name;
|
||||
String app_package;
|
||||
String app_version_name;
|
||||
long app_version_code;
|
||||
long firstInstallTime;
|
||||
long lastUpdateTime;
|
||||
@@ -28,6 +29,14 @@ public class AppUploadInfo implements Serializable {
|
||||
this.app_package = app_package;
|
||||
}
|
||||
|
||||
public String getApp_version_name() {
|
||||
return app_version_name;
|
||||
}
|
||||
|
||||
public void setApp_version_name(String app_version_name) {
|
||||
this.app_version_name = app_version_name;
|
||||
}
|
||||
|
||||
public long getApp_version_code() {
|
||||
return app_version_code;
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ public class ControlManager {
|
||||
Log.e("SystemSetting", "setting_usb:" + setting_usb);
|
||||
if (!DeviceManager.isDebugMode()) {
|
||||
try {
|
||||
boolean qch_usb_choose = JGYUtils.putString(mResolver, "qch_usb_choose", setting_usb);
|
||||
boolean qch_usb_choose = Settings.System.putString(mResolver, "qch_usb_choose", setting_usb);
|
||||
Log.e("SystemSetting", "qch_usb_choose:" + qch_usb_choose);
|
||||
String usbStatus = "";
|
||||
switch (setting_usb) {
|
||||
@@ -171,19 +171,19 @@ public class ControlManager {
|
||||
private void setPhoneList(SystemSettings settings) {
|
||||
//设置电话功能,电话白名单
|
||||
int setting_call = changeNum(settings.getSetting_call());
|
||||
boolean qch_call_forbid = JGYUtils.putInt(mResolver, "qch_call_forbid", setting_call);
|
||||
boolean qch_call_forbid = Settings.System.putInt(mResolver, "qch_call_forbid", setting_call);
|
||||
Log.e("SystemSetting", "qch_call_forbid: " + setting_call);
|
||||
|
||||
int setting_phone = changeNum(settings.getSetting_phone());
|
||||
boolean aole_white_list_on = JGYUtils.putInt(mResolver, CommonConfig.AOLE_ACTION_WHITE_LIST_ON, setting_phone);
|
||||
boolean aole_white_list_on = Settings.System.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 aole_white_list_Array = JGYUtils.putString(mResolver, CommonConfig.AOLE_ACTION_WHITE_LIST_ARRAY, setting_phones);
|
||||
boolean aole_white_list_Array = Settings.System.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 aole_sdcard_forbid_on = JGYUtils.putInt(mResolver, CommonConfig.AOLE_ACTION_SDCARD_FORBID_ON, setting_memory);
|
||||
boolean aole_sdcard_forbid_on = Settings.System.putInt(mResolver, CommonConfig.AOLE_ACTION_SDCARD_FORBID_ON, setting_memory);
|
||||
Log.e("SystemSetting", "aole_sdcard_forbid_on: " + setting_memory);
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ public class ControlManager {
|
||||
//蓝牙音频开关
|
||||
int setting_bluetooth = changeNum(settings.getSetting_bluetooth());
|
||||
//蓝牙传输开关
|
||||
boolean aole_bht_forbid_on = JGYUtils.putInt(mResolver, CommonConfig.AOLE_ACTION_BHT_FORBID_ON, setting_bht);
|
||||
boolean aole_bht_forbid_on = Settings.System.putInt(mResolver, CommonConfig.AOLE_ACTION_BHT_FORBID_ON, setting_bht);
|
||||
//写入系统数据库
|
||||
Log.e("SystemSetting", "aole_bht_forbid_on:" + aole_bht_forbid_on);
|
||||
BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
|
||||
@@ -232,14 +232,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, CommonConfig.AOLE_ACTION_BHTVIDEO_FORBID_ON, setting_context);
|
||||
Settings.System.putString(mResolver, CommonConfig.AOLE_ACTION_BHTVIDEO_FORBID_ON, setting_context);
|
||||
} else {
|
||||
JGYUtils.putString(mResolver, CommonConfig.AOLE_ACTION_BHTVIDEO_FORBID_ON, "Empty");
|
||||
Settings.System.putString(mResolver, CommonConfig.AOLE_ACTION_BHTVIDEO_FORBID_ON, "Empty");
|
||||
}
|
||||
} else if (setting_bhtvideo == 1) {
|
||||
JGYUtils.putString(mResolver, CommonConfig.AOLE_ACTION_BHTVIDEO_FORBID_ON, "Empty");
|
||||
Settings.System.putString(mResolver, CommonConfig.AOLE_ACTION_BHTVIDEO_FORBID_ON, "Empty");
|
||||
}
|
||||
JGYUtils.putInt(mResolver, CommonConfig.AOLE_ACTION_BT_FORBID_ON, setting_bluetooth);
|
||||
Settings.System.putInt(mResolver, CommonConfig.AOLE_ACTION_BT_FORBID_ON, setting_bluetooth);
|
||||
} else {
|
||||
mBluetoothAdapter.disable();
|
||||
//设置关闭时关闭蓝牙
|
||||
@@ -282,7 +282,7 @@ public class ControlManager {
|
||||
intent.setPackage("com.android.settings");
|
||||
mContext.sendStickyBroadcast(intent);
|
||||
}
|
||||
boolean aole_hotspot_forbid_on = JGYUtils.putInt(mResolver, CommonConfig.AOLE_ACTION_HOTSPOT_FORBID_ON, setting_hotspot);//写入系统数据库
|
||||
boolean aole_hotspot_forbid_on = Settings.System.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) {
|
||||
@@ -306,7 +306,7 @@ public class ControlManager {
|
||||
private void setBar(SystemSettings settings) {
|
||||
//系统导航条显示开关
|
||||
int setting_navigation = changeNum(settings.getSetting_navigation());
|
||||
boolean aole_hide_NavigationBar = JGYUtils.putInt(mResolver, CommonConfig.AOLE_ACTION_HIDE_NAVIGATION_BAR, setting_navigation);
|
||||
boolean aole_hide_NavigationBar = Settings.System.putInt(mResolver, CommonConfig.AOLE_ACTION_HIDE_NAVIGATION_BAR, setting_navigation);
|
||||
Log.e("SystemSetting", "aole_hide_NavigationBar:" + aole_hide_NavigationBar);
|
||||
|
||||
String navigationStatus = "";
|
||||
@@ -324,9 +324,9 @@ public class ControlManager {
|
||||
|
||||
//状态栏显示开关
|
||||
int setting_statusbar = changeNum(settings.getSetting_statusbar());
|
||||
int oldNum = JGYUtils.getInt(mResolver, CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR, 0);
|
||||
int oldNum = Settings.System.getInt(mResolver, CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR, 0);
|
||||
if (oldNum != setting_statusbar) {
|
||||
boolean aole_hide_statusBar = JGYUtils.putInt(mResolver, CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR, setting_statusbar);
|
||||
boolean aole_hide_statusBar = Settings.System.putInt(mResolver, CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR, setting_statusbar);
|
||||
Log.e("SystemSetting", "aole_hide_statusBar:" + aole_hide_statusBar);
|
||||
String statusbarStatus = "";
|
||||
switch (setting_statusbar) {
|
||||
@@ -347,7 +347,7 @@ public class ControlManager {
|
||||
try {
|
||||
//摄像头开关
|
||||
int setting_camera = changeNum(settings.getSetting_camera());
|
||||
JGYUtils.putInt(mResolver, "qch_app_camera", setting_camera);
|
||||
Settings.System.putInt(mResolver, "qch_app_camera", setting_camera);
|
||||
// ApkUtils.hideSystemSettingAPP(mContext, "com.mediatek.camera");
|
||||
Log.e("SystemSetting", "setting_camera:" + setting_camera);
|
||||
String cameraStatus = "";
|
||||
@@ -393,7 +393,7 @@ public class ControlManager {
|
||||
private void setTF(SystemSettings settings) {
|
||||
//tfmedia开关
|
||||
int setting_tfmedia = changeNum(settings.getSetting_tfmedia());
|
||||
boolean qch_tfmedia_forbid = JGYUtils.putInt(mResolver, "qch_tfmedia_forbid", setting_tfmedia);
|
||||
boolean qch_tfmedia_forbid = Settings.System.putInt(mResolver, "qch_tfmedia_forbid", setting_tfmedia);
|
||||
Log.e("SystemSetting", "setting_tfmedia:" + qch_tfmedia_forbid);
|
||||
String tfmediaStatus = "";
|
||||
switch (setting_tfmedia) {
|
||||
@@ -411,7 +411,7 @@ public class ControlManager {
|
||||
if (setting_tfmedia == 1) {
|
||||
String qch_tfmedia_filetypes = settings.getSetting_tfmedia_format();
|
||||
if (TextUtils.isEmpty(qch_tfmedia_filetypes)) {
|
||||
JGYUtils.putString(mResolver, "qch_tfmedia_filetypes", "");//影音管控
|
||||
Settings.System.putString(mResolver, "qch_tfmedia_filetypes", "");//影音管控
|
||||
} else {
|
||||
HashSet<String> types = new HashSet<>(Arrays.asList(qch_tfmedia_filetypes.split(",")));
|
||||
types.removeIf(new Predicate<String>() {
|
||||
@@ -421,11 +421,11 @@ public class ControlManager {
|
||||
}
|
||||
});
|
||||
String typesString = String.join(",", types);
|
||||
JGYUtils.putString(mResolver, "qch_tfmedia_filetypes", typesString);//影音管控
|
||||
Settings.System.putString(mResolver, "qch_tfmedia_filetypes", typesString);//影音管控
|
||||
Log.e("SystemSetting", "qch_tfmedia_filetypes :" + typesString);
|
||||
}
|
||||
} else {
|
||||
JGYUtils.putInt(mResolver, "qch_tfmedia_forbid", 0);
|
||||
Settings.System.putInt(mResolver, "qch_tfmedia_forbid", 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -463,31 +463,31 @@ public class ControlManager {
|
||||
//设置5个app的开关
|
||||
//时钟
|
||||
int deskclock = changeNum(settings.getSetting_clock());
|
||||
JGYUtils.putInt(mResolver, "qch_app_deskclock", deskclock);
|
||||
Settings.System.putInt(mResolver, "qch_app_deskclock", deskclock);
|
||||
ApkUtils.hideSystemSettingAPP(mContext, "com.android.deskclock");
|
||||
Log.e("SystemSetting", "qch_app_deskclock:" + deskclock);
|
||||
//录音机
|
||||
int soundrecorder = changeNum(settings.getSetting_recording());
|
||||
JGYUtils.putInt(mResolver, "qch_app_soundrecorder", soundrecorder);
|
||||
Settings.System.putInt(mResolver, "qch_app_soundrecorder", soundrecorder);
|
||||
ApkUtils.hideSystemSettingAPP(mContext, "com.android.soundrecorder");
|
||||
Log.e("SystemSetting", "qch_app_soundrecorder:" + soundrecorder);
|
||||
//音乐
|
||||
int music = changeNum(settings.getSetting_music());
|
||||
JGYUtils.putInt(mResolver, "qch_app_music", music);
|
||||
Settings.System.putInt(mResolver, "qch_app_music", music);
|
||||
ApkUtils.hideSystemSettingAPP(mContext, "com.android.music");
|
||||
Log.e("SystemSetting", "qch_app_music:" + music);
|
||||
//图库
|
||||
int gallery = changeNum(settings.getSetting_picture());
|
||||
JGYUtils.putInt(mResolver, "qch_app_gallery", gallery);
|
||||
Settings.System.putInt(mResolver, "qch_app_gallery", gallery);
|
||||
ApkUtils.hideSystemSettingAPP(mContext, "com.android.gallery3d");
|
||||
Log.e("SystemSetting", "qch_app_gallery:" + gallery);
|
||||
//壁纸
|
||||
int wallpaper = changeNum(settings.getSetting_wallpaper());
|
||||
JGYUtils.putInt(mResolver, "qch_app_wallpaper", wallpaper);
|
||||
Settings.System.putInt(mResolver, "qch_app_wallpaper", wallpaper);
|
||||
Log.e("SystemSetting", "qch_app_wallpaper:" + wallpaper);
|
||||
//文件管理器
|
||||
int filemanager = changeNum(settings.getSetting_file());
|
||||
JGYUtils.putInt(mResolver, "qch_app_filemanager", filemanager);
|
||||
Settings.System.putInt(mResolver, "qch_app_filemanager", filemanager);
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
|
||||
ApkUtils.hideSystemSettingAPP(mContext, "com.mediatek.filemanager");
|
||||
} else {
|
||||
@@ -496,7 +496,7 @@ public class ControlManager {
|
||||
Log.e("SystemSetting", "qch_app_filemanager:" + filemanager);
|
||||
//浏览器
|
||||
int browser = changeNum(settings.getSetting_browser());
|
||||
JGYUtils.putInt(mResolver, "qch_app_browser", browser);
|
||||
Settings.System.putInt(mResolver, "qch_app_browser", browser);
|
||||
Log.e(TAG, "qch_app_browser" + browser);
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "setIcon: " + e.getMessage());
|
||||
@@ -581,7 +581,7 @@ public class ControlManager {
|
||||
int dev_mode = changeNum(jsonObject.get("dev_mode").getAsInt());
|
||||
Log.e(TAG, "getDeveloper: " + dev_mode);
|
||||
if (!DeviceManager.isDebugMode()) {
|
||||
JGYUtils.putInt(mResolver, CommonConfig.AOLE_ACTION_DEVELOPER_OPTIONS, dev_mode);
|
||||
Settings.System.putInt(mResolver, CommonConfig.AOLE_ACTION_DEVELOPER_OPTIONS, dev_mode);
|
||||
if (dev_mode == 1) {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction("qch_developeroptions_close");
|
||||
@@ -634,7 +634,7 @@ public class ControlManager {
|
||||
//仅充电:usb_charge
|
||||
//MTP模式:usb_mtp
|
||||
//Midi模式:usb_midi
|
||||
String setting_usb = JGYUtils.getString(mResolver, "qch_usb_choose");
|
||||
String setting_usb = Settings.System.getString(mResolver, "qch_usb_choose");
|
||||
Log.e("SystemSetting", "setting_usb:" + setting_usb);
|
||||
String usbStatus = "";
|
||||
if (TextUtils.isEmpty(setting_usb)) {
|
||||
|
||||
@@ -33,12 +33,13 @@ import com.uiui.sn.bean.BaseResponse;
|
||||
import com.uiui.sn.bean.BatchID;
|
||||
import com.uiui.sn.bean.CloudLessonSetting;
|
||||
import com.uiui.sn.bean.Label;
|
||||
import com.uiui.sn.bean.UserAvatarInfo;
|
||||
import com.uiui.sn.bean.SnInfo;
|
||||
import com.uiui.sn.bean.UserAvatarInfo;
|
||||
import com.uiui.sn.bean.browser.BrowserApiData;
|
||||
import com.uiui.sn.bean.browser.BrowserBean;
|
||||
import com.uiui.sn.config.CommonConfig;
|
||||
import com.uiui.sn.disklrucache.CacheHelper;
|
||||
import com.uiui.sn.gson.GsonUtils;
|
||||
import com.uiui.sn.manager.ConnectManager;
|
||||
import com.uiui.sn.manager.ConnectMode;
|
||||
import com.uiui.sn.manager.ControlManager;
|
||||
@@ -73,7 +74,6 @@ import com.uiui.sn.utils.ApkUtils;
|
||||
import com.uiui.sn.utils.AppUsedTimeUtils;
|
||||
import com.uiui.sn.utils.CmdUtil;
|
||||
import com.uiui.sn.utils.FileUtils;
|
||||
import com.uiui.sn.gson.GsonUtils;
|
||||
import com.uiui.sn.utils.JGYUtils;
|
||||
import com.uiui.sn.utils.MD5Util;
|
||||
import com.uiui.sn.utils.SPUtils;
|
||||
@@ -679,11 +679,12 @@ public class NetInterfaceManager {
|
||||
this.add("com.uiui.city");
|
||||
//扶小鹰
|
||||
this.add("com.fuying.fuxiaoying");
|
||||
this.add("com.fuying.aobama.pad");
|
||||
this.add("com.fuying.english");
|
||||
this.add("com.moshujiamm.moshujia");
|
||||
this.add("com.pengren.growthspace");
|
||||
this.add("com.zhiduoke.fxy");
|
||||
this.add("com.fuying.english");
|
||||
this.add("com.pengren.growthspace");
|
||||
this.add("com.moshujiamm.moshujia");
|
||||
this.add("com.gankao.gkwxhd");
|
||||
this.add("com.fuying.aobama.pad");
|
||||
}};
|
||||
|
||||
public static long getPackageSize(Context context, String filePath) {
|
||||
@@ -721,6 +722,7 @@ public class NetInterfaceManager {
|
||||
AppUploadInfo uploadInfo = new AppUploadInfo();
|
||||
uploadInfo.setApp_name(info.applicationInfo.loadLabel(pm).toString());
|
||||
uploadInfo.setApp_package(info.packageName);
|
||||
uploadInfo.setApp_version_name(info.versionName);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
uploadInfo.setApp_version_code(info.getLongVersionCode());
|
||||
} else {
|
||||
@@ -1190,24 +1192,24 @@ public class NetInterfaceManager {
|
||||
//白名单
|
||||
List<BrowserBean> white = response.data.getWhiteList();
|
||||
if (null != white && white.size() != 0) {
|
||||
boolean whiteList = JGYUtils.putString(crv, "DeselectBrowserArray",
|
||||
boolean whiteList = Settings.System.putString(crv, "DeselectBrowserArray",
|
||||
white.stream().map(BrowserBean::getAddress).collect(Collectors.joining(",")));
|
||||
Log.e("getBrowserWhiteList", "setBrowserList_white:" + white + ":" + whiteList);
|
||||
} else {
|
||||
JGYUtils.putString(crv, "DeselectBrowserArray", " ");
|
||||
Settings.System.putString(crv, "DeselectBrowserArray", " ");
|
||||
}
|
||||
//黑名单
|
||||
List<BrowserBean> black = response.data.getBlackList();
|
||||
if (null != black && black.size() != 0) {
|
||||
boolean blackList = JGYUtils.putString(crv, "qch_webblack_url",
|
||||
boolean blackList = Settings.System.putString(crv, "qch_webblack_url",
|
||||
black.stream().map(BrowserBean::getAddress).collect(Collectors.joining(",")));
|
||||
Log.e("getBrowserWhiteList", "setBrowserList_black:" + black + ":" + blackList);
|
||||
} else {
|
||||
JGYUtils.putString(crv, "qch_webblack_url", " ");
|
||||
Settings.System.putString(crv, "qch_webblack_url", " ");
|
||||
}
|
||||
} else {
|
||||
JGYUtils.putString(crv, "DeselectBrowserArray", " ");
|
||||
JGYUtils.putString(crv, "qch_webblack_url", " ");
|
||||
Settings.System.putString(crv, "DeselectBrowserArray", " ");
|
||||
Settings.System.putString(crv, "qch_webblack_url", " ");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1241,7 +1243,7 @@ public class NetInterfaceManager {
|
||||
private void setLabelResponse(BaseResponse<Label> response) {
|
||||
if (response.code == 200) {
|
||||
String home_page = response.data.getHome_page();
|
||||
JGYUtils.putString(crv, "homepagURL", home_page);
|
||||
Settings.System.putString(crv, "homepagURL", home_page);
|
||||
//主页
|
||||
Intent homepag = new Intent("qch_app_brower_homepage");
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
@@ -1395,7 +1397,7 @@ public class NetInterfaceManager {
|
||||
}
|
||||
if (!TextUtils.isEmpty(auto_allow) && auto_allow.endsWith(",")) {
|
||||
auto_allow = auto_allow.substring(0, auto_allow.length() - 1);
|
||||
boolean aole_app_power_on = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_APP_POWER_ON, auto_allow);
|
||||
boolean aole_app_power_on = Settings.System.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);
|
||||
@@ -1423,12 +1425,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, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, network_allow);
|
||||
Settings.System.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, CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, network_not);
|
||||
Settings.System.putString(crv, CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, network_not);
|
||||
Log.e(TAG, "ban::" + network_not);
|
||||
}
|
||||
}
|
||||
@@ -1481,10 +1483,10 @@ 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, CommonConfig.AOLE_ACTION_DISABLE_SLIDE, slide_not);
|
||||
boolean writeSucceed = Settings.System.putString(crv, CommonConfig.AOLE_ACTION_DISABLE_SLIDE, slide_not);
|
||||
Log.e(TAG, "aole_disable_slide=" + writeSucceed + ":" + slide_not);
|
||||
} else {
|
||||
boolean writeSucceed = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_DISABLE_SLIDE, "");
|
||||
boolean writeSucceed = Settings.System.putString(crv, CommonConfig.AOLE_ACTION_DISABLE_SLIDE, "");
|
||||
Log.e(TAG, "aole_disable_slide ok=" + writeSucceed + ":" + slide_allow);
|
||||
}
|
||||
|
||||
@@ -1574,20 +1576,20 @@ public class NetInterfaceManager {
|
||||
Log.e(TAG, "setAPPIDJump: " + packages);
|
||||
Log.e(TAG, "setAPPIDJump: " + ids);
|
||||
if (TextUtils.isEmpty(ids)) {
|
||||
JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID_ID, "");
|
||||
JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID_ARRAY, "");
|
||||
Settings.System.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID_ID, "");
|
||||
Settings.System.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID_ARRAY, "");
|
||||
} else {
|
||||
JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID_ID, packages);
|
||||
JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID_ARRAY, ids);
|
||||
Settings.System.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID_ID, packages);
|
||||
Settings.System.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID_ARRAY, ids);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setInvalid() {
|
||||
boolean aole_app_power_on = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_APP_POWER_ON, "");
|
||||
boolean aole_network_allow = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, "");
|
||||
boolean aole_network_disallow = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, "");
|
||||
boolean writeSucceed = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_DISABLE_SLIDE, "");
|
||||
boolean aole_app_power_on = Settings.System.putString(crv, CommonConfig.AOLE_ACTION_APP_POWER_ON, "");
|
||||
boolean aole_network_allow = Settings.System.putString(crv, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, "");
|
||||
boolean aole_network_disallow = Settings.System.putString(crv, CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, "");
|
||||
boolean writeSucceed = Settings.System.putString(crv, CommonConfig.AOLE_ACTION_DISABLE_SLIDE, "");
|
||||
}
|
||||
|
||||
private void sendAllweb() {
|
||||
@@ -1732,7 +1734,7 @@ public class NetInterfaceManager {
|
||||
}
|
||||
// JGYUtils.getInstance().deleteOtherApp();
|
||||
} else {
|
||||
boolean aole_force_app = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_FORCE_APP, "");
|
||||
boolean aole_force_app = Settings.System.putString(crv, CommonConfig.AOLE_ACTION_FORCE_APP, "");
|
||||
Log.e(TAG, "aole_force_app:" + aole_force_app + ":" + "");
|
||||
}
|
||||
}
|
||||
@@ -1780,9 +1782,9 @@ public class NetInterfaceManager {
|
||||
}
|
||||
String packageList = String.join(",", forceAppSet);
|
||||
Log.e(TAG, "getForceInstallState: " + packageList);
|
||||
boolean aole_force_app = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_FORCE_APP, packageList);
|
||||
boolean aole_force_app = Settings.System.putString(crv, CommonConfig.AOLE_ACTION_FORCE_APP, packageList);
|
||||
} else {
|
||||
boolean aole_force_app = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_FORCE_APP, "");
|
||||
boolean aole_force_app = Settings.System.putString(crv, CommonConfig.AOLE_ACTION_FORCE_APP, "");
|
||||
Log.e(TAG, "getForceInstallState:" + aole_force_app + ":" + "");
|
||||
}
|
||||
}
|
||||
@@ -1925,8 +1927,8 @@ public class NetInterfaceManager {
|
||||
JGYUtils.getInstance().writeDeselectIDtoSystem(ids, packages);
|
||||
} else {
|
||||
Log.e("getAppInside", "onNext: " + baseResponse.msg);
|
||||
JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID_ID, " ");
|
||||
JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID_ARRAY, " ");
|
||||
Settings.System.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID_ID, " ");
|
||||
Settings.System.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID_ARRAY, " ");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
NetInterfaceManager.getInstance().getAppStart(appInfoList);
|
||||
}
|
||||
JGYUtils.getInstance().deleteOtherApp();
|
||||
}else {
|
||||
} else {
|
||||
ApkUtils.writeAppPackageList(mContext, "");
|
||||
}
|
||||
}
|
||||
@@ -192,8 +192,8 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
JGYUtils.getInstance().writeDeselectIDtoSystem(ids, packages);
|
||||
} else {
|
||||
Log.e("getAppInside", "onNext: " + baseResponse.msg);
|
||||
JGYUtils.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID_ID, " ");
|
||||
JGYUtils.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID_ARRAY, " ");
|
||||
Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID_ID, " ");
|
||||
Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID_ARRAY, " ");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
NetInterfaceManager.getInstance().getForceInstallState(appInfos);
|
||||
}
|
||||
} else {
|
||||
boolean aole_force_app = JGYUtils.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_FORCE_APP, "");
|
||||
boolean aole_force_app = Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_FORCE_APP, "");
|
||||
Log.e("getForceInstall", "aole_force_app: invalid: " + aole_force_app);
|
||||
}
|
||||
}
|
||||
@@ -264,7 +264,7 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
|
||||
@Override
|
||||
public void onNext(BaseResponse systemSettingsBaseResponse) {
|
||||
Log.e("getSystemSettings", "onNext: "+systemSettingsBaseResponse);
|
||||
Log.e("getSystemSettings", "onNext: " + systemSettingsBaseResponse);
|
||||
SPUtils.put(mContext, "is_first_connection", 0);
|
||||
int code = systemSettingsBaseResponse.code;
|
||||
if (code == 200) {
|
||||
@@ -307,7 +307,7 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
Log.e("getBrowserLabel", "onNext: " + labelBaseResponse);
|
||||
if (labelBaseResponse.code == 200) {
|
||||
String home_page = labelBaseResponse.data.getHome_page();
|
||||
JGYUtils.putString(mContext.getContentResolver(), "homepagURL", home_page);
|
||||
Settings.System.putString(mContext.getContentResolver(), "homepagURL", home_page);
|
||||
//主页
|
||||
Intent homepag = new Intent("qch_app_brower_homepage");
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
@@ -386,24 +386,24 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
//白名单
|
||||
List<BrowserBean> white = response.data.getWhiteList();
|
||||
if (null != white && white.size() != 0) {
|
||||
boolean whiteList = JGYUtils.putString(mContext.getContentResolver(), "DeselectBrowserArray",
|
||||
boolean whiteList = Settings.System.putString(mContext.getContentResolver(), "DeselectBrowserArray",
|
||||
white.stream().map(BrowserBean::getAddress).collect(Collectors.joining(",")));
|
||||
Log.e("getBrowserWhiteList", "setBrowserList_white:" + white + ":" + whiteList);
|
||||
} else {
|
||||
JGYUtils.putString(mContext.getContentResolver(), "DeselectBrowserArray", " ");
|
||||
Settings.System.putString(mContext.getContentResolver(), "DeselectBrowserArray", " ");
|
||||
}
|
||||
//黑名单
|
||||
List<BrowserBean> black = response.data.getBlackList();
|
||||
if (null != black && black.size() != 0) {
|
||||
boolean blackList = JGYUtils.putString(mContext.getContentResolver(), "qch_webblack_url",
|
||||
boolean blackList = Settings.System.putString(mContext.getContentResolver(), "qch_webblack_url",
|
||||
black.stream().map(BrowserBean::getAddress).collect(Collectors.joining(",")));
|
||||
Log.e("getBrowserWhiteList", "setBrowserList_black:" + black + ":" + blackList);
|
||||
} else {
|
||||
JGYUtils.putString(mContext.getContentResolver(), "qch_webblack_url", " ");
|
||||
Settings.System.putString(mContext.getContentResolver(), "qch_webblack_url", " ");
|
||||
}
|
||||
} else {
|
||||
JGYUtils.putString(mContext.getContentResolver(), "DeselectBrowserArray", " ");
|
||||
JGYUtils.putString(mContext.getContentResolver(), "qch_webblack_url", " ");
|
||||
Settings.System.putString(mContext.getContentResolver(), "DeselectBrowserArray", " ");
|
||||
Settings.System.putString(mContext.getContentResolver(), "qch_webblack_url", " ");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -851,9 +851,9 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
||||
if (!TextUtils.isEmpty(jsonString)) {
|
||||
JsonObject extra = GsonUtils.getJsonObject(jsonString);
|
||||
int is_tf = extra.get("setting_memory").getAsInt();
|
||||
boolean aole_sdcard_forbid_on = JGYUtils.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_SDCARD_FORBID_ON, changeNum(is_tf));
|
||||
boolean aole_sdcard_forbid_on = Settings.System.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));
|
||||
Log.e("setTfcardState:", Settings.System.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_SDCARD_FORBID_ON));
|
||||
} else {
|
||||
ToastUtil.debugShow("setTfcardState failed,state:" + is_tf);
|
||||
}
|
||||
@@ -874,7 +874,7 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
||||
Log.e(TAG, "aole_bht_forbid_on: " + is_bluetooth);
|
||||
try {
|
||||
//写入系统数据库
|
||||
boolean aole_bht_forbid_on = JGYUtils.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_BHT_FORBID_ON, is_bluetooth);
|
||||
boolean aole_bht_forbid_on = Settings.System.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 (aole_bht_forbid_on) {
|
||||
@@ -884,8 +884,8 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
||||
//获取默认蓝牙适配器
|
||||
}
|
||||
//蓝牙总开关开启
|
||||
JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_BHTVIDEO_FORBID_ON, "Empty");
|
||||
JGYUtils.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_BT_FORBID_ON, is_bluetooth);
|
||||
Settings.System.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_BHTVIDEO_FORBID_ON, "Empty");
|
||||
Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_BT_FORBID_ON, is_bluetooth);
|
||||
//设置关闭时关闭蓝牙
|
||||
mBluetoothAdapter.disable();
|
||||
}
|
||||
@@ -903,18 +903,18 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
||||
String package0 = extra.get("package0").getAsString();
|
||||
String package1 = extra.get("package1").getAsString();
|
||||
if (package0.length() != 0) {
|
||||
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));
|
||||
boolean aole_network_allow = Settings.System.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_ALLOW, package0);
|
||||
Log.e("fht", "aole_network_allow::" + aole_network_allow + ":" + Settings.System.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_ALLOW));
|
||||
} else {
|
||||
boolean aole_network_allow = JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_ALLOW, "");
|
||||
Log.e("fht", "aole_network_allow::" + aole_network_allow + ":" + JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_ALLOW));
|
||||
boolean aole_network_allow = Settings.System.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_ALLOW, "");
|
||||
Log.e("fht", "aole_network_allow::" + aole_network_allow + ":" + Settings.System.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_ALLOW));
|
||||
}
|
||||
if (package1.length() != 0) {
|
||||
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));
|
||||
boolean aole_network_disallow = Settings.System.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, package1);
|
||||
Log.e("fht", "aole_network_disallow::" + aole_network_disallow + ":" + Settings.System.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_DISALLOW));
|
||||
} else {
|
||||
boolean aole_network_disallow = JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, "");
|
||||
Log.e("fht", "aole_network_disallow::" + aole_network_disallow + ":" + JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_DISALLOW));
|
||||
boolean aole_network_disallow = Settings.System.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, "");
|
||||
Log.e("fht", "aole_network_disallow::" + aole_network_disallow + ":" + Settings.System.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_DISALLOW));
|
||||
}
|
||||
} else {
|
||||
ToastUtil.debugShow("setAppNetworkstate jsonString is NULL");
|
||||
@@ -1105,15 +1105,15 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
||||
Log.e("SystemSetting", "qch_tfmedia_forbid---------" + setting_tfmedia);
|
||||
|
||||
if (setting_tfmedia == 1) {
|
||||
JGYUtils.putInt(context.getContentResolver(), "qch_tfmedia_forbid", 0);
|
||||
Settings.System.putInt(context.getContentResolver(), "qch_tfmedia_forbid", 0);
|
||||
} else {
|
||||
String s = JGYUtils.getString(context.getContentResolver(), "qch_tfmedia_filetypes");//影音管控
|
||||
String s = Settings.System.getString(context.getContentResolver(), "qch_tfmedia_filetypes");//影音管控
|
||||
Log.e("SystemSetting", "qch_tfmedia_filetypes old" + s);
|
||||
JGYUtils.putInt(context.getContentResolver(), "qch_tfmedia_forbid", 1);
|
||||
Settings.System.putInt(context.getContentResolver(), "qch_tfmedia_forbid", 1);
|
||||
String setting_tfmedia_format = jsonObject.get("setting_tfmedia_format").getAsString();
|
||||
HashSet<String> types = new HashSet<>(Arrays.asList(setting_tfmedia_format.split(",")));
|
||||
types.removeIf(TextUtils::isEmpty);
|
||||
boolean b = JGYUtils.putString(context.getContentResolver(), "qch_tfmedia_filetypes", String.join(",", types));//影音管控
|
||||
boolean b = Settings.System.putString(context.getContentResolver(), "qch_tfmedia_filetypes", String.join(",", types));//影音管控
|
||||
Log.e("SystemSetting", "qch_tfmedia_filetypes---------" + b + ":" + types);
|
||||
}
|
||||
}
|
||||
@@ -1122,7 +1122,7 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
||||
JsonObject jsonObject = GsonUtils.getJsonObject(jsonString);
|
||||
//摄像头开关
|
||||
int setting_camera = changeNum(jsonObject.get("setting_camera").getAsInt());
|
||||
JGYUtils.putInt(context.getContentResolver(), "qch_app_camera", setting_camera);
|
||||
Settings.System.putInt(context.getContentResolver(), "qch_app_camera", setting_camera);
|
||||
ApkUtils.hideSystemSettingAPP(context, "com.mediatek.camera");
|
||||
Log.e("SystemSetting", "setting_camera---------" + setting_camera);
|
||||
String cameraStatus = "";
|
||||
@@ -1150,7 +1150,7 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
||||
JsonObject jsonObject = GsonUtils.getJsonObject(jsonString);
|
||||
String is_upgrade = jsonObject.get("is_upgrade").getAsString();
|
||||
String packageName = jsonObject.get("package").getAsString();
|
||||
String nowApplist = JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID);
|
||||
String nowApplist = Settings.System.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)) {
|
||||
@@ -1163,8 +1163,8 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
||||
applist.add(packageName);
|
||||
}
|
||||
}
|
||||
JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID, String.join(",", applist));
|
||||
Log.e("setAppUpdate", JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID));
|
||||
Settings.System.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID, String.join(",", applist));
|
||||
Log.e("setAppUpdate", Settings.System.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID));
|
||||
}
|
||||
|
||||
private void setLock_screen(Context context, String jsonString) {
|
||||
@@ -1287,22 +1287,22 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
||||
JsonObject extra = GsonUtils.getJsonObject(jsonString);
|
||||
String white = extra.get("white").getAsString();
|
||||
if (white != null && !"".equals(white)) {
|
||||
boolean whiteList = JGYUtils.putString(context.getContentResolver(), "DeselectBrowserArray", white);
|
||||
boolean whiteList = Settings.System.putString(context.getContentResolver(), "DeselectBrowserArray", white);
|
||||
Log.e("SystemSetting", "setBrowserList-whiteList" + whiteList + ":" + white);
|
||||
} else {
|
||||
JGYUtils.putString(context.getContentResolver(), "DeselectBrowserArray", " ");
|
||||
Settings.System.putString(context.getContentResolver(), "DeselectBrowserArray", " ");
|
||||
}
|
||||
Log.e("whiteList", JGYUtils.getString(context.getContentResolver(), "DeselectBrowserArray"));
|
||||
Log.e("whiteList", Settings.System.getString(context.getContentResolver(), "DeselectBrowserArray"));
|
||||
String black = extra.get("black").getAsString();
|
||||
if (black != null && !"".equals(black)) {
|
||||
boolean blackList = JGYUtils.putString(context.getContentResolver(), "qch_webblack_url", black);
|
||||
boolean blackList = Settings.System.putString(context.getContentResolver(), "qch_webblack_url", black);
|
||||
Log.e("SystemSetting", "setBrowserList-blackList" + blackList + ":" + black);
|
||||
} else {
|
||||
JGYUtils.putString(context.getContentResolver(), "qch_webblack_url", " ");
|
||||
Settings.System.putString(context.getContentResolver(), "qch_webblack_url", " ");
|
||||
}
|
||||
Log.e("blackList", JGYUtils.getString(context.getContentResolver(), "qch_webblack_url"));
|
||||
Log.e("blackList", Settings.System.getString(context.getContentResolver(), "qch_webblack_url"));
|
||||
} else {
|
||||
boolean setBrowserUrlpath = JGYUtils.putString(context.getContentResolver(), "DeselectBrowserArray", "");
|
||||
boolean setBrowserUrlpath = Settings.System.putString(context.getContentResolver(), "DeselectBrowserArray", "");
|
||||
ToastUtil.debugShow("setBrowserUrlpath jsonString is NULL,set default: " + setBrowserUrlpath);
|
||||
}
|
||||
}
|
||||
@@ -1325,7 +1325,7 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
||||
intent.setPackage("com.android.settings");
|
||||
context.sendStickyBroadcast(intent);
|
||||
}
|
||||
boolean aole_hotspot_forbid_on = JGYUtils.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_HOTSPOT_FORBID_ON, setting_hotspot);
|
||||
boolean aole_hotspot_forbid_on = Settings.System.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) {
|
||||
@@ -1336,14 +1336,14 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
||||
private void setRestore(Context context, String jsonString) {
|
||||
JsonObject jsonObject = GsonUtils.getJsonObject(jsonString);
|
||||
int mode = jsonObject.get("qch_restore").getAsInt();
|
||||
boolean aole_restore_forbid_on = JGYUtils.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_RESTORE_FORBID_ON, changeNum(mode));
|
||||
boolean aole_restore_forbid_on = Settings.System.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) {
|
||||
JsonObject jsonObject = GsonUtils.getJsonObject(jsonString);
|
||||
int setting_browserInput = changeNum(jsonObject.get("setting_browserInput").getAsInt());
|
||||
JGYUtils.putInt(context.getContentResolver(), "qch_Browser_input", setting_browserInput);
|
||||
Settings.System.putInt(context.getContentResolver(), "qch_Browser_input", setting_browserInput);
|
||||
}
|
||||
|
||||
private void setDeveloper(Context context, String jsonString) {
|
||||
@@ -1351,7 +1351,7 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
||||
int dev_mode = changeNum(jsonObject.get("dev_mode").getAsInt());
|
||||
Log.e(TAG, "getDeveloper: " + dev_mode);
|
||||
if (!DeviceManager.isDebugMode()) {
|
||||
JGYUtils.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_DEVELOPER_OPTIONS, dev_mode);
|
||||
Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_DEVELOPER_OPTIONS, dev_mode);
|
||||
if (dev_mode == 1) {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction("qch_developeroptions_close");
|
||||
|
||||
@@ -692,28 +692,28 @@ public class ApkUtils {
|
||||
//后台0显示,1隐藏
|
||||
try {
|
||||
if ("com.mediatek.camera".equalsIgnoreCase(pkage)) {
|
||||
if (JGYUtils.getInt(context.getContentResolver(), "qch_app_camera") == 1) {
|
||||
if (Settings.System.getInt(context.getContentResolver(), "qch_app_camera") == 1) {
|
||||
hide = 1;
|
||||
}
|
||||
} else if ("com.android.deskclock".equalsIgnoreCase(pkage)) {
|
||||
if (JGYUtils.getInt(context.getContentResolver(), "qch_app_deskclock") == 1) {
|
||||
if (Settings.System.getInt(context.getContentResolver(), "qch_app_deskclock") == 1) {
|
||||
hide = 1;
|
||||
}
|
||||
} else if ("com.android.soundrecorder".equalsIgnoreCase(pkage)) {
|
||||
if (JGYUtils.getInt(context.getContentResolver(), "qch_app_soundrecorder") == 1) {
|
||||
if (Settings.System.getInt(context.getContentResolver(), "qch_app_soundrecorder") == 1) {
|
||||
hide = 1;
|
||||
}
|
||||
} else if ("com.android.music".equalsIgnoreCase(pkage)) {
|
||||
if (JGYUtils.getInt(context.getContentResolver(), "qch_app_music") == 1) {
|
||||
if (Settings.System.getInt(context.getContentResolver(), "qch_app_music") == 1) {
|
||||
hide = 1;
|
||||
}
|
||||
} else if ("com.android.gallery3d".equalsIgnoreCase(pkage)) {
|
||||
if (JGYUtils.getInt(context.getContentResolver(), "qch_app_gallery") == 1) {
|
||||
if (Settings.System.getInt(context.getContentResolver(), "qch_app_gallery") == 1) {
|
||||
hide = 1;
|
||||
}
|
||||
} else if ("com.android.documentsui".equalsIgnoreCase(pkage)
|
||||
|| "com.mediatek.filemanager".equalsIgnoreCase(pkage)) {
|
||||
if (JGYUtils.getInt(context.getContentResolver(), "qch_app_filemanager") == 1) {
|
||||
if (Settings.System.getInt(context.getContentResolver(), "qch_app_filemanager") == 1) {
|
||||
hide = 1;
|
||||
}
|
||||
}
|
||||
@@ -753,13 +753,13 @@ public class ApkUtils {
|
||||
public static void addShortcut(Context context) {
|
||||
String packageList = Settings.System.getString(context.getContentResolver(), CommonConfig.ONLY_SHORTCUT_LIST);
|
||||
if (TextUtils.isEmpty(packageList)) {
|
||||
JGYUtils.putString(context.getContentResolver(), "qch_launcher_icon_app", "");
|
||||
Settings.System.putString(context.getContentResolver(), "qch_launcher_icon_app", "");
|
||||
return;
|
||||
}
|
||||
Log.e("addShortcut", "addShortcut: " + packageList);
|
||||
String[] stringList = packageList.split(",");
|
||||
HashSet<String> packages = new HashSet<>(Arrays.asList(stringList));
|
||||
String romapps = JGYUtils.getString(context.getContentResolver(), "jgy_customromapp");
|
||||
String romapps = Settings.System.getString(context.getContentResolver(), "jgy_customromapp");
|
||||
Log.e(TAG, "addShortcut: romapps: " + romapps);
|
||||
HashSet<String> appSet = new HashSet<>();
|
||||
if (!TextUtils.isEmpty(romapps)) {
|
||||
@@ -793,7 +793,7 @@ public class ApkUtils {
|
||||
Log.e("addShortcut", "packages: " + s);
|
||||
}
|
||||
String installedList = installedListBuilder.toString();
|
||||
boolean aole_force_app = JGYUtils.putString(context.getContentResolver(), "qch_launcher_icon_app", installedList);
|
||||
boolean aole_force_app = Settings.System.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);
|
||||
@@ -809,9 +809,9 @@ public class ApkUtils {
|
||||
writeAppSet.addAll(factoryAppList);
|
||||
String pkgString = String.join(",", writeAppSet);
|
||||
Log.e("fht", "aole_app_forbid: " + pkgString);
|
||||
boolean aole_app_forbid = JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID, pkgString);
|
||||
boolean aole_app_forbid = Settings.System.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID, pkgString);
|
||||
} else {
|
||||
JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID, String.join(",", factoryAppList));
|
||||
Settings.System.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID, String.join(",", factoryAppList));
|
||||
Log.e("fht", "writeAppPackageList is null:");
|
||||
}
|
||||
Utils.writeDisableUpdateList(context);
|
||||
|
||||
@@ -64,6 +64,7 @@ public class JGYUtils {
|
||||
public static int MTKPlatform = 1;
|
||||
public static int ZhanruiPlatform = 2;
|
||||
public static int UnknowPlatform = 0;
|
||||
|
||||
public static String MTKTag = "MTK";
|
||||
public static String ZhanruiTag = "展锐";
|
||||
|
||||
@@ -82,6 +83,7 @@ public class JGYUtils {
|
||||
this.add("com.uiui.health");
|
||||
this.add("com.uiui.videoplayer");
|
||||
this.add("com.uiui.os");
|
||||
this.add("com.uiui.info");
|
||||
this.add("com.aoleyunos.dop1");
|
||||
this.add("com.aoleyunos.dop2");
|
||||
this.add("com.uiui.aios");
|
||||
@@ -91,7 +93,16 @@ public class JGYUtils {
|
||||
this.add("com.info.learning");
|
||||
this.add("com.uiui.multios");
|
||||
this.add("com.uiui.city");
|
||||
}};
|
||||
|
||||
HashSet<String> fuxiaoyingApp = new HashSet<String>() {{
|
||||
this.add("com.fuying.fuxiaoying");
|
||||
this.add("com.zhiduoke.fxy");
|
||||
this.add("com.fuying.english");
|
||||
this.add("com.pengren.growthspace");
|
||||
this.add("com.moshujiamm.moshujia");
|
||||
this.add("com.gankao.gkwxhd");
|
||||
this.add("com.fuying.aobama.pad");
|
||||
}};
|
||||
|
||||
public HashSet<String> getOwnApp() {
|
||||
@@ -231,17 +242,17 @@ public class JGYUtils {
|
||||
}
|
||||
|
||||
|
||||
String olddeselectViewArray = JGYUtils.getString(resolver, CommonConfig.AOLE_ACTION_APP_FORBID_ID);
|
||||
String olddeselectViewArray = Settings.System.getString(resolver, CommonConfig.AOLE_ACTION_APP_FORBID_ID);
|
||||
Log.e("writeDeselectIDtoSystem", "olddeselectViewArray: " + olddeselectViewArray);
|
||||
|
||||
JGYUtils.putString(resolver, CommonConfig.AOLE_ACTION_APP_FORBID_ID, packageStringBuilder.toString());
|
||||
JGYUtils.putString(resolver, CommonConfig.AOLE_ACTION_APP_FORBID_ARRAY, idStringBuilder.toString());
|
||||
Settings.System.putString(resolver, CommonConfig.AOLE_ACTION_APP_FORBID_ID, packageStringBuilder.toString());
|
||||
Settings.System.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, CommonConfig.AOLE_ACTION_APP_FORBID_ID, " ");
|
||||
JGYUtils.putString(resolver, CommonConfig.AOLE_ACTION_APP_FORBID_ARRAY, " ");
|
||||
Settings.System.putString(resolver, CommonConfig.AOLE_ACTION_APP_FORBID_ID, " ");
|
||||
Settings.System.putString(resolver, CommonConfig.AOLE_ACTION_APP_FORBID_ARRAY, " ");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -584,30 +595,30 @@ public class JGYUtils {
|
||||
return 0;
|
||||
}
|
||||
|
||||
synchronized public static int getInt(ContentResolver cr, String name, int def) {
|
||||
Log.i(TAG, "getInt: " + name);
|
||||
return Settings.System.getInt(cr, name, def);
|
||||
}
|
||||
|
||||
synchronized public static int getInt(ContentResolver cr, String name) throws Settings.SettingNotFoundException {
|
||||
Log.i(TAG, "getInt: " + name);
|
||||
return Settings.System.getInt(cr, name);
|
||||
}
|
||||
|
||||
synchronized public static String getString(ContentResolver cr, String name) {
|
||||
Log.i(TAG, "getString: " + name);
|
||||
return Settings.System.getString(cr, name);
|
||||
}
|
||||
|
||||
synchronized public static boolean putInt(ContentResolver cr, String name, int value) {
|
||||
Log.i(TAG, "putInt: " + "name = " + name + ", value = " + value);
|
||||
return Settings.System.putInt(cr, name, value);
|
||||
}
|
||||
|
||||
synchronized public static boolean putString(ContentResolver cr, String name, String value) {
|
||||
Log.i(TAG, "putString: " + "name = " + name + ", value = " + value);
|
||||
return Settings.System.putString(cr, name, value);
|
||||
}
|
||||
// synchronized public static int getInt(ContentResolver cr, String name, int def) {
|
||||
// Log.i(TAG, "getInt: " + name);
|
||||
// return Settings.System.getInt(cr, name, def);
|
||||
// }
|
||||
//
|
||||
// synchronized public static int getInt(ContentResolver cr, String name) throws Settings.SettingNotFoundException {
|
||||
// Log.i(TAG, "getInt: " + name);
|
||||
// return Settings.System.getInt(cr, name);
|
||||
// }
|
||||
//
|
||||
// synchronized public static String getString(ContentResolver cr, String name) {
|
||||
// Log.i(TAG, "getString: " + name);
|
||||
// return Settings.System.getString(cr, name);
|
||||
// }
|
||||
//
|
||||
// synchronized public static boolean putInt(ContentResolver cr, String name, int value) {
|
||||
// Log.i(TAG, "putInt: " + "name = " + name + ", value = " + value);
|
||||
// return Settings.System.putInt(cr, name, value);
|
||||
// }
|
||||
//
|
||||
// synchronized public static boolean putString(ContentResolver cr, String name, String value) {
|
||||
// Log.i(TAG, "putString: " + "name = " + name + ", value = " + value);
|
||||
// return Settings.System.putString(cr, name, value);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取当前进程名
|
||||
@@ -642,26 +653,26 @@ public class JGYUtils {
|
||||
if (search_topic == 0) {
|
||||
disableApp.add("拍照搜题");
|
||||
}
|
||||
if (JGYUtils.getInt(resolver, "qch_app_camera", 0) == 1) {
|
||||
if (Settings.System.getInt(resolver, "qch_app_camera", 0) == 1) {
|
||||
disableApp.add("com.mediatek.camera");
|
||||
}
|
||||
if (JGYUtils.getInt(resolver, "qch_app_filemanager", 0) == 1) {
|
||||
if (Settings.System.getInt(resolver, "qch_app_filemanager", 0) == 1) {
|
||||
disableApp.add("com.android.documentsui");
|
||||
disableApp.add("com.mediatek.filemanager");
|
||||
}
|
||||
if (JGYUtils.getInt(resolver, "qch_app_deskclock", 0) == 1) {
|
||||
if (Settings.System.getInt(resolver, "qch_app_deskclock", 0) == 1) {
|
||||
disableApp.add("com.android.deskclock");
|
||||
}
|
||||
if (JGYUtils.getInt(resolver, "qch_app_soundrecorder", 0) == 1) {
|
||||
if (Settings.System.getInt(resolver, "qch_app_soundrecorder", 0) == 1) {
|
||||
disableApp.add("com.android.soundrecorder");
|
||||
}
|
||||
if (JGYUtils.getInt(resolver, "qch_app_gallery", 0) == 1) {
|
||||
if (Settings.System.getInt(resolver, "qch_app_gallery", 0) == 1) {
|
||||
disableApp.add("com.android.gallery3d");
|
||||
}
|
||||
if (JGYUtils.getInt(resolver, "qch_app_music", 0) == 1) {
|
||||
if (Settings.System.getInt(resolver, "qch_app_music", 0) == 1) {
|
||||
disableApp.add("com.android.music");
|
||||
}
|
||||
if (JGYUtils.getInt(resolver, "qch_app_browser", 0) == 1) {
|
||||
if (Settings.System.getInt(resolver, "qch_app_browser", 0) == 1) {
|
||||
disableApp.add("com.android.browser");
|
||||
}
|
||||
Log.e(TAG, "getForbidAPP: " + disableApp);
|
||||
@@ -853,6 +864,9 @@ public class JGYUtils {
|
||||
if (ownApp.contains(packageName)) {
|
||||
continue;
|
||||
}
|
||||
if (fuxiaoyingApp.contains(packageName)) {
|
||||
continue;
|
||||
}
|
||||
if (!allWhitePkg.contains(packageName)) {
|
||||
ApkUtils.uninstallApp(mContext, packageName);
|
||||
Log.e("deleteOtherApp", "uninstall apkName:" + packageName);
|
||||
|
||||
@@ -40,8 +40,8 @@ public class URLUtils {
|
||||
}
|
||||
|
||||
public void setBrowserList() {
|
||||
String oldwhiteList = JGYUtils.getString(mContext.getContentResolver(), "DeselectBrowserArray");
|
||||
String oldHomePage = JGYUtils.getString(mContext.getContentResolver(), "homepagURL");
|
||||
String oldwhiteList = Settings.System.getString(mContext.getContentResolver(), "DeselectBrowserArray");
|
||||
String oldHomePage = Settings.System.getString(mContext.getContentResolver(), "homepagURL");
|
||||
Log.e(TAG, "setBrowserList old: " + oldwhiteList);
|
||||
if (TextUtils.isEmpty(oldwhiteList) && TextUtils.isEmpty(oldHomePage)) {
|
||||
Log.e(TAG, "getBrowserWhiteList: " + "oldwhiteList is empty");
|
||||
|
||||
@@ -410,7 +410,7 @@ public class Utils {
|
||||
if (initSetting) {
|
||||
mPrefs.edit().putBoolean("init_setting", false).commit();
|
||||
}
|
||||
JGYUtils.putInt(context.getContentResolver(), Settings.System.SCREEN_BRIGHTNESS_MODE, 0);
|
||||
Settings.System.putInt(context.getContentResolver(), Settings.System.SCREEN_BRIGHTNESS_MODE, 0);
|
||||
mPrefs.edit().putBoolean("first_init", false).commit();
|
||||
} catch (Exception err) {
|
||||
err.printStackTrace();
|
||||
@@ -866,7 +866,7 @@ public class Utils {
|
||||
@SuppressLint("NewApi")
|
||||
static synchronized public boolean writeDisableUpdateList(Context context) {
|
||||
//允许安装的app
|
||||
String now = JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID);
|
||||
String now = Settings.System.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID);
|
||||
//禁止升级的app
|
||||
String upgrade_disallow = Settings.System.getString(context.getContentResolver(), "upgrade_disallow");
|
||||
//所有app
|
||||
@@ -911,10 +911,10 @@ public class Utils {
|
||||
if (allList.size() > 0) {
|
||||
Log.e("writeDisableUpdateList", "allList: " + allList);
|
||||
String list = String.join(",", allList);
|
||||
writeSucceed = JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID, list);
|
||||
writeSucceed = Settings.System.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID, list);
|
||||
Log.e("writeDisableUpdateList", "aole_app_forbid: " + list);
|
||||
} else {
|
||||
writeSucceed = JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID, "");
|
||||
writeSucceed = Settings.System.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID, "");
|
||||
}
|
||||
return writeSucceed;
|
||||
/*功能和应用安装白名单一样,首先会写入所有的app名单。
|
||||
@@ -943,7 +943,7 @@ public class Utils {
|
||||
// IMEI = TelephonyMgr.getDeviceId();
|
||||
|
||||
// } else {//9.0到10.0获取
|
||||
IMEI = JGYUtils.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
|
||||
IMEI = Settings.System.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
|
||||
}
|
||||
// Log.e("IMEI:", "IMEI: " + IMEI);
|
||||
if (null == IMEI) {
|
||||
|
||||
Reference in New Issue
Block a user