1.4.0705 优化后台,增加全局黑名单

This commit is contained in:
2024-07-08 10:32:45 +08:00
parent 526914c64c
commit 343700837e
22 changed files with 524 additions and 106 deletions

View File

@@ -248,6 +248,10 @@ public class PushManager {
/*绑定设备*/
private static final String BIND_DEVICE = "71";
/*打开应用*/
private static final String OPEN_APK = "73";
/*全局黑名单*/
private static final String GLOBAL_BALCK_LIST = "74";
public void setPushContent(String title, String extras) {
@@ -646,6 +650,12 @@ public class PushManager {
case BIND_DEVICE:
bindService(extras);
break;
case OPEN_APK:
openApk(extras);
break;
case GLOBAL_BALCK_LIST:
NetInterfaceManager.getInstance().getBlackList();
break;
default:
}
}
@@ -874,7 +884,7 @@ public class PushManager {
String allow = jSONObject.get("not").getAsString();
HashSet<String> disallowApp = new HashSet<>(Arrays.asList(disallow.split(",")));
HashSet<String> allowApp = new HashSet<>(Arrays.asList(allow.split(",")));
JGYUtils.setAppNetwork(mContext, disallowApp, allowApp);
JGYUtils.getInstance().setAppNetwork(mContext, disallowApp, allowApp);
}
private void settingPowerOn(String s) {
@@ -1323,9 +1333,9 @@ public class PushManager {
pkgs.remove(pkg);
Log.e(TAG, "orderDeleteApp: pkgs = " + pkgs);
mMMKV.encode(DEBUG_APP_LIST, pkgs);
if (ApkUtils.isSystemApp(mContext,pkg)){
if (ApkUtils.isSystemApp(mContext, pkg)) {
JGYUtils.getInstance().hideApp(pkg);
}else {
} else {
ApkUtils.UninstallAPP(mContext, pkg);
}
}
@@ -1490,4 +1500,10 @@ public class PushManager {
intent.setPackage("com.teclast.zyos");
mContext.sendBroadcast(intent);
}
private void openApk(String extras) {
JsonObject jsonObject = GsonUtils.getJsonObject(extras);
String app_package = jsonObject.get("app_package").getAsString();
ApkUtils.openPackage(mContext, app_package);
}
}