1.4.0103 更换图标,G10P 标签MTK11改为G104,G10P标签为G10P

This commit is contained in:
2024-01-04 11:39:25 +08:00
parent 1bf394241c
commit 913270821c
36 changed files with 503 additions and 90 deletions

View File

@@ -131,7 +131,7 @@ public class JGYUtils {
public static final int AH6016Platform = 9;
public static final int ZR6016Platform = 10;
public static final int HRAD13Platform = 11;
public static final int Teclast8183Platform = 12;
public static final int G10PPlatform = 12;
public static final int C2Platform = 13;
@@ -144,7 +144,7 @@ public class JGYUtils {
public static final String AH6016Tag = "AH6016";
public static final String ZR6016Tag = "ZR6016";
public static final String HRAD13Tag = "HRAD13";
public static final String Teclast8183Tag = "teclast8183";
public static final String G10PTag = "G10P";
public static final String C2Tag = "MTK8183";
@@ -255,6 +255,9 @@ public class JGYUtils {
} else if (HRAD13Tag.equalsIgnoreCase(platform)) {
Log.i(TAG, "checkAppPlatform: " + "HRAD13");
return HRAD13Platform;
} else if (G10PTag.equalsIgnoreCase(platform)) {
Log.i(TAG, "checkAppPlatform: " + "G10P");
return G10PPlatform;
} else if (C2Tag.equalsIgnoreCase(platform)) {
Log.i(TAG, "checkAppPlatform: " + "C2");
return C2Platform;
@@ -296,6 +299,8 @@ public class JGYUtils {
getAppPlatformCallback.AppPlatform(ZR6016Platform);
} else if (HRAD13Tag.equalsIgnoreCase(platform)) {
getAppPlatformCallback.AppPlatform(HRAD13Platform);
} else if (G10PTag.equalsIgnoreCase(platform)) {
getAppPlatformCallback.AppPlatform(G10PPlatform);
} else if (C2Tag.equalsIgnoreCase(platform)) {
getAppPlatformCallback.AppPlatform(C2Platform);
} else {
@@ -321,9 +326,11 @@ public class JGYUtils {
return ZR6016Tag;
} else if (HRAD13Tag.equalsIgnoreCase(platform)) {
return HRAD13Tag;
} else if (C2Tag.equalsIgnoreCase(platform)) {
} else if (G10PTag.equalsIgnoreCase(platform)) {
return G10PTag;
} else if (C2Tag.equalsIgnoreCase(platform)) {
return C2Tag;
}else {
} else {
return Other;
}
}
@@ -1210,8 +1217,10 @@ public class JGYUtils {
pkgSet.addAll(ApkUtils.aoleyunAPP);
pkgSet.addAll(ApkUtils.aihuaApp);
pkgSet.addAll(ApkUtils.jxwApp);
pkgSet.removeIf(TextUtils::isEmpty);
if (JGYUtils.C2Tag.equalsIgnoreCase(JGYUtils.getInstance().getAppPlatform())) {
pkgSet.remove("com.tencent.mm");
}
String aole_app_forbid = String.join(",", pkgSet);
Log.e(TAG, "writeAppPackageList: " + aole_app_forbid);
boolean b = Settings.System.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID, aole_app_forbid);
@@ -1226,6 +1235,9 @@ public class JGYUtils {
pkgSet.addAll(ApkUtils.aoleyunAPP);
pkgSet.addAll(ApkUtils.aihuaApp);
pkgSet.addAll(ApkUtils.jxwApp);
if (JGYUtils.C2Tag.equalsIgnoreCase(JGYUtils.getInstance().getAppPlatform())) {
pkgSet.remove("com.tencent.mm");
}
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);
@@ -1390,39 +1402,43 @@ public class JGYUtils {
}
public void installDesktop(JsonObject jsonObject) {
String app_name = jsonObject.get("app_name").getAsString();
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();
mMMKV.encode(CommonConfig.DEFAULT_DESKTOP_PACKAGE, app_package);
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();
if (null != packageManager) {
try {
info = packageManager.getPackageInfo(app_package, 0);
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
Log.e("fht", "installDesktop: " + e.getMessage());
try {
String app_name = jsonObject.get("app_name").getAsString();
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();
mMMKV.encode(CommonConfig.DEFAULT_DESKTOP_PACKAGE, app_package);
Set<String> desktop = new HashSet<>(ApkUtils.desktopAPP);
desktop.remove(app_package);
for (String s : desktop) {
ApkUtils.UninstallAPP(mContext, s);
}
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();
} else {
versionCode = info.versionCode;
PackageInfo info = null;
PackageManager packageManager = mContext.getPackageManager();
if (null != packageManager) {
try {
info = packageManager.getPackageInfo(app_package, 0);
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
Log.e("fht", "installDesktop: " + e.getMessage());
}
if (app_version_code > versionCode) {
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();
} else {
versionCode = info.versionCode;
}
if (app_version_code > versionCode) {
Utils.ariaDownload(mContext, app_url, jsonObject);
}
} else {
Utils.ariaDownload(mContext, app_url, jsonObject);
}
} else {
Utils.ariaDownload(mContext, app_url, jsonObject);
}
} catch (Exception e) {
Log.e(TAG, "installDesktop: " + e.getMessage());
}
}
@@ -1728,6 +1744,7 @@ public class JGYUtils {
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.AH6016Platform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.ZR6016Platform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.HRAD13Platform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G10PPlatform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.C2Platform
) {
Settings.Global.putInt(crv, Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, state == 1 ? 0 : 1);
@@ -2119,8 +2136,8 @@ public class JGYUtils {
private String Launcher3 = "com.android.launcher3";
private String Launcher3Class = "com.android.launcher3.Launcher";
private String AoleyunOs ="com.aoleyun.os";
private String AoleyunOsClass ="com.aoleyun.os.Launcher";
private String AoleyunOs = "com.aoleyun.os";
private String AoleyunOsClass = "com.aoleyun.os.Launcher";
public void setDefaultLauncher(Context context, String defPackageName, String defClassName) {
try {
@@ -2229,9 +2246,9 @@ public class JGYUtils {
private void openLauncher3() {
// ApkUtils.openPackage(mContext, Launcher3);
if ("C2".equals(Build.MODEL)){
if ("C2".equals(Build.MODEL)) {
setDefaultDesktop(AoleyunOs, AoleyunOsClass);
}else {
} else {
setDefaultDesktop(Launcher3, Launcher3Class);
}
}
@@ -2435,7 +2452,7 @@ public class JGYUtils {
}
public boolean isForbid(String pkg) {
public boolean isForbid(String pkg) {
switch (pkg) {
case "com.mediatek.camera":
case "com.android.camera2":
@@ -2497,7 +2514,7 @@ public class JGYUtils {
default:
return true;
}
return false;
return true;
}