version: cude 5.1

fix:
update:适配台电
This commit is contained in:
2022-06-11 17:58:04 +08:00
parent b917401e86
commit cdaaaaed91
14 changed files with 323 additions and 240 deletions

View File

@@ -83,8 +83,8 @@ android {
//酷比魔方 //酷比魔方
cube { cube {
flavorDimensions "default" flavorDimensions "default"
versionCode 40 versionCode 42
versionName "4.9" versionName "5.1"
buildConfigField "String", "platform", '"ZhanRuiCube"' buildConfigField "String", "platform", '"ZhanRuiCube"'
manifestPlaceholders = [ manifestPlaceholders = [
AMAP_KEY: "6e339305206eeb43f2b4cc1f31751f89" AMAP_KEY: "6e339305206eeb43f2b4cc1f31751f89"
@@ -94,8 +94,8 @@ android {
//MTK //MTK
MTKnewly { MTKnewly {
flavorDimensions "default" flavorDimensions "default"
versionCode 18 versionCode 20
versionName "2.7" versionName "2.9"
buildConfigField "String", "platform", '"MTK"' buildConfigField "String", "platform", '"MTK"'
manifestPlaceholders = [ manifestPlaceholders = [
AMAP_KEY: "1af68e0a7edcaac82678b1cbb7643408" AMAP_KEY: "1af68e0a7edcaac82678b1cbb7643408"

View File

@@ -150,12 +150,12 @@ public class SplashActivity extends AppCompatActivity {
// hideStatusBar(); // hideStatusBar();
// boolean qch_force_app = Settings.System.putString(getContentResolver(), "qch_launcher_icon_app", ""); // boolean qch_force_app = Settings.System.putString(getContentResolver(), "qch_launcher_icon_app", "");
Log.i(TAG, "DebugTest: qch_launcher_icon_app:" + Settings.System.getString(getContentResolver(), "qch_launcher_icon_app")); Log.i(TAG, "DebugTest: qch_launcher_icon_app:" + Settings.System.getString(getContentResolver(), "qch_launcher_icon_app"));
Log.i(TAG, "DebugTest: qch_hide_NavigationBar: " + Settings.System.getString(getContentResolver(), "qch_hide_NavigationBar")); Log.i(TAG, "DebugTest: aole_hide_NavigationBar: " + Settings.System.getString(getContentResolver(), CommonConfig.AOLE_ACTION_HIDE_NAVIGATION_BAR));
String only_jgy_shortcut_list = Settings.System.getString(getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST); String only_jgy_shortcut_list = Settings.System.getString(getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST);
Log.i(TAG, "debugTest: only_jgy_shortcut_list:" + only_jgy_shortcut_list); Log.i(TAG, "debugTest: only_jgy_shortcut_list:" + only_jgy_shortcut_list);
String qch_app_forbid = Settings.System.getString(getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID); String aole_app_forbid = Settings.System.getString(getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID);
Settings.System.putString(getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID, qch_app_forbid + ",com.aoleyun.browser"); Settings.System.putString(getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID, aole_app_forbid + ",com.aoleyun.browser");
Log.e(TAG, "debugTest: qch_app_forbid:" + qch_app_forbid); Log.e(TAG, "debugTest: aole_app_forbid:" + aole_app_forbid);
Log.i(TAG, "debugTest: ip = " + JGYUtils.getInstance().getIPAddress()); Log.i(TAG, "debugTest: ip = " + JGYUtils.getInstance().getIPAddress());
Log.i(TAG, "debugTest: getPackage = " + Utils.getPackage()); Log.i(TAG, "debugTest: getPackage = " + Utils.getPackage());
Log.i(TAG, "debugTest: getMacAddress = " + Utils.getAndroid10MAC(this)); Log.i(TAG, "debugTest: getMacAddress = " + Utils.getAndroid10MAC(this));

View File

@@ -62,6 +62,7 @@ public class MainAPresenter implements MainAContact.Presenter {
@Override @Override
public void detachView() { public void detachView() {
this.mView = null; this.mView = null;
this.mContext = null;
} }
@Override @Override

View File

@@ -153,8 +153,6 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView,
mMainAPresenter = new MainAPresenter(this); mMainAPresenter = new MainAPresenter(this);
mMainAPresenter.attachView(this); mMainAPresenter.attachView(this);
mMainAPresenter.setLifecycle(lifecycleSubject); mMainAPresenter.setLifecycle(lifecycleSubject);
NetworkUtils.registerNetworkStatusChangedListener(this);
registerUpdateReceiver();
JGYUtils.startServices(MainActivity.this); JGYUtils.startServices(MainActivity.this);
getDevicesInfo(); getDevicesInfo();
setStoreUpdateListener(bt_checkupdate); setStoreUpdateListener(bt_checkupdate);
@@ -272,7 +270,7 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView,
} }
MainService.MainBinder mMainBinder; MainService.MainBinder mMainBinder;
ServiceConnect serviceConnect = new ServiceConnect(); private ServiceConnect serviceConnect = new ServiceConnect();
private class ServiceConnect implements ServiceConnection { private class ServiceConnect implements ServiceConnection {
@Override @Override
@@ -321,6 +319,8 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView,
String batch = studesInfo.getBatch(); String batch = studesInfo.getBatch();
String head_img = studesInfo.getHead_img(); String head_img = studesInfo.getHead_img();
settradeType(trade_type); settradeType(trade_type);
if (TextUtils.isEmpty(sno)) { if (TextUtils.isEmpty(sno)) {
setNumberText("", View.GONE); setNumberText("", View.GONE);
@@ -433,23 +433,24 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView,
@Override @Override
protected void onPause() { protected void onPause() {
super.onPause(); super.onPause();
NetworkUtils.unregisterNetworkStatusChangedListener(this);
if (mUpdateReceiver != null) {
unregisterReceiver(mUpdateReceiver);
}
} }
@Override @Override
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
NetworkUtils.registerNetworkStatusChangedListener(this);
registerUpdateReceiver();
} }
@Override @Override
protected void onDestroy() { protected void onDestroy() {
super.onDestroy(); super.onDestroy();
NetworkUtils.unregisterNetworkStatusChangedListener(this);
mMainAPresenter.detachView(); mMainAPresenter.detachView();
mMainAPresenter = null; mMainAPresenter = null;
if (mUpdateReceiver != null) {
unregisterReceiver(mUpdateReceiver);
mUpdateReceiver = null;
}
JGYUtils.startServices(MainActivity.this); JGYUtils.startServices(MainActivity.this);
} }
@@ -473,7 +474,7 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView,
} }
} }
UpdateReceiver mUpdateReceiver; private UpdateReceiver mUpdateReceiver;
private void registerUpdateReceiver() { private void registerUpdateReceiver() {
if (mUpdateReceiver == null) { if (mUpdateReceiver == null) {
@@ -484,7 +485,7 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView,
registerReceiver(mUpdateReceiver, filter); registerReceiver(mUpdateReceiver, filter);
} }
class UpdateReceiver extends BroadcastReceiver { private class UpdateReceiver extends BroadcastReceiver {
@Override @Override
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
if (UPDATE_LOCKED_STATUS.equals(intent.getAction())) { if (UPDATE_LOCKED_STATUS.equals(intent.getAction())) {

View File

@@ -69,7 +69,7 @@ public class BaseApplication extends MultiDexApplication {
@Override @Override
public void onCreate() { public void onCreate() {
super.onCreate(); super.onCreate();
context = this; context = this.getApplicationContext();
// if (SystemUtils.isMainProcessName(this, Process.myPid())) { // if (SystemUtils.isMainProcessName(this, Process.myPid())) {
//非主进程不初始化 //非主进程不初始化
init(); init();
@@ -157,10 +157,10 @@ public class BaseApplication extends MultiDexApplication {
List<XGPushManager.AccountInfo> accountInfoList = new ArrayList<>(); List<XGPushManager.AccountInfo> accountInfoList = new ArrayList<>();
accountInfoList.add(new XGPushManager.AccountInfo(XGPushManager.AccountType.CUSTOM.getValue(), Utils.getSerial(getApplicationContext()))); accountInfoList.add(new XGPushManager.AccountInfo(XGPushManager.AccountType.CUSTOM.getValue(), Utils.getSerial(getApplicationContext())));
if (Utils.NOSN.equalsIgnoreCase(Utils.getSerial())) { if (Utils.NOSN.equalsIgnoreCase(Utils.getSerial())) {
accountInfoList.add(new XGPushManager.AccountInfo(XGPushManager.AccountType.CUSTOM.getValue(), Utils.getIMEI(getAppContext(), 0))); accountInfoList.add(new XGPushManager.AccountInfo(XGPushManager.AccountType.CUSTOM.getValue(), Utils.getIMEI(getApplicationContext(), 0)));
accountInfoList.add(new XGPushManager.AccountInfo(XGPushManager.AccountType.CUSTOM.getValue(), Utils.getIMEI(getAppContext(), 1))); accountInfoList.add(new XGPushManager.AccountInfo(XGPushManager.AccountType.CUSTOM.getValue(), Utils.getIMEI(getApplicationContext(), 1)));
} }
XGPushManager.upsertAccounts(getAppContext(), accountInfoList, new XGIOperateCallback() { XGPushManager.upsertAccounts(getApplicationContext(), accountInfoList, new XGIOperateCallback() {
@Override @Override
public void onSuccess(Object data, int flag) { public void onSuccess(Object data, int flag) {
Log.e("TPush", "onSuccess, data:" + data + ", flag:" + flag); Log.e("TPush", "onSuccess, data:" + data + ", flag:" + flag);
@@ -272,7 +272,7 @@ public class BaseApplication extends MultiDexApplication {
public static void setJpushAlias() { public static void setJpushAlias() {
Log.e("jiguangInterface", "30s后重新设置alias"); Log.e("jiguangInterface", "30s后重新设置alias");
// JPushInterface.setAlias(context, TagAliasOperatorHelper.sequence++, Utils.getSerial()); // JPushInterface.setAlias(getAppContext(), TagAliasOperatorHelper.sequence++, Utils.getSerial());
} }
private static void initTagObservable() { private static void initTagObservable() {
@@ -518,7 +518,7 @@ public class BaseApplication extends MultiDexApplication {
totalTimes = statisticsInfo.getTotalTimes();//全部次数 totalTimes = statisticsInfo.getTotalTimes();//全部次数
} }
synchronized public static void setAPPUsage(List<String> lists) { synchronized public static void setAPPUsage( List<String> lists) {
StatisticsInfo statisticsInfo = new StatisticsInfo(getAppContext()); StatisticsInfo statisticsInfo = new StatisticsInfo(getAppContext());
List<AppInformation> list = null; List<AppInformation> list = null;
List<AppInformation> localAppList = new ArrayList<>(); List<AppInformation> localAppList = new ArrayList<>();

View File

@@ -52,8 +52,58 @@ public class CommonConfig {
* 管控系统指令 * 管控系统指令
*/ */
/*USB模式-充电*/
public final static String AOLE_ACTION_USB_USB_CHARGE = "aole_action_usb_usb_charge"; 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_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";
/*禁止应用滑动*/
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";
} }

View File

@@ -857,8 +857,8 @@ public class NetInterfaceManager {
JGYUtils.getInstance().forceDownload(forceDownloadData); JGYUtils.getInstance().forceDownload(forceDownloadData);
} else if (forceDownloadBean.code == -200) { } else if (forceDownloadBean.code == -200) {
cacheHelper.put(UrlAddress.GET_FORCE_INSTALL_LIST, ""); cacheHelper.put(UrlAddress.GET_FORCE_INSTALL_LIST, "");
boolean qch_force_app = Settings.System.putString(mContext.getContentResolver(), "qch_force_app", "invalid"); boolean aole_force_app = Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_FORCE_APP, "invalid");
Log.e("getForceDownload", "qch_force_app:" + qch_force_app); Log.e("getForceDownload", "aole_force_app:" + aole_force_app);
} else { } else {
cacheHelper.put(UrlAddress.GET_FORCE_INSTALL_LIST, ""); cacheHelper.put(UrlAddress.GET_FORCE_INSTALL_LIST, "");
Log.e("getForceDownload", forceDownloadBean.msg); Log.e("getForceDownload", forceDownloadBean.msg);
@@ -941,13 +941,18 @@ public class NetInterfaceManager {
cacheHelper.put(UrlAddress.GET_DESKTOP, ""); cacheHelper.put(UrlAddress.GET_DESKTOP, "");
String whiteList = Settings.System.getString(mContext.getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST); String whiteList = Settings.System.getString(mContext.getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST);
Log.e("getDefaultDesktop", "onNext: " + whiteList); Log.e("getDefaultDesktop", "onNext: " + whiteList);
if (!TextUtils.isEmpty(whiteList)) { if (!TextUtils.isEmpty(whiteList)) {
if (!whiteList.contains(ApkUtils.desktopAPP.get(0))) { if (!whiteList.contains(ApkUtils.desktopAPP.get(0))) {
if (!BuildConfig.DEBUG) {
ApkUtils.UninstallAPP(mContext, ApkUtils.desktopAPP.get(0)); ApkUtils.UninstallAPP(mContext, ApkUtils.desktopAPP.get(0));
}
Log.e("getDefaultDesktop", "skip: " + ApkUtils.desktopAPP.get(0)); Log.e("getDefaultDesktop", "skip: " + ApkUtils.desktopAPP.get(0));
} }
if (!whiteList.contains(ApkUtils.desktopAPP.get(1))) { if (!whiteList.contains(ApkUtils.desktopAPP.get(1))) {
if (!BuildConfig.DEBUG) {
ApkUtils.UninstallAPP(mContext, ApkUtils.desktopAPP.get(1)); ApkUtils.UninstallAPP(mContext, ApkUtils.desktopAPP.get(1));
}
Log.e("getDefaultDesktop", "skip: " + ApkUtils.desktopAPP.get(1)); Log.e("getDefaultDesktop", "skip: " + ApkUtils.desktopAPP.get(1));
} }
} else { } else {
@@ -1097,7 +1102,7 @@ public class NetInterfaceManager {
public void onError(Throwable e) { public void onError(Throwable e) {
Log.e("getDeveloper", "onError: " + e.getMessage()); Log.e("getDeveloper", "onError: " + e.getMessage());
if (!BuildConfig.DEBUG) { if (!BuildConfig.DEBUG) {
int oldStatus = Settings.System.getInt(mContext.getContentResolver(), "qch_Developeroptions", 1); int oldStatus = Settings.System.getInt(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_DEVELOPER_OPTIONS, 1);
Log.e("getDeveloper", "oldStatus: " + oldStatus); Log.e("getDeveloper", "oldStatus: " + oldStatus);
JGYUtils.getInstance().setDeveloperOptions(oldStatus); JGYUtils.getInstance().setDeveloperOptions(oldStatus);
} }
@@ -1487,7 +1492,7 @@ public class NetInterfaceManager {
cacheHelper.put(UrlAddress.GET_FIRMWARE, ""); cacheHelper.put(UrlAddress.GET_FIRMWARE, "");
//获取系统管控先不要关闭开发人员选项 //获取系统管控先不要关闭开发人员选项
if (!BuildConfig.DEBUG) { if (!BuildConfig.DEBUG) {
Settings.System.putInt(mContext.getContentResolver(), "qch_Developeroptions", 1); Settings.System.putInt(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_DEVELOPER_OPTIONS, 1);
} }
} }
} }

View File

@@ -66,6 +66,7 @@ public class NewAppReceiver extends BroadcastReceiver {
JGYUtils.getInstance().checkDefaultDesktop(packageName); JGYUtils.getInstance().checkDefaultDesktop(packageName);
JGYUtils.getInstance().checkForceDownload(); JGYUtils.getInstance().checkForceDownload();
NetInterfaceManager.getInstance().checkUpdate(); NetInterfaceManager.getInstance().checkUpdate();
NetInterfaceManager.getInstance().getDefaultDesktop();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
if (!PackageNames.APPSTORE.equals(packageName) || !PackageNames.DEVICE_INFO.equals(packageName)) { if (!PackageNames.APPSTORE.equals(packageName) || !PackageNames.DEVICE_INFO.equals(packageName)) {
ApkUtils.addShortcut(context); ApkUtils.addShortcut(context);

View File

@@ -227,12 +227,12 @@ public class GuardService extends Service {
sendBroadcast(intent1); sendBroadcast(intent1);
JGYUtils.startServices(GuardService.this); JGYUtils.startServices(GuardService.this);
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.ZhanruiPlatform) { if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.ZhanruiPlatform) {
int setting_statusbar = Settings.System.getInt(context.getContentResolver(), "qch_hide_statusBar", 0); int setting_statusbar = Settings.System.getInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR, 0);
String statusbarStatus = ""; String statusbarStatus = "";
if (setting_statusbar == 0) { if (setting_statusbar == 0) {
statusbarStatus = "qch_show_statusBar"; statusbarStatus = CommonConfig.AOLE_ACTION_SHOW_STATUS_BAR;
} else if (setting_statusbar == 1) { } else if (setting_statusbar == 1) {
statusbarStatus = "qch_hide_statusBar"; statusbarStatus = CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR;
} }
Intent navIntent = new Intent(statusbarStatus).setPackage("com.android.systemui"); Intent navIntent = new Intent(statusbarStatus).setPackage("com.android.systemui");
context.sendBroadcast(navIntent); context.sendBroadcast(navIntent);
@@ -442,17 +442,17 @@ public class GuardService extends Service {
Log.e("setDefaultUSBStatus", "setting_usb---------" + setting_usb); Log.e("setDefaultUSBStatus", "setting_usb---------" + setting_usb);
String usbStatus = ""; String usbStatus = "";
if (TextUtils.isEmpty(setting_usb)) { if (TextUtils.isEmpty(setting_usb)) {
usbStatus = "aole_action_usb_usb_charge"; usbStatus = CommonConfig.AOLE_ACTION_USB_USB_CHARGE;
} else { } else {
switch (setting_usb) { switch (setting_usb) {
case "usb_charge": case "usb_charge":
usbStatus = "aole_action_usb_usb_charge"; usbStatus = CommonConfig.AOLE_ACTION_USB_USB_CHARGE;
break; break;
case "usb_mtp": case "usb_mtp":
usbStatus = "aole_action_usb_usb_mtp"; usbStatus = CommonConfig.AOLE_ACTION_USB_USB_MTP;
break; break;
case "usb_midi": case "usb_midi":
usbStatus = "aole_action_usb_usb_midi"; usbStatus = CommonConfig.AOLE_ACTION_USB_USB_MIDI;
break; break;
default: default:
break; break;

View File

@@ -504,6 +504,7 @@ public class MessageReceiver extends XGPushBaseReceiver {
ToastUtil.betaShow("收到管控:设备重置"); ToastUtil.betaShow("收到管控:设备重置");
JGYUtils.getInstance().cleanAoleLauncher3Cache(); JGYUtils.getInstance().cleanAoleLauncher3Cache();
Utils.doMasterClear(mContext); Utils.doMasterClear(mContext);
MMKV.defaultMMKV().clearAll();
JGYUtils.getInstance().cleanAoleAppCache(); JGYUtils.getInstance().cleanAoleAppCache();
JGYUtils.getInstance().wakeUpAoleyunAPP(); JGYUtils.getInstance().wakeUpAoleyunAPP();
MainService.mPresenter.getLockedState("MSG_PUSH_RESET"); MainService.mPresenter.getLockedState("MSG_PUSH_RESET");
@@ -846,16 +847,16 @@ public class MessageReceiver extends XGPushBaseReceiver {
Log.e("setDisableSlideList", "jSONObject::" + jSONObject.toString()); Log.e("setDisableSlideList", "jSONObject::" + jSONObject.toString());
String strban = jSONObject.getString("ban"); String strban = jSONObject.getString("ban");
String strnot = jSONObject.getString("not"); String strnot = jSONObject.getString("not");
String qch_disable_slide = Settings.System.getString(mResolver, "qch_disable_slide"); String aole_disable_slide = Settings.System.getString(mResolver, CommonConfig.AOLE_ACTION_DISABLE_SLIDE);
Log.e("fht", "qch_disable_slide::" + qch_disable_slide); Log.e("fht", "aole_disable_slide: " + aole_disable_slide);
if (!TextUtils.isEmpty(strban)) { if (!TextUtils.isEmpty(strban)) {
Settings.System.putString(mResolver, "qch_disable_slide", strban); Settings.System.putString(mResolver, CommonConfig.AOLE_ACTION_DISABLE_SLIDE, strban);
Log.e("fht", "sendban::" + strban); Log.e("fht", "sendban::" + strban);
} else { } else {
Settings.System.putString(mResolver, "qch_disable_slide", "Invalid"); Settings.System.putString(mResolver, CommonConfig.AOLE_ACTION_DISABLE_SLIDE, "Invalid");
} }
Log.e("fht", "qch_disable_slide::" + Settings.System.getString(mResolver, "qch_disable_slide")); Log.e("fht", "aole_disable_slide::" + Settings.System.getString(mResolver, CommonConfig.AOLE_ACTION_DISABLE_SLIDE));
} }
private void setDisableUpdateList(String jsonString) { private void setDisableUpdateList(String jsonString) {
@@ -924,12 +925,12 @@ public class MessageReceiver extends XGPushBaseReceiver {
JSONObject jSONObject = JSON.parseObject(s); JSONObject jSONObject = JSON.parseObject(s);
String ban = jSONObject.getString("ban"); String ban = jSONObject.getString("ban");
String not = jSONObject.getString("not"); String not = jSONObject.getString("not");
Log.e(TAG, "settingPowerOn qch_app_power_on = " + not); Log.e(TAG, "settingPowerOn aole_app_power_on = " + not);
if (TextUtils.isEmpty(not)) { if (TextUtils.isEmpty(not)) {
//当 qch_app_power_on 的值为空时,会造成系统所有应用断网 //当 qch_app_power_on 的值为空时,会造成系统所有应用断网
Settings.System.putString(mResolver, "qch_app_power_on", "Invalid"); Settings.System.putString(mResolver, CommonConfig.AOLE_ACTION_APP_POWER_ON, "Invalid");
} else { } else {
Settings.System.putString(mResolver, "qch_app_power_on", not); Settings.System.putString(mResolver, CommonConfig.AOLE_ACTION_APP_POWER_ON, not);
} }
} }

View File

@@ -558,7 +558,7 @@ public class ApkUtils {
Observable.create(new ObservableOnSubscribe<String>() { Observable.create(new ObservableOnSubscribe<String>() {
@Override @Override
public void subscribe(ObservableEmitter<String> emitter) throws Exception { public void subscribe(ObservableEmitter<String> emitter) throws Exception {
Log.e("UninstallAPP", "call " + Thread.currentThread().getName()); // Log.e("UninstallAPP", "call " + Thread.currentThread().getName());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
ApkUtils.uninstall(context, pkg); ApkUtils.uninstall(context, pkg);
} else { } else {
@@ -1146,11 +1146,11 @@ public class ApkUtils {
Log.i("addShortcut", "packages: " + s); Log.i("addShortcut", "packages: " + s);
} }
String installedList = installedListBuilder.toString(); String installedList = installedListBuilder.toString();
boolean qch_force_app = Settings.System.putString(context.getContentResolver(), "qch_launcher_icon_app", installedList); boolean aole_force_app = Settings.System.putString(context.getContentResolver(), "qch_launcher_icon_app", installedList);
// String old = Settings.System.getString(context.getContentResolver(), "qch_launcher_icon_app"); // String old = Settings.System.getString(context.getContentResolver(), "qch_launcher_icon_app");
// Log.e("addShortcut", old); // Log.e("addShortcut", old);
Log.e("addShortcut", "installedList:" + installedList); Log.e("addShortcut", "installedList:" + installedList);
Log.e("addShortcut", "putstring:" + qch_force_app); Log.e("addShortcut", "putstring:" + aole_force_app);
} }
private static Set<String> AoleyunOSApp = new HashSet<String>() {{ private static Set<String> AoleyunOSApp = new HashSet<String>() {{

View File

@@ -26,6 +26,7 @@ import android.os.Environment;
import android.os.PowerManager; import android.os.PowerManager;
import android.os.Process; import android.os.Process;
import android.os.RemoteException; import android.os.RemoteException;
import android.os.SystemProperties;
import android.os.UserHandle; import android.os.UserHandle;
import android.provider.Settings; import android.provider.Settings;
import android.text.TextUtils; import android.text.TextUtils;
@@ -406,12 +407,12 @@ public class JGYUtils {
if (disallowSlide.size() != 0) { if (disallowSlide.size() != 0) {
String slide_not = String.join(",", disallowSlide); String slide_not = String.join(",", disallowSlide);
boolean writeSucceed = Settings.System.putString(crv, "qch_disable_slide", slide_not); boolean writeSucceed = Settings.System.putString(crv, CommonConfig.AOLE_ACTION_DISABLE_SLIDE, slide_not);
Log.e("fht", "qch_disable_slide=" + writeSucceed + ":" + slide_not); Log.e("fht", "aole_disable_slide=" + writeSucceed + ":" + slide_not);
} else { } else {
String slide_ok = String.join(",", allowSlide); String slide_ok = String.join(",", allowSlide);
boolean writeSucceed = Settings.System.putString(crv, "qch_disable_slide", "Invalid"); boolean writeSucceed = Settings.System.putString(crv, CommonConfig.AOLE_ACTION_DISABLE_SLIDE, "Invalid");
Log.e("fht", "qch_disable_slide ok=" + writeSucceed + ":" + slide_ok); Log.e("fht", "aole_disable_slide ok=" + writeSucceed + ":" + slide_ok);
} }
String[] upgrade_ok = new String[allowUpgrade.size()]; String[] upgrade_ok = new String[allowUpgrade.size()];
@@ -420,19 +421,19 @@ public class JGYUtils {
String[] upgrade_not = new String[disallowUpgrade.size()]; String[] upgrade_not = new String[disallowUpgrade.size()];
disallowUpgrade.toArray(upgrade_not); disallowUpgrade.toArray(upgrade_not);
Utils.writeDisableUpdateList(mContext, upgrade_not, upgrade_ok); Utils.writeDisableUpdateList(mContext, upgrade_not, upgrade_ok);
String qch_app_power_on = String.join(",", autoLaunchApp); String aole_app_power_on = String.join(",", autoLaunchApp);
Log.e(TAG, "setNetAndlaunch: qch_app_power_on: " + qch_app_power_on); Log.e(TAG, "setNetAndlaunch: aole_app_power_on: " + aole_app_power_on);
if (TextUtils.isEmpty(qch_app_power_on)) { if (TextUtils.isEmpty(aole_app_power_on)) {
//当 qch_app_power_on 的值为空时,会造成系统所有应用断网 //当 aole_app_power_on 的值为空时,会造成系统所有应用断网
Settings.System.putString(crv, "qch_app_power_on", "Invalid"); Settings.System.putString(crv, CommonConfig.AOLE_ACTION_APP_POWER_ON, "Invalid");
Log.e(TAG, "setNetAndlaunch: qch_app_power_on: " + "Invalid"); Log.e(TAG, "setNetAndlaunch: aole_app_power_on: " + "Invalid");
} else { } else {
Settings.System.putString(crv, "qch_app_power_on", qch_app_power_on); Settings.System.putString(crv, CommonConfig.AOLE_ACTION_APP_POWER_ON, aole_app_power_on);
Log.e(TAG, "setNetAndlaunch: qch_app_power_on: " + qch_app_power_on); Log.e(TAG, "setNetAndlaunch: aole_app_power_on: " + aole_app_power_on);
} }
// if (BuildConfig.DEBUG) { // if (BuildConfig.DEBUG) {
// TODO: 2021/7/2 测试写入为空是否断网 // TODO: 2021/7/2 测试写入为空是否断网
// boolean w = Settings.System.putString(crv, "qch_app_power_on", ""); // boolean w = Settings.System.putString(crv, "aole_app_power_on", "");
// Log.e(TAG, "setNetAndlaunch: 测试写入: " + w); // Log.e(TAG, "setNetAndlaunch: 测试写入: " + w);
// } // }
setAppNetwork(mContext, disallowNetApp); setAppNetwork(mContext, disallowNetApp);
@@ -498,26 +499,34 @@ public class JGYUtils {
int is_upgrade = netAndLaunchData.getIs_upgrade(); int is_upgrade = netAndLaunchData.getIs_upgrade();
int is_slide = netAndLaunchData.getIs_slide(); int is_slide = netAndLaunchData.getIs_slide();
if (is_auto == 1) autoLaunchApp.add(app_package); if (is_auto == 0) {
autoLaunchApp.add(app_package);
if (is_network == 1) allowNetApp.add(app_package); }
else disallowNetApp.add(app_package); if (is_network == 0) {
allowNetApp.add(app_package);
if (is_upgrade == 1) allowUpgrade.add(app_package); } else {
else disallowUpgrade.add(app_package); disallowNetApp.add(app_package);
}
if (is_slide == 1) allowSlide.add(app_package); if (is_upgrade == 0) {
else disallowSlide.add(app_package); allowUpgrade.add(app_package);
} else {
disallowUpgrade.add(app_package);
}
if (is_slide == 0) {
allowSlide.add(app_package);
} else {
disallowSlide.add(app_package);
}
} }
if (disallowSlide.size() != 0) { if (disallowSlide.size() != 0) {
String slide_not = String.join(",", disallowSlide); String slide_not = String.join(",", disallowSlide);
boolean writeSucceed = Settings.System.putString(crv, "qch_disable_slide", slide_not); boolean writeSucceed = Settings.System.putString(crv, CommonConfig.AOLE_ACTION_DISABLE_SLIDE, slide_not);
Log.e("fht", "qch_disable_slide=" + writeSucceed + ":" + slide_not); Log.e("fht", "aole_disable_slide=" + writeSucceed + ":" + slide_not);
} else { } else {
String slide_ok = String.join(",", allowSlide); String slide_ok = String.join(",", allowSlide);
boolean writeSucceed = Settings.System.putString(crv, "qch_disable_slide", "Invalid"); boolean writeSucceed = Settings.System.putString(crv, CommonConfig.AOLE_ACTION_DISABLE_SLIDE, "Invalid");
Log.e("fht", "qch_disable_slide ok=" + writeSucceed + ":" + slide_ok); Log.e("fht", "aole_disable_slide ok=" + writeSucceed + ":" + slide_ok);
} }
String[] upgrade_ok = new String[allowUpgrade.size()]; String[] upgrade_ok = new String[allowUpgrade.size()];
@@ -525,19 +534,19 @@ public class JGYUtils {
String[] upgrade_not = new String[disallowUpgrade.size()]; String[] upgrade_not = new String[disallowUpgrade.size()];
disallowUpgrade.toArray(upgrade_not); disallowUpgrade.toArray(upgrade_not);
Utils.writeDisableUpdateList(mContext, upgrade_not, upgrade_ok); Utils.writeDisableUpdateList(mContext, upgrade_not, upgrade_ok);
String qch_app_power_on = String.join(",", autoLaunchApp); String aole_app_power_on = String.join(",", autoLaunchApp);
Log.e(TAG, "setNetAndlaunch: qch_app_power_on: " + qch_app_power_on); Log.e(TAG, "setNetAndlaunch: aole_app_power_on: " + aole_app_power_on);
if (TextUtils.isEmpty(qch_app_power_on)) { if (TextUtils.isEmpty(aole_app_power_on)) {
//当 qch_app_power_on 的值为空时,会造成系统所有应用断网 //当 qch_app_power_on 的值为空时,会造成系统所有应用断网
Settings.System.putString(crv, "qch_app_power_on", "Invalid"); Settings.System.putString(crv, CommonConfig.AOLE_ACTION_APP_POWER_ON, "Invalid");
Log.e(TAG, "setNetAndlaunch: qch_app_power_on: " + "Invalid"); Log.e(TAG, "setNetAndlaunch: aole_app_power_on: " + "Invalid");
} else { } else {
Settings.System.putString(crv, "qch_app_power_on", qch_app_power_on); Settings.System.putString(crv, CommonConfig.AOLE_ACTION_APP_POWER_ON, aole_app_power_on);
Log.e(TAG, "setNetAndlaunch: qch_app_power_on: " + qch_app_power_on); Log.e(TAG, "setNetAndlaunch: aole_app_power_on: " + aole_app_power_on);
} }
// if (BuildConfig.DEBUG) { // if (BuildConfig.DEBUG) {
// TODO: 2021/7/2 测试写入为空是否断网 // TODO: 2021/7/2 测试写入为空是否断网
// boolean w = Settings.System.putString(crv, "qch_app_power_on", ""); // boolean w = Settings.System.putString(crv, "aole_app_power_on", "");
// Log.e(TAG, "setNetAndlaunch: 测试写入: " + w); // Log.e(TAG, "setNetAndlaunch: 测试写入: " + w);
// } // }
setAppNetwork(mContext, disallowNetApp); setAppNetwork(mContext, disallowNetApp);
@@ -545,84 +554,86 @@ public class JGYUtils {
@SuppressLint("NewApi") @SuppressLint("NewApi")
synchronized public static void setAppNetwork(Context context, HashSet<String> blackList) { synchronized public static void setAppNetwork(Context context, HashSet<String> blackList) {
ContentResolver contentResolver = context.getContentResolver();
Log.e(TAG, "setAppNetwork: " + "设置应用联网管控" + blackList); Log.e(TAG, "setAppNetwork: " + "设置应用联网管控" + blackList);
String dis = Settings.System.getString(context.getContentResolver(), JGYActions.ACTION_HRRECEIVER_JGY_DIS); // String dis = Settings.System.getString(contentResolver, CommonConfig.AOLE_ACTION_NETWORK_DISALLOW);
String not = Settings.System.getString(context.getContentResolver(), JGYActions.ACTION_HRRECEIVER_JGY); // String not = Settings.System.getString(contentResolver, CommonConfig.AOLE_ACTION_NETWORK_ALLOW);
//清除旧数据 // //清除旧数据
if (!TextUtils.isEmpty(dis)) { // if (!TextUtils.isEmpty(dis)) {
Log.e(TAG, "setAppNetwork: dis = " + dis); // Log.e(TAG, "setAppNetwork: dis = " + dis);
Settings.System.putString(context.getContentResolver(), JGYActions.ACTION_HRRECEIVER_JGY_DIS, "Invalid"); // Settings.System.putString(contentResolver, CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, "Invalid");
} // }
if (!TextUtils.isEmpty(not)) { // if (!TextUtils.isEmpty(not)) {
Log.e(TAG, "setAppNetwork: not = " + not); // Log.e(TAG, "setAppNetwork: not = " + not);
Settings.System.putString(context.getContentResolver(), JGYActions.ACTION_HRRECEIVER_JGY, "Invalid"); // Settings.System.putString(contentResolver, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, "Invalid");
} // }
String oldBlackList = (String) SPUtils.get(context, JGYActions.ACTION_HRRECEIVER_JGY_DIS, ""); // String oldBlackList = Settings.System.getString(contentResolver, CommonConfig.AOLE_ACTION_NETWORK_DISALLOW);
HashSet<String> oldBlackListSet = new HashSet<>(Arrays.asList(oldBlackList.split(","))); // HashSet<String> oldBlackListSet = new HashSet<>(Arrays.asList(oldBlackList.split(",")));
oldBlackListSet.removeIf(s -> TextUtils.isEmpty(s.trim())); // oldBlackListSet.removeIf(s -> TextUtils.isEmpty(s.trim()));
//之前禁止上网得列表 // //之前禁止上网得列表
Log.e(TAG, "setAppNetwork: oldBlackListSet: " + oldBlackListSet); // Log.e(TAG, "setAppNetwork: oldBlackListSet: " + oldBlackListSet);
if (oldBlackListSet.size() == 0) { // if (oldBlackListSet.size() == 0) {
Log.e(TAG, "setAppNetwork: blackList: " + blackList); // Log.e(TAG, "setAppNetwork: blackList: " + blackList);
for (String pkg : new HashSet<>(blackList)) { // for (String pkg : new HashSet<>(blackList)) {
if (TextUtils.isEmpty(pkg)) continue; // if (TextUtils.isEmpty(pkg)) continue;
//发送没有安装的 // //发送没有安装的
if (!ApkUtils.isAvailable(context, pkg)) { // if (!ApkUtils.isAvailable(context, pkg)) {
Log.e(TAG, "setAppNetwork: skip: " + pkg); // Log.e(TAG, "setAppNetwork: skip: " + pkg);
blackList.remove(pkg); // blackList.remove(pkg);
continue; // continue;
} else { // } else {
Log.e(TAG, "setAppNetwork: " + pkg + " 已安装"); // Log.e(TAG, "setAppNetwork: " + pkg + " 已安装");
} // }
Intent netControlNotIntent = new Intent(JGYActions.ACTION_HRRECEIVER_JGY_DIS); // Intent netControlNotIntent = new Intent(CommonConfig.AOLE_ACTION_NETWORK_DISALLOW);
netControlNotIntent.putExtra("package_name", pkg); // netControlNotIntent.putExtra("package_name", pkg);
netControlNotIntent.setPackage("com.android.settings"); // netControlNotIntent.setPackage("com.android.settings");
context.sendBroadcast(netControlNotIntent); // context.sendBroadcast(netControlNotIntent);
} // }
} else { // } else {
//减少的 // //减少的
Set<String> removedNet = oldBlackListSet; // Set<String> removedNet = oldBlackListSet;
//增加的 // //增加的
Set<String> addedNet = new HashSet<>(); // Set<String> addedNet = new HashSet<>();
for (String pkg : blackList) { // for (String pkg : blackList) {
if (TextUtils.isEmpty(pkg)) continue; // if (TextUtils.isEmpty(pkg)) continue;
if (removedNet.contains(pkg)) { // if (removedNet.contains(pkg)) {
removedNet.remove(pkg); // removedNet.remove(pkg);
} else { // } else {
addedNet.add(pkg); // addedNet.add(pkg);
} // }
} // }
//
Log.e(TAG, "setAppNetwork: removedNet: " + removedNet); // Log.e(TAG, "setAppNetwork: removedNet: " + removedNet);
Log.e(TAG, "setAppNetwork: addedNet: " + addedNet); // Log.e(TAG, "setAppNetwork: addedNet: " + addedNet);
for (String pkg : removedNet) { // for (String pkg : removedNet) {
if (TextUtils.isEmpty(pkg)) continue; // if (TextUtils.isEmpty(pkg)) continue;
Intent netControlNotIntent = new Intent(JGYActions.ACTION_HRRECEIVER_JGY); // Settings.System.putString(contentResolver, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, pkg);
netControlNotIntent.putExtra("package_name", pkg); // Intent netControlNotIntent = new Intent(CommonConfig.AOLE_ACTION_NETWORK_ALLOW);
netControlNotIntent.setPackage("com.android.settings"); // netControlNotIntent.putExtra("package_name", pkg);
context.sendBroadcast(netControlNotIntent); // netControlNotIntent.setPackage("com.android.settings");
} // context.sendBroadcast(netControlNotIntent);
for (String pkg : addedNet) { // }
if (TextUtils.isEmpty(pkg)) continue; // for (String pkg : addedNet) {
if (!ApkUtils.isAvailable(context, pkg)) { // if (TextUtils.isEmpty(pkg)) continue;
Log.e(TAG, "setAppNetwork: skip: " + pkg); // if (!ApkUtils.isAvailable(context, pkg)) {
blackList.remove(pkg); // Log.e(TAG, "setAppNetwork: skip: " + pkg);
continue; // blackList.remove(pkg);
} else { // continue;
Log.e(TAG, "setAppNetwork: " + pkg + " 已安装"); // } else {
} // Log.e(TAG, "setAppNetwork: " + pkg + " 已安装");
Intent netControlNotIntent = new Intent(JGYActions.ACTION_HRRECEIVER_JGY_DIS); // }
netControlNotIntent.putExtra("package_name", pkg); // Intent netControlNotIntent = new Intent(CommonConfig.AOLE_ACTION_NETWORK_DISALLOW);
netControlNotIntent.setPackage("com.android.settings"); // netControlNotIntent.putExtra("package_name", pkg);
context.sendBroadcast(netControlNotIntent); // netControlNotIntent.setPackage("com.android.settings");
} // context.sendBroadcast(netControlNotIntent);
} // }
// }
String net_not = String.join(",", blackList); String net_not = String.join(",", blackList);
SPUtils.put(context, JGYActions.ACTION_HRRECEIVER_JGY_DIS, net_not); SPUtils.put(context, CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, net_not);
//Settings.System.putString(crv, JGYActions.ACTION_HrReceiver_JGY_DIS, net_not); Settings.System.putString(contentResolver, CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, net_not);
Log.e("fht", "not::" + net_not); Log.e(TAG, "setAppNetwork: " + net_not);
//Intent netControlIntent = new Intent(CommonDatas.ACTION_HrReceiver_JGY_DIS); //Intent netControlIntent = new Intent(CommonDatas.ACTION_HrReceiver_JGY_DIS);
//netControlIntent.putExtra("package_name", net_not); //netControlIntent.putExtra("package_name", net_not);
@@ -635,7 +646,7 @@ public class JGYUtils {
@SuppressLint("NewApi") @SuppressLint("NewApi")
synchronized public void onBootSendNetwork() { synchronized public void onBootSendNetwork() {
String oldBlackListString = (String) SPUtils.get(mContext, JGYActions.ACTION_HRRECEIVER_JGY_DIS, ""); String oldBlackListString = (String) SPUtils.get(mContext, CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, "");
HashSet<String> oldBlackListSet = new HashSet<>(Arrays.asList(oldBlackListString.split(","))); HashSet<String> oldBlackListSet = new HashSet<>(Arrays.asList(oldBlackListString.split(",")));
Log.e(TAG, "setAppNetwork: oldBlackListSet: " + oldBlackListSet); Log.e(TAG, "setAppNetwork: oldBlackListSet: " + oldBlackListSet);
oldBlackListSet.removeIf(new Predicate<String>() { oldBlackListSet.removeIf(new Predicate<String>() {
@@ -650,7 +661,7 @@ public class JGYUtils {
Log.e(TAG, "setAppNetwork: skip: " + pkg); Log.e(TAG, "setAppNetwork: skip: " + pkg);
continue; continue;
} }
Intent netControlNotIntent = new Intent(JGYActions.ACTION_HRRECEIVER_JGY_DIS); Intent netControlNotIntent = new Intent(CommonConfig.AOLE_ACTION_NETWORK_DISALLOW);
netControlNotIntent.putExtra("package_name", pkg); netControlNotIntent.putExtra("package_name", pkg);
netControlNotIntent.setPackage("com.android.settings"); netControlNotIntent.setPackage("com.android.settings");
mContext.sendBroadcast(netControlNotIntent); mContext.sendBroadcast(netControlNotIntent);
@@ -684,22 +695,20 @@ public class JGYUtils {
packageStringBuilder.append(pkg); packageStringBuilder.append(pkg);
} }
String olddeselectViewArray = Settings.System.getString(crv, CommonConfig.AOLE_ACTION_APP_FORBID_ID);
String olddeselectViewArray = Settings.System.getString(crv, "qch_app_forbid_id");
Log.e("writeDeselectIDtoSystem", "olddeselectViewArray: " + olddeselectViewArray); Log.e("writeDeselectIDtoSystem", "olddeselectViewArray: " + olddeselectViewArray);
Settings.System.putString(crv, "qch_app_forbid_id", packageStringBuilder.toString()); Settings.System.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID_ID, packageStringBuilder.toString());
Settings.System.putString(crv, "DeselectViewArray", idStringBuilder.toString()); Settings.System.putString(crv, "DeselectViewArray", idStringBuilder.toString());
Log.e("writeDeselectIDtoSystem", "qch_app_forbid_id: " + packageStringBuilder.toString()); Log.e("writeDeselectIDtoSystem", "aole_app_forbid_id: " + packageStringBuilder.toString());
Log.e("writeDeselectIDtoSystem", "deselectViewArray: " + idStringBuilder.toString()); Log.e("writeDeselectIDtoSystem", "deselectViewArray: " + idStringBuilder.toString());
} else { } else {
Log.e("writeDeselectIDtoSystem", "writeDeselectIDtoSystem is null:"); Log.e("writeDeselectIDtoSystem", "writeDeselectIDtoSystem is null:");
Settings.System.putString(crv, "qch_app_forbid_id", ""); Settings.System.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID_ID, "");
Settings.System.putString(crv, "DeselectViewArray", ""); Settings.System.putString(crv, "DeselectViewArray", "");
} }
} }
synchronized public void setAppinsideWeb(BaseResponse<List<Appground>> response) { synchronized public void setAppinsideWeb(BaseResponse<List<Appground>> response) {
if (response.code == 200) { if (response.code == 200) {
List<Appground> appgrounds = response.data; List<Appground> appgrounds = response.data;
@@ -1100,10 +1109,10 @@ public class JGYUtils {
HashSet<String> pkgSet = new HashSet<>(Arrays.asList(packageList.split(","))); HashSet<String> pkgSet = new HashSet<>(Arrays.asList(packageList.split(",")));
pkgSet.addAll(packages); pkgSet.addAll(packages);
pkgSet.removeIf(TextUtils::isEmpty); pkgSet.removeIf(TextUtils::isEmpty);
String qch_app_forbid = String.join(",", pkgSet); String aole_app_forbid = String.join(",", pkgSet);
Log.e(TAG, "writeAppPackageList: " + qch_app_forbid); Log.e(TAG, "writeAppPackageList: " + aole_app_forbid);
boolean b = Settings.System.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID, qch_app_forbid); boolean b = Settings.System.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID, aole_app_forbid);
Log.e("writeAppPackageList: ", "qch_app_forbid is :" + b + " " + Settings.System.getString(crv, CommonConfig.AOLE_ACTION_APP_FORBID)); Log.e("writeAppPackageList: ", "aole_app_forbid: " + b + " " + Settings.System.getString(crv, CommonConfig.AOLE_ACTION_APP_FORBID));
} }
public void checkForceDownload() { public void checkForceDownload() {
@@ -1122,6 +1131,7 @@ public class JGYUtils {
} }
} }
public void forceDownload(List<ForceDownloadData> data) { public void forceDownload(List<ForceDownloadData> data) {
if (data == null || data.size() <= 0) { if (data == null || data.size() <= 0) {
return; return;
@@ -1314,12 +1324,12 @@ public class JGYUtils {
result_white = only_jgy_shortcut_list.split(","); result_white = only_jgy_shortcut_list.split(",");
} }
//获取可以被安装的包名 //获取可以被安装的包名
String qch_app_forbid = Settings.System.getString(crv, CommonConfig.AOLE_ACTION_APP_FORBID); String aole_app_forbid = Settings.System.getString(crv, CommonConfig.AOLE_ACTION_APP_FORBID);
if (!TextUtils.isEmpty(qch_app_forbid)) { if (!TextUtils.isEmpty(aole_app_forbid)) {
result_forbid = qch_app_forbid.split(","); result_forbid = aole_app_forbid.split(",");
} }
Log.e("deleteOtherApp", "only_jgy_shortcut_list:" + only_jgy_shortcut_list); Log.e("deleteOtherApp", "only_jgy_shortcut_list:" + only_jgy_shortcut_list);
Log.e("deleteOtherApp", "qch_app_forbid:" + qch_app_forbid); Log.e("deleteOtherApp", "aole_app_forbid:" + aole_app_forbid);
List<String> resulWhitetList = new ArrayList<>(Arrays.asList(result_white)); List<String> resulWhitetList = new ArrayList<>(Arrays.asList(result_white));
List<String> resulForbidtList = new ArrayList<>(Arrays.asList(result_forbid)); List<String> resulForbidtList = new ArrayList<>(Arrays.asList(result_forbid));
@@ -1409,6 +1419,8 @@ public class JGYUtils {
Log.e(TAG, "hideSystemAPP: " + pkg); Log.e(TAG, "hideSystemAPP: " + pkg);
if (ApkUtils.isSystemApp(mContext, pkg)) { if (ApkUtils.isSystemApp(mContext, pkg)) {
pm.setApplicationEnabledSetting(pkg, PackageManager.COMPONENT_ENABLED_STATE_DEFAULT, 0); pm.setApplicationEnabledSetting(pkg, PackageManager.COMPONENT_ENABLED_STATE_DEFAULT, 0);
} else {
continue;
} }
if (!showAppList.contains(pkg) && !ApkUtils.aihuaApp.contains(pkg)) { if (!showAppList.contains(pkg) && !ApkUtils.aihuaApp.contains(pkg)) {
pm.setApplicationEnabledSetting(pkg, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0); pm.setApplicationEnabledSetting(pkg, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
@@ -1550,7 +1562,7 @@ public class JGYUtils {
public void setDeveloperOptions(int state) { public void setDeveloperOptions(int state) {
Log.e(TAG, "getDeveloper: " + state); Log.e(TAG, "getDeveloper: " + state);
if (!BuildConfig.DEBUG) { if (!BuildConfig.DEBUG) {
Settings.System.putInt(crv, "qch_Developeroptions", state); Settings.System.putInt(crv, CommonConfig.AOLE_ACTION_DEVELOPER_OPTIONS, state);
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.ZhanruiPlatform) { if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.ZhanruiPlatform) {
Settings.Global.putInt(crv, Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, state == 1 ? 0 : 1); Settings.Global.putInt(crv, Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, state == 1 ? 0 : 1);
Settings.Global.putInt(crv, Settings.Global.ADB_ENABLED, state == 1 ? 0 : 1); Settings.Global.putInt(crv, Settings.Global.ADB_ENABLED, state == 1 ? 0 : 1);
@@ -1948,6 +1960,7 @@ public class JGYUtils {
} }
} catch (java.lang.SecurityException e) { } catch (java.lang.SecurityException e) {
e.printStackTrace(); e.printStackTrace();
Log.e(TAG, "setDefaultLauncher: " + e.getMessage());
} }
} }
@@ -2044,8 +2057,11 @@ public class JGYUtils {
public void setDefaultDesktop(String pkg, String className) { public void setDefaultDesktop(String pkg, String className) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
setRoleHolderAsUser(mContext, pkg); setRoleHolderAsUser(mContext, pkg);
Log.e(TAG, "setDefaultDesktop: setRoleHolderAsUser");
} else { } else {
setDefaultLauncher(mContext, pkg, className); //爱华设置,暂时屏蔽
// setDefaultLauncher(mContext, pkg, className);
Log.e(TAG, "setDefaultDesktop: setDefaultLauncher");
} }
String oldDesktop = (String) SPUtils.get(mContext, "default_launcher", ""); String oldDesktop = (String) SPUtils.get(mContext, "default_launcher", "");
if (Objects.equals(oldDesktop, pkg)) { if (Objects.equals(oldDesktop, pkg)) {
@@ -2055,10 +2071,17 @@ public class JGYUtils {
Intent intent = new Intent("setDefaultLauncher"); Intent intent = new Intent("setDefaultLauncher");
intent.putExtra("package", pkg); intent.putExtra("package", pkg);
intent.putExtra("className", className); intent.putExtra("className", className);
if (JGYUtils.getInstance().checkAppPlatform() == MTKPlatform) {
//爱华定制
intent.setComponent(new ComponentName("com.android.settings", "com.android.settings.AoleReceiver"));
setDefaultLauncher(mContext, "com.android.transfer", "com.android.transfer.MainActivity");
}
intent.setPackage("com.android.settings"); intent.setPackage("com.android.settings");
mContext.sendBroadcast(intent); mContext.sendBroadcast(intent);
ApkUtils.openPackage(mContext, pkg); ApkUtils.openPackage(mContext, pkg);
Log.e(TAG, "setDefaultDesktop: " + pkg + ":" + className); Log.e(TAG, "setDefaultDesktop: " + pkg + ":" + className);
Log.e(TAG, "setDefaultDesktop: " + "persist.sys.launcher.pkgname = " + SystemProperties.get("persist.sys.launcher.pkgname"));
Log.e(TAG, "setDefaultDesktop: " + "persist.sys.launcher.classname = " + SystemProperties.get("persist.sys.launcher.classname"));
} }
public String getMacJson(Context context) { public String getMacJson(Context context) {

View File

@@ -15,6 +15,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.aoleyun.sn.BuildConfig; import com.aoleyun.sn.BuildConfig;
import com.aoleyun.sn.comm.CommonConfig;
import com.aoleyun.sn.comm.JGYActions; import com.aoleyun.sn.comm.JGYActions;
import java.util.ArrayList; import java.util.ArrayList;
@@ -108,14 +109,14 @@ public class SysSettingUtils {
boolean qch_call_forbid = Settings.System.putInt(context.getContentResolver(), "qch_call_forbid", state); boolean qch_call_forbid = Settings.System.putInt(context.getContentResolver(), "qch_call_forbid", state);
Log.e(TAG, "qch_call_forbid:" + qch_call_forbid); Log.e(TAG, "qch_call_forbid:" + qch_call_forbid);
boolean qch_white_list_on = Settings.System.putInt(context.getContentResolver(), "qch_white_list_on", state); boolean aole_white_list_on = Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_WHITE_LIST_ON, state);
Log.e(TAG, "qch_white_list_on:" + qch_white_list_on); Log.e(TAG, "aole_white_list_on:" + aole_white_list_on);
boolean qch_white_list_Array = Settings.System.putString(context.getContentResolver(), "qch_white_list_Array", ""); boolean aole_white_list_Array = Settings.System.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_WHITE_LIST_ARRAY, "");
// ToastTool.show("qch_call_forbid::"+setting_call+"----setting_phones::"+setting_phones+"----"+qch_white_list_Array+"---"+qch_call_forbid); // ToastTool.show("qch_call_forbid::"+setting_call+"----setting_phones::"+setting_phones+"----"+aole_white_list_Array+"---"+qch_call_forbid);
Log.e(TAG, "qch_white_list_Array:" + qch_white_list_Array + "---" + qch_white_list_Array); Log.e(TAG, "aole_white_list_Array:" + aole_white_list_Array);
boolean aole_sdcard_forbid_on = Settings.System.putInt(context.getContentResolver(), "aole_sdcard_forbid_on", state); boolean aole_sdcard_forbid_on = Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_SDCARD_FORBID_ON, state);
Log.e(TAG, "aole_sdcard_forbid_on:" + aole_sdcard_forbid_on); Log.e(TAG, "aole_sdcard_forbid_on:" + aole_sdcard_forbid_on);
} catch (Exception e) { } catch (Exception e) {
Log.e(TAG, "setPhoneList: " + e.getMessage()); Log.e(TAG, "setPhoneList: " + e.getMessage());
@@ -131,22 +132,22 @@ public class SysSettingUtils {
Log.e(TAG, "qch_call_forbid:" + qch_call_forbid); Log.e(TAG, "qch_call_forbid:" + qch_call_forbid);
//电话白名单开关 //电话白名单开关
int setting_phone = changeNum(jsonObject.getInteger("setting_phone")); int setting_phone = changeNum(jsonObject.getInteger("setting_phone"));
boolean qch_white_list_on = Settings.System.putInt(context.getContentResolver(), "qch_white_list_on", setting_phone); boolean aole_white_list_on = Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_WHITE_LIST_ON, setting_phone);
Log.e(TAG, "qch_white_list_on:" + qch_white_list_on); Log.e(TAG, "aole_white_list_on:" + aole_white_list_on);
//白名单列表 //白名单列表
if (setting_phone == 1) { if (setting_phone == 1) {
boolean qch_white_list_Array = Settings.System.putString(context.getContentResolver(), "qch_white_list_Array", "empty"); boolean aole_white_list_Array = Settings.System.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_WHITE_LIST_ARRAY, "empty");
// ToastTool.show("qch_call_forbid::"+setting_call+"----setting_phones::"+setting_phones+"----"+qch_white_list_Array+"---"+qch_call_forbid); // ToastTool.show("qch_call_forbid::"+setting_call+"----setting_phones::"+setting_phones+"----"+aole_white_list_Array+"---"+qch_call_forbid);
Log.e(TAG, "qch_white_list_Array:" + qch_white_list_Array); Log.e(TAG, "aole_white_list_Array:" + aole_white_list_Array);
} else { } else {
String setting_phones = jsonObject.getString("setting_phones"); String setting_phones = jsonObject.getString("setting_phones");
boolean qch_white_list_Array = Settings.System.putString(context.getContentResolver(), "qch_white_list_Array", setting_phones); boolean aole_white_list_Array = Settings.System.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_WHITE_LIST_ARRAY, setting_phones);
// ToastTool.show("qch_call_forbid::"+setting_call+"----setting_phones::"+setting_phones+"----"+qch_white_list_Array+"---"+qch_call_forbid); // ToastTool.show("qch_call_forbid::"+setting_call+"----setting_phones::"+setting_phones+"----"+aole_white_list_Array+"---"+qch_call_forbid);
Log.e(TAG, "qch_white_list_Array:" + qch_white_list_Array + "---" + setting_phones); Log.e(TAG, "aole_white_list_Array:" + aole_white_list_Array + "---" + setting_phones);
} }
//存储卡 //存储卡
int setting_memory = changeNum(jsonObject.getInteger("setting_memory")); int setting_memory = changeNum(jsonObject.getInteger("setting_memory"));
boolean aole_sdcard_forbid_on = Settings.System.putInt(context.getContentResolver(), "aole_sdcard_forbid_on", setting_memory); boolean aole_sdcard_forbid_on = Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_SDCARD_FORBID_ON, setting_memory);
Log.e(TAG, "aole_sdcard_forbid_on:" + aole_sdcard_forbid_on); Log.e(TAG, "aole_sdcard_forbid_on:" + aole_sdcard_forbid_on);
} catch (Exception e) { } catch (Exception e) {
Log.e(TAG, "setPhoneList: " + e.getMessage()); Log.e(TAG, "setPhoneList: " + e.getMessage());
@@ -164,7 +165,7 @@ public class SysSettingUtils {
mService.setUSBDataDisabled(true); mService.setUSBDataDisabled(true);
boolean aole_usb_choose = Settings.System.putString(context.getContentResolver(), "aole_usb_choose", "usb_charge"); boolean aole_usb_choose = Settings.System.putString(context.getContentResolver(), "aole_usb_choose", "usb_charge");
Log.e(TAG, "aole_usb_choose:" + aole_usb_choose); Log.e(TAG, "aole_usb_choose:" + aole_usb_choose);
String usbStatus = "aole_action_usb_usb_charge"; String usbStatus = CommonConfig.AOLE_ACTION_USB_USB_CHARGE;
Intent usbIntent = new Intent(usbStatus).setPackage("com.android.settings"); Intent usbIntent = new Intent(usbStatus).setPackage("com.android.settings");
context.sendBroadcast(usbIntent); context.sendBroadcast(usbIntent);
} catch (NoClassDefFoundError | Exception e) { } catch (NoClassDefFoundError | Exception e) {
@@ -193,17 +194,17 @@ public class SysSettingUtils {
} }
} else { } else {
boolean aole_usb_choose = Settings.System.putString(context.getContentResolver(), "aole_usb_choose", setting_usb); boolean aole_usb_choose = Settings.System.putString(context.getContentResolver(), "aole_usb_choose", setting_usb);
Log.e("setUSBstate", "aole_usb_choose---------" + aole_usb_choose); Log.e("setUSBstate", "aole_usb_choose: " + aole_usb_choose);
String usbStatus = "aole_action_usb_usb_charge"; String usbStatus = CommonConfig.AOLE_ACTION_USB_USB_CHARGE;
switch (setting_usb) { switch (setting_usb) {
case "usb_charge": case "usb_charge":
usbStatus = "aole_action_usb_usb_charge"; usbStatus = CommonConfig.AOLE_ACTION_USB_USB_CHARGE;
break; break;
case "usb_mtp": case "usb_mtp":
usbStatus = "aole_action_usb_usb_mtp"; usbStatus = CommonConfig.AOLE_ACTION_USB_USB_MTP;
break; break;
case "usb_midi": case "usb_midi":
usbStatus = "aole_action_usb_usb_midi"; usbStatus = CommonConfig.AOLE_ACTION_USB_USB_MIDI;
break; break;
default: default:
} }
@@ -215,19 +216,19 @@ public class SysSettingUtils {
private static void setBluetooth(Context context, int state) { private static void setBluetooth(Context context, int state) {
try { try {
boolean qch_bht_forbid_on = Settings.System.putInt(context.getContentResolver(), "qch_bht_forbid_on", state); boolean aole_bht_forbid_on = Settings.System.putInt(context.getContentResolver(), 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(); BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
if (qch_bht_forbid_on) { if (aole_bht_forbid_on) {
//成功 //成功
if (null == mBluetoothAdapter) { if (null == mBluetoothAdapter) {
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
//获取默认蓝牙适配器 //获取默认蓝牙适配器
} }
//蓝牙总开关开启 //蓝牙总开关开启
Settings.System.putString(context.getContentResolver(), "qch_bhtvideo_forbid_on", "Empty"); Settings.System.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_BHTVIDEO_FORBID_ON, "Empty");
Settings.System.putInt(context.getContentResolver(), "qch_bt_forbid_on", state); Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_BT_FORBID_ON, state);
mBluetoothAdapter.disable(); mBluetoothAdapter.disable();
//设置关闭时关闭蓝牙 //设置关闭时关闭蓝牙
} }
@@ -245,11 +246,11 @@ public class SysSettingUtils {
//蓝牙音频开关 //蓝牙音频开关
int setting_bluetooth = changeNum(jsonObject.getInteger("setting_bluetooth")); int setting_bluetooth = changeNum(jsonObject.getInteger("setting_bluetooth"));
//蓝牙传输开关 //蓝牙传输开关
boolean qch_bht_forbid_on = Settings.System.putInt(context.getContentResolver(), "qch_bht_forbid_on", setting_bht); boolean aole_bht_forbid_on = Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_BHT_FORBID_ON, setting_bht);
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(); BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
if (qch_bht_forbid_on) { if (aole_bht_forbid_on) {
//成功 //成功
if (null == mBluetoothAdapter) { if (null == mBluetoothAdapter) {
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
@@ -261,14 +262,14 @@ public class SysSettingUtils {
if (setting_bhtvideo == 0) { if (setting_bhtvideo == 0) {
if (null != setting_context && !"".equals(setting_context) && !" ".equals(setting_context) && !"null".equals(setting_context)) { if (null != setting_context && !"".equals(setting_context) && !" ".equals(setting_context) && !"null".equals(setting_context)) {
Log.e(TAG, "setting_context:" + setting_context); Log.e(TAG, "setting_context:" + setting_context);
Settings.System.putString(context.getContentResolver(), "qch_bhtvideo_forbid_on", setting_context); Settings.System.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_BHTVIDEO_FORBID_ON, setting_context);
} else { } else {
Settings.System.putString(context.getContentResolver(), "qch_bhtvideo_forbid_on", "Empty"); Settings.System.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_BHTVIDEO_FORBID_ON, "Empty");
} }
} else if (setting_bhtvideo == 1) { } else if (setting_bhtvideo == 1) {
Settings.System.putString(context.getContentResolver(), "qch_bhtvideo_forbid_on", "Empty"); Settings.System.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_BHTVIDEO_FORBID_ON, "Empty");
} }
Settings.System.putInt(context.getContentResolver(), "qch_bt_forbid_on", setting_bluetooth); Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_BT_FORBID_ON, setting_bluetooth);
} else { } else {
mBluetoothAdapter.disable(); mBluetoothAdapter.disable();
//设置关闭时关闭蓝牙 //设置关闭时关闭蓝牙
@@ -285,8 +286,8 @@ public class SysSettingUtils {
intent.setAction("qch_hotspot_close"); intent.setAction("qch_hotspot_close");
intent.setPackage("com.android.settings"); intent.setPackage("com.android.settings");
context.sendStickyBroadcast(intent); context.sendStickyBroadcast(intent);
boolean qch_hotspot_forbid_on = Settings.System.putInt(context.getContentResolver(), "qch_hotspot_forbid_on", state); boolean aole_hotspot_forbid_on = Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_HOTSPOT_FORBID_ON, state);
Log.e(TAG, "qch_hotspot_forbid_on:" + qch_hotspot_forbid_on); Log.e(TAG, "aole_hotspot_forbid_on:" + aole_hotspot_forbid_on);
} catch (Exception e) { } catch (Exception e) {
Log.e(TAG, "setHotspot: " + e.getMessage()); Log.e(TAG, "setHotspot: " + e.getMessage());
} }
@@ -301,9 +302,9 @@ public class SysSettingUtils {
intent.setPackage("com.android.settings"); intent.setPackage("com.android.settings");
context.sendStickyBroadcast(intent); context.sendStickyBroadcast(intent);
} }
boolean qch_hotspot_forbid_on = Settings.System.putInt(context.getContentResolver(), "qch_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(TAG, "qch_hotspot_forbid_on---------" + setting_hotspot); Log.e(TAG, "aole_hotspot_forbid_on---------" + setting_hotspot);
Log.e(TAG, "qch_hotspot_forbid_on---------" + qch_hotspot_forbid_on); Log.e(TAG, "aole_hotspot_forbid_on---------" + aole_hotspot_forbid_on);
} catch (Exception e) { } catch (Exception e) {
Log.e(TAG, "setHotspot: " + e.getMessage()); Log.e(TAG, "setHotspot: " + e.getMessage());
} }
@@ -313,16 +314,16 @@ public class SysSettingUtils {
//系统导航条显示开关 //系统导航条显示开关
int setting_navigation = 0; int setting_navigation = 0;
//写入到系统不涉及任何管控,因为之前调用会频繁隐藏显示 //写入到系统不涉及任何管控,因为之前调用会频繁隐藏显示
boolean qch_hide_navigationBar = Settings.System.putInt(context.getContentResolver(), "qch_hide_NavigationBar", setting_navigation); boolean aole_hide_NavigationBar = Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_HIDE_NAVIGATION_BAR, setting_navigation);
Log.e(TAG, "qch_hide_navigationBar---------" + qch_hide_navigationBar); Log.e(TAG, "aole_hide_NavigationBar---------" + aole_hide_NavigationBar);
String navigationStatus = ""; String navigationStatus = "";
switch (setting_navigation) { switch (setting_navigation) {
case 0: case 0:
navigationStatus = "qch_show_NavigationBar"; navigationStatus = CommonConfig.AOLE_ACTION_SHOW_NAVIGATION_BAR;
break; break;
case 1: case 1:
navigationStatus = "qch_hide_NavigationBar"; navigationStatus = CommonConfig.AOLE_ACTION_HIDE_NAVIGATION_BAR;
break; break;
} }
@@ -332,18 +333,18 @@ public class SysSettingUtils {
//状态栏显示开关 //状态栏显示开关
int setting_statusbar = 0; int setting_statusbar = 0;
int oldNum = Settings.System.getInt(context.getContentResolver(), "qch_hide_statusBar", 0); int oldNum = Settings.System.getInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR, 0);
if (oldNum != setting_statusbar) { if (oldNum != setting_statusbar) {
//写入到系统不涉及任何管控,因为之前调用会频繁隐藏显示 //写入到系统不涉及任何管控,因为之前调用会频繁隐藏显示
boolean qch_hide_statusBar = Settings.System.putInt(context.getContentResolver(), "qch_hide_statusBar", setting_statusbar); boolean aole_hide_statusBar = Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR, setting_statusbar);
Log.e(TAG, "qch_hide_statusBar---------" + qch_hide_statusBar); Log.e(TAG, "aole_hide_statusBar: " + aole_hide_statusBar);
String statusbarStatus = ""; String statusbarStatus = "";
switch (setting_statusbar) { switch (setting_statusbar) {
case 0: case 0:
statusbarStatus = "qch_show_statusBar"; statusbarStatus = CommonConfig.AOLE_ACTION_SHOW_STATUS_BAR;
break; break;
case 1: case 1:
statusbarStatus = "qch_hide_statusBar"; statusbarStatus = CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR;
break; break;
} }
Intent statusIntent = new Intent(statusbarStatus).setPackage("com.android.systemui"); Intent statusIntent = new Intent(statusbarStatus).setPackage("com.android.systemui");
@@ -355,16 +356,16 @@ public class SysSettingUtils {
//系统导航条显示开关 //系统导航条显示开关
int setting_navigation = changeNum(jsonObject.getInteger("setting_navigation")); int setting_navigation = changeNum(jsonObject.getInteger("setting_navigation"));
//写入到系统不涉及任何管控,因为之前调用会频繁隐藏显示 //写入到系统不涉及任何管控,因为之前调用会频繁隐藏显示
boolean qch_hide_navigationBar = Settings.System.putInt(context.getContentResolver(), "qch_hide_NavigationBar", setting_navigation); boolean aole_hide_NavigationBar = Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_HIDE_NAVIGATION_BAR, setting_navigation);
Log.e(TAG, "qch_hide_navigationBar---------" + qch_hide_navigationBar); Log.e(TAG, "aole_hide_NavigationBar---------" + aole_hide_NavigationBar);
String navigationStatus = ""; String navigationStatus = "";
switch (setting_navigation) { switch (setting_navigation) {
case 0: case 0:
navigationStatus = "qch_show_NavigationBar"; navigationStatus = CommonConfig.AOLE_ACTION_SHOW_NAVIGATION_BAR;
break; break;
case 1: case 1:
navigationStatus = "qch_hide_NavigationBar"; navigationStatus = CommonConfig.AOLE_ACTION_HIDE_NAVIGATION_BAR;
break; break;
} }
Intent navIntent = new Intent(navigationStatus).setPackage("com.android.systemui"); Intent navIntent = new Intent(navigationStatus).setPackage("com.android.systemui");
@@ -373,18 +374,18 @@ public class SysSettingUtils {
//状态栏显示开关 //状态栏显示开关
int setting_statusbar = changeNum(jsonObject.getInteger("setting_statusbar")); int setting_statusbar = changeNum(jsonObject.getInteger("setting_statusbar"));
int oldNum = Settings.System.getInt(context.getContentResolver(), "qch_hide_statusBar", 0); int oldNum = Settings.System.getInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR, 0);
if (oldNum != setting_statusbar) { if (oldNum != setting_statusbar) {
//写入到系统不涉及任何管控,因为之前调用会频繁隐藏显示 //写入到系统不涉及任何管控,因为之前调用会频繁隐藏显示
boolean qch_hide_statusBar = Settings.System.putInt(context.getContentResolver(), "qch_hide_statusBar", setting_statusbar); boolean aole_hide_statusBar = Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR, setting_statusbar);
Log.e(TAG, "qch_hide_statusBar---------" + qch_hide_statusBar); Log.e(TAG, "aole_hide_statusBar: " + aole_hide_statusBar);
String statusbarStatus = ""; String statusbarStatus = "";
switch (setting_statusbar) { switch (setting_statusbar) {
case 0: case 0:
statusbarStatus = "qch_show_statusBar"; statusbarStatus = CommonConfig.AOLE_ACTION_SHOW_STATUS_BAR;
break; break;
case 1: case 1:
statusbarStatus = "qch_hide_statusBar"; statusbarStatus = CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR;
break; break;
} }
Intent statusIntent = new Intent(statusbarStatus).setPackage("com.android.systemui"); Intent statusIntent = new Intent(statusbarStatus).setPackage("com.android.systemui");
@@ -607,8 +608,8 @@ public class SysSettingUtils {
} }
private static void setCanReset(Context context, int state) { private static void setCanReset(Context context, int state) {
boolean aole_restore_forbid_on = Settings.System.putInt(context.getContentResolver(), "aole_restore_forbid_on", 0); boolean aole_restore_forbid_on = Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_RESTORE_FORBID_ON, 0);
Log.e(TAG, "aole_restore_forbid_on:" + aole_restore_forbid_on); Log.e(TAG, "aole_restore_forbid_on: " + aole_restore_forbid_on);
//默认打开 //默认打开
} }
@@ -617,11 +618,11 @@ public class SysSettingUtils {
private static void setCanReset(Context context, JSONObject jsonObject) { private static void setCanReset(Context context, JSONObject jsonObject) {
int mode = jsonObject.getInteger("qch_restore"); int mode = jsonObject.getInteger("qch_restore");
if (mode == 1) { if (mode == 1) {
boolean aole_restore_forbid_on = Settings.System.putInt(context.getContentResolver(), "aole_restore_forbid_on", 0); boolean aole_restore_forbid_on = Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_RESTORE_FORBID_ON, 0);
Log.e(TAG, "aole_restore_forbid_on:" + aole_restore_forbid_on); Log.e(TAG, "aole_restore_forbid_on: " + aole_restore_forbid_on);
} else { } else {
boolean aole_restore_forbid_on = Settings.System.putInt(context.getContentResolver(), "aole_restore_forbid_on", 1); boolean aole_restore_forbid_on = Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_RESTORE_FORBID_ON, 1);
Log.e(TAG, "aole_restore_forbid_on:" + aole_restore_forbid_on); Log.e(TAG, "aole_restore_forbid_on: " + aole_restore_forbid_on);
} }
} }

View File

@@ -519,14 +519,14 @@ public class Utils {
public static void unInstallAPP(Context context, String packageName) { public static void unInstallAPP(Context context, String packageName) {
if (!TextUtils.isEmpty(packageName) && !ApkUtils.isSystemApp(context, packageName)) { if (!TextUtils.isEmpty(packageName) && !ApkUtils.isSystemApp(context, packageName)) {
if (ApkUtils.isSystemApp(context, packageName)) { if (ApkUtils.isSystemApp(context, packageName)) {
Toast.makeText(BaseApplication.getAppContext(), R.string.system_unistall_error, Toast.LENGTH_SHORT).show(); Toast.makeText(context, R.string.system_unistall_error, Toast.LENGTH_SHORT).show();
} else { } else {
Uri packageURI = Uri.parse("package:" + packageName); Uri packageURI = Uri.parse("package:" + packageName);
Intent intent = new Intent(Intent.ACTION_DELETE, packageURI); Intent intent = new Intent(Intent.ACTION_DELETE, packageURI);
context.startActivity(intent); context.startActivity(intent);
} }
} else { } else {
Toast.makeText(BaseApplication.getAppContext(), R.string.unistall_error, Toast.LENGTH_SHORT).show(); Toast.makeText(context, R.string.unistall_error, Toast.LENGTH_SHORT).show();
} }
} }
@@ -1097,7 +1097,7 @@ public class Utils {
list = list.substring(0, list.length() - 1); list = list.substring(0, list.length() - 1);
Log.e("fht", list); Log.e("fht", list);
writeSucceed = Settings.System.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID, list); writeSucceed = Settings.System.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID, list);
Log.e("fht", "qch_app_forbid:" + list); Log.e("fht", "aole_app_forbid:" + list);
} else { } else {
writeSucceed = Settings.System.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID, "Invalid"); writeSucceed = Settings.System.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID, "Invalid");
} }