1.4.0608 增加爱优读

This commit is contained in:
2024-06-13 11:19:36 +08:00
parent 08fd02bf93
commit 526914c64c
28 changed files with 1291 additions and 1345 deletions

View File

@@ -138,7 +138,7 @@ public class JGYUtils {
public static final int MTKPlatform = 1;
public static final int ZhanruiPlatform = 2;
// public static final int CubePlatform = 3;
// public static final int CubePlatform = 3;
public static final int MTK11Platform = 5;
public static final int TeclastP20sPlatform = 6;
public static final int AH6016Platform = 9;
@@ -149,13 +149,14 @@ public class JGYUtils {
public static final int YXPD1Platform = 15;
public static final int G11Platform = 16;
public static final int MT8768Platform = 17;
public static final int AUDG104Platform = 18;
public static final String Other = "其他";
public static final String MTKTag = "MTK";
public static final String ZhanruiTag = "展锐";
// public static final String CubeTag = "展锐cube";
// public static final String CubeTag = "展锐cube";
public static final String MTK11Tag = "MTK11";
public static final String TeclastP20sTag = "P20S";
public static final String AH6016Tag = "AH6016";
@@ -166,6 +167,7 @@ public class JGYUtils {
public static final String YXPD1TAG = "YXPD1";
public static final String G11TAG = "MTKG11";
public static final String MT8768Tag = "MT8768";
public static final String AUDG104Tag = "AUDG104";
private CacheHelper cacheHelper;
@@ -293,6 +295,9 @@ public class JGYUtils {
} else if (MT8768Tag.equalsIgnoreCase(platform)) {
Log.i(TAG, "checkAppPlatform: " + "MT8768");
return MT8768Platform;
} else if (AUDG104Tag.equalsIgnoreCase(platform)) {
Log.i(TAG, "checkAppPlatform: " + "AUDG104");
return AUDG104Platform;
} else {
Log.i(TAG, "checkAppPlatform: " + "没有数据");
return UnknowPlatform;
@@ -343,6 +348,8 @@ public class JGYUtils {
getAppPlatformCallback.AppPlatform(G11Platform);
} else if (MT8768Tag.equalsIgnoreCase(platform)) {
getAppPlatformCallback.AppPlatform(MT8768Platform);
} else if (AUDG104Tag.equalsIgnoreCase(platform)) {
getAppPlatformCallback.AppPlatform(AUDG104Platform);
} else {
getAppPlatformCallback.AppPlatform(UnknowPlatform);
}
@@ -1276,6 +1283,7 @@ public class JGYUtils {
this.add("com.uiui.browser");
this.add("com.android.uiuios");
this.add("com.aoleyun.os");
this.add("com.aoleyun.audos");
this.add("com.aoleyunos.dop1");
this.add("com.aoleyunos.dop2");
this.add("com.aoleyunos.dop3");
@@ -1287,6 +1295,8 @@ public class JGYUtils {
this.add("com.uiui.videoplayer");
this.add("com.ygyb.yischool");
this.add("com.books.wisdom");
this.add("com.qi.airoom");
this.add("com.qi.AiStudyRoom");
}};
private Set<String> getWhitePkgList() {
@@ -1755,67 +1765,71 @@ public class JGYUtils {
} else {
JsonObject jsonObject = new JsonObject();
jsonObject.addProperty("MD5", MD5);
jsonObject.addProperty("app_name", "开机动画");
jsonObject.addProperty("app_package", "开机动画");
Utils.ariaDownload(mContext, url, jsonObject);
Log.e(TAG, "checkBootFile: " + "download file");
}
} else {
JsonObject jsonObject = new JsonObject();
jsonObject.addProperty("MD5", MD5);
jsonObject.addProperty("app_name", urlFileName);
jsonObject.addProperty("app_name", "开机动画");
jsonObject.addProperty("app_package", "开机动画");
Utils.ariaDownload(mContext, url, jsonObject);
}
}
private static final String BOOTANIMATION_PATH = "/data/local/qchmedia/bootanimation.zip";
@Deprecated
public void setBootanimation(String filePath) {
File systemFile = new File(BOOTANIMATION_PATH);
if (!systemFile.exists()) {
systemFile.getParentFile().mkdirs();
File file = systemFile.getParentFile();
Log.e(TAG, "setBootanimation: " + file.getAbsolutePath());
try {
systemFile.createNewFile();
} catch (IOException e) {
e.printStackTrace();
Log.e("setBootanimation: ", "createNewFile: " + e.getMessage());
}
}
File newFile = new File(filePath);
if (systemFile.exists() && systemFile.isFile()) {
String systemMD5 = FileUtils.getFileMD5ToString(systemFile);
String newMD5 = FileUtils.getFileMD5ToString(newFile);
if (systemMD5.equals(newMD5)) {
Log.e(TAG, "setBootanimation: 文件一致");
} else {
Path path = Paths.get(newFile.getAbsolutePath());
try {
Files.copy(path, new FileOutputStream(systemFile));
Log.e(TAG, "setBootanimation: 设置新开机动画");
} catch (IOException e) {
Log.e(TAG, "setBootanimation: IOException: " + e.getMessage());
e.printStackTrace();
}
}
} else {
File file = new File(BOOTANIMATION_PATH);
Log.e(TAG, "setBootanimation: " + file.getParentFile().getAbsolutePath());
Log.e(TAG, "setBootanimation: " + "Is a directory = " + file.isDirectory());
if (!file.getParentFile().delete()) {
Log.e(TAG, "setBootanimation: " + "系统动画删除失败");
}
Path path = Paths.get(newFile.getAbsolutePath());
try {
Files.copy(path, new FileOutputStream(systemFile));
copy(systemFile.getAbsolutePath(), newFile.getAbsolutePath());
Log.e(TAG, "setBootanimation: 设置新开机动画");
} catch (IOException e) {
Log.e(TAG, "setBootanimation: IOException: " + e.getMessage());
e.printStackTrace();
}
}
}
// @Deprecated
// private static final String BOOTANIMATION_PATH = "/data/local/qchmedia/bootanimation.zip";
//
// @Deprecated
// public void setBootanimation(String filePath) {
// File systemFile = new File(BOOTANIMATION_PATH);
// if (!systemFile.exists()) {
// systemFile.getParentFile().mkdirs();
// File file = systemFile.getParentFile();
// Log.e(TAG, "setBootanimation: " + file.getAbsolutePath());
// try {
// systemFile.createNewFile();
// } catch (IOException e) {
// e.printStackTrace();
// Log.e("setBootanimation: ", "createNewFile: " + e.getMessage());
// }
// }
// File newFile = new File(filePath);
// if (systemFile.exists() && systemFile.isFile()) {
// String systemMD5 = FileUtils.getFileMD5ToString(systemFile);
// String newMD5 = FileUtils.getFileMD5ToString(newFile);
// if (systemMD5.equals(newMD5)) {
// Log.e(TAG, "setBootanimation: 文件一致");
// } else {
// Path path = Paths.get(newFile.getAbsolutePath());
// try {
// Files.copy(path, new FileOutputStream(systemFile));
// Log.e(TAG, "setBootanimation: 设置新开机动画");
// } catch (IOException e) {
// Log.e(TAG, "setBootanimation: IOException: " + e.getMessage());
// e.printStackTrace();
// }
// }
// } else {
// File file = new File(BOOTANIMATION_PATH);
// Log.e(TAG, "setBootanimation: " + file.getParentFile().getAbsolutePath());
// Log.e(TAG, "setBootanimation: " + "Is a directory = " + file.isDirectory());
// if (!file.getParentFile().delete()) {
// Log.e(TAG, "setBootanimation: " + "系统动画删除失败");
// }
// Path path = Paths.get(newFile.getAbsolutePath());
// try {
// Files.copy(path, new FileOutputStream(systemFile));
// copy(systemFile.getAbsolutePath(), newFile.getAbsolutePath());
// Log.e(TAG, "setBootanimation: 设置新开机动画");
// } catch (IOException e) {
// Log.e(TAG, "setBootanimation: IOException: " + e.getMessage());
// e.printStackTrace();
// }
// }
// }
private static final String BOOTANIMATION_PATH_G10J = "/storage/emulated/0/Download/bootanimation.zip";
@@ -1839,6 +1853,7 @@ public class JGYUtils {
}
}
if (FileUtils.copy(newFile, file)) {
Toaster.show("设置开机动画成功");
Log.e(TAG, "setBootanimationG10J: set Bootanimation successful");
} else {
Log.e(TAG, "setBootanimationG10J: set Bootanimation failed");
@@ -1850,11 +1865,11 @@ public class JGYUtils {
public void removeBootanimation() {
File systemFile;
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MT8768Platform) {
systemFile = new File(BOOTANIMATION_PATH_G10J);
} else {
systemFile = new File(BOOTANIMATION_PATH);
}
// if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MT8768Platform) {
systemFile = new File(BOOTANIMATION_PATH_G10J);
// } else {
// systemFile = new File(BOOTANIMATION_PATH);
// }
if (systemFile.exists()) {
if (systemFile.delete()) {
Log.e(TAG, "removeBootanimation: delete: " + "ture");
@@ -1862,10 +1877,10 @@ public class JGYUtils {
Log.e(TAG, "removeBootanimation: delete: " + "false");
}
}
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MT8768Platform) {
Intent intent = new Intent("com.hra.setBootanimation");
mContext.sendBroadcast(intent);
}
// if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MT8768Platform) {
Intent intent = new Intent("com.hra.setBootanimation");
mContext.sendBroadcast(intent);
// }
}
public void copy(String oldPath, String newPath) {
@@ -2324,6 +2339,9 @@ public class JGYUtils {
private String AoleyunOs = "com.aoleyun.os";
private String AoleyunOsClass = "com.aoleyun.os.Launcher";
private String AiUDuOs = "com.aoleyun.audos";
private String AiUDuOsClass = "com.aoleyun.audos.Launcher";
public void setDefaultLauncher(Context context, String defPackageName, String defClassName) {
try {
if (!TextUtils.isEmpty(defPackageName) && !TextUtils.isEmpty(defClassName)) {
@@ -2384,9 +2402,16 @@ public class JGYUtils {
public void checkDefaultDesktop(String pkg) {
String desktopPkg = getDefaultDesktop();
// String desktopPkg = (String) SPUtils.get(mContext, "default_launcher", "");
Log.e(TAG, "checkDefaultDesktop: " + desktopPkg);
if (pkg.equalsIgnoreCase(desktopPkg)) {
setDefaultDesktop(pkg);
Log.e(TAG, "checkDefaultDesktop: pkg = " + pkg);
Log.e(TAG, "checkDefaultDesktop: desktopPkg = " + desktopPkg);
if (TextUtils.isEmpty(pkg)) {
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.YXPD1Platform) {
JGYUtils.getInstance().setDop7DefaultDesktop();
}
} else {
if (pkg.equalsIgnoreCase(desktopPkg)) {
setDefaultDesktop(pkg);
}
}
}
@@ -2420,6 +2445,10 @@ public class JGYUtils {
setDefaultDesktop(PackageNames.YIXUEPAI_DESKTOP);
}
public void setDop7DefaultDesktop() {
setDefaultDesktop("com.aoleyunos.dop7");
}
/**
* 设置默认桌面
*
@@ -2454,6 +2483,8 @@ public class JGYUtils {
if (ApkUtils.isAvailable(mContext, AoleyunOs)
|| "C2".equals(Build.MODEL)) {
setDefaultDesktop(AoleyunOs, AoleyunOsClass);
} else if ("Aiud_A8_ag_1095".equals(Build.MODEL)) {
setDefaultDesktop(AiUDuOs, AiUDuOsClass);
} else {
setDefaultDesktop(Launcher3, Launcher3Class);
}
@@ -2463,6 +2494,8 @@ public class JGYUtils {
if (ApkUtils.isAvailable(mContext, AoleyunOs)
|| "C2".equals(Build.MODEL)) {
ApkUtils.openPackage(mContext, AoleyunOs, AoleyunOsClass);
} else if ("Aiud_A8_ag_1095".equals(Build.MODEL)) {
setDefaultDesktop(AiUDuOs, AiUDuOsClass);
} else {
ApkUtils.openPackage(mContext, Launcher3, Launcher3Class);
}