version:6.4.1

fix:
update:去掉腾讯推送,增加保存电子书包激活码
This commit is contained in:
2023-08-14 10:31:06 +08:00
parent 8c948e62be
commit 03901123da
47 changed files with 565 additions and 1061 deletions

View File

@@ -93,6 +93,7 @@ import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Executor;
import java.util.function.Consumer;
import java.util.function.Predicate;
@@ -116,6 +117,8 @@ public class JGYUtils {
public static final int ZhanruiPlatform = 3;
public static final int MTK11Platform = 5;
public static final int TeclastP20sPlatform = 6;
public static final int AH6016Platform = 9;
public static final int ZR6016Platform = 10;
public static final String Other = "其他";
public static final String MTKTag = "MTK";
@@ -123,6 +126,9 @@ public class JGYUtils {
public static final String ZhanruiTag = "展锐";
public static final String MTK11Tag = "MTK11";
public static final String TeclastP20sTag = "P20S";
public static final String AH6016Tag = "AH6016";
public static final String ZR6016Tag = "ZR6016";
private CacheHelper cacheHelper;
@@ -186,6 +192,12 @@ public class JGYUtils {
} else if (TeclastP20sTag.equalsIgnoreCase(platform)) {
Log.i(TAG, "checkAppPlatform: " + "P20S");
return TeclastP20sPlatform;
} else if (AH6016Tag.equalsIgnoreCase(platform)) {
Log.i(TAG, "checkAppPlatform: " + "AH6016");
return AH6016Platform;
} else if (ZR6016Tag.equalsIgnoreCase(platform)) {
Log.i(TAG, "checkAppPlatform: " + "ZR6016");
return ZR6016Platform;
} else {
Log.i(TAG, "checkAppPlatform: " + "没有数据");
return UnknowPlatform;
@@ -217,6 +229,10 @@ public class JGYUtils {
getAppPlatformCallback.AppPlatform(MTK11Platform);
} else if (TeclastP20sTag.equalsIgnoreCase(platform)) {
getAppPlatformCallback.AppPlatform(TeclastP20sPlatform);
} else if (AH6016Tag.equalsIgnoreCase(platform)) {
getAppPlatformCallback.AppPlatform(AH6016Platform);
} else if (ZR6016Tag.equalsIgnoreCase(platform)) {
getAppPlatformCallback.AppPlatform(ZR6016Platform);
} else {
getAppPlatformCallback.AppPlatform(UnknowPlatform);
}
@@ -228,12 +244,16 @@ public class JGYUtils {
return MTKTag;
} else if ("ZhanRui".equalsIgnoreCase(platform)) {
return ZhanruiTag;
} else if ("ZhanRuiCube".equalsIgnoreCase(platform)) {
} else if (CubeTag.equalsIgnoreCase(platform)) {
return CubeTag;
} else if ("MTK11".equalsIgnoreCase(platform)) {
} else if (MTK11Tag.equalsIgnoreCase(platform)) {
return MTK11Tag;
} else if ("P20S".equalsIgnoreCase(platform)) {
} else if (TeclastP20sTag.equalsIgnoreCase(platform)) {
return TeclastP20sTag;
} else if (AH6016Tag.equalsIgnoreCase(platform)) {
return AH6016Tag;
} else if (ZR6016Tag.equalsIgnoreCase(platform)) {
return ZR6016Tag;
} else {
return Other;
}
@@ -1102,6 +1122,7 @@ public class JGYUtils {
this.add("com.aoleyun.os");
this.add("com.aoleyunos.dop1");
this.add("com.aoleyunos.dop2");
this.add("com.aoleyunos.dop3");
this.add("com.aoleyun.info");
this.add("com.calculator.uiui");
this.add("com.notepad.uiui");
@@ -1119,6 +1140,8 @@ public class JGYUtils {
pkgSet.addAll(ApkUtils.desktopAPP);
pkgSet.addAll(ApkUtils.aoleyunAPP);
pkgSet.addAll(ApkUtils.aihuaApp);
pkgSet.addAll(ApkUtils.jxwApp);
pkgSet.removeIf(TextUtils::isEmpty);
String aole_app_forbid = String.join(",", pkgSet);
Log.e(TAG, "writeAppPackageList: " + aole_app_forbid);
@@ -1127,7 +1150,12 @@ public class JGYUtils {
}
public void writeAppPackageList() {
String aole_app_forbid = String.join(",", defaultPackages);
HashSet<String> pkgSet = new HashSet<>(defaultPackages);
pkgSet.addAll(ApkUtils.desktopAPP);
pkgSet.addAll(ApkUtils.aoleyunAPP);
pkgSet.addAll(ApkUtils.aihuaApp);
pkgSet.addAll(ApkUtils.jxwApp);
String aole_app_forbid = String.join(",", pkgSet);
Log.e(TAG, "writeAppPackageList: " + aole_app_forbid);
Settings.System.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID, aole_app_forbid);
}
@@ -1295,10 +1323,10 @@ public class JGYUtils {
String app_url = jsonObject.get("app_url").getAsString();
String app_package = jsonObject.get("app_package").getAsString();
int app_version_code = jsonObject.get("app_version_code").getAsInt();
if (ApkUtils.desktopAPP.get(0).equals(app_package)) {
ApkUtils.UninstallAPP(mContext, ApkUtils.desktopAPP.get(1));
} else {
ApkUtils.UninstallAPP(mContext, ApkUtils.desktopAPP.get(0));
Set<String> desktop = new HashSet<>(ApkUtils.desktopAPP);
desktop.remove(app_package);
for (String s : desktop) {
ApkUtils.UninstallAPP(mContext, s);
}
PackageInfo info = null;
PackageManager packageManager = mContext.getPackageManager();
@@ -1310,6 +1338,7 @@ public class JGYUtils {
Log.e("fht", "installDesktop: " + e.getMessage());
}
if (null != info) {
packageManager.setApplicationEnabledSetting(app_package, PackageManager.COMPONENT_ENABLED_STATE_DEFAULT, 0);
long versionCode;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
versionCode = info.getLongVersionCode();
@@ -1385,6 +1414,9 @@ public class JGYUtils {
if (ApkUtils.aihuaApp.contains(packageName)) {
continue;
}
if (ApkUtils.jxwApp.contains(packageName)) {
continue;
}
if (PackageNames.DEVICE_INFO.equals(packageName) || PackageNames.APPSTORE.equals(packageName)
) {
continue;
@@ -1426,11 +1458,20 @@ public class JGYUtils {
this.add("com.aoleyun.os");
this.add("com.aoleyunos.dop1");
this.add("com.aoleyunos.dop2");
this.add("com.aoleyunos.dop3");
//aihua
this.add("com.android.mms");
this.add("com.android.fmradio");
this.add("com.mediatek.filemanager");
this.add("com.teclast.update");
this.add("com.google.android.apps.nbu.files");
this.add("com.tencent.wework");
this.add("com.tencent.mm");
this.add("cn.wps.moffice_eng");
this.add("com.baidu.BaiduMap");
}};
/**
@@ -1612,6 +1653,8 @@ public class JGYUtils {
Settings.System.putInt(crv, CommonConfig.AOLE_ACTION_DEVELOPER_OPTIONS, state);
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.ZhanruiPlatform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.CubePlatform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.AH6016Platform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.ZR6016Platform
) {
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);
@@ -2149,7 +2192,7 @@ public class JGYUtils {
public void setDefaultDesktop(String pkg, String className) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
// setRoleHolderAsUser(mContext, pkg);
setRoleHolderAsUser(mContext, pkg);
Log.e(TAG, "setDefaultDesktop: setRoleHolderAsUser");
} else {
//爱华设置,暂时屏蔽