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

@@ -731,17 +731,28 @@ public class ApkUtils {
this.add("com.android.email");//电子邮件
this.add("com.android.calendar");//日历
this.add("com.tencent.wework");
this.add("com.tencent.mm");
this.add("cn.wps.moffice_eng");
this.add("com.baidu.BaiduMap");
}};
//桌面app
public static List<String> desktopAPP = new ArrayList<String>() {{
// this.add("com.aoleyunos.dop1");
// this.add("com.aoleyunos.dop2");
this.add("com.uiuios.jgy1");
this.add("com.uiuios.jgy2");
this.add("com.android.uiuios");
this.add("com.shoufei.aole");
this.add("com.aoleyunos.dop1");
this.add("com.aoleyunos.dop2");
this.add("com.aoleyunos.dop3");
this.add("com.aoleyunos.dop4");
this.add("com.aoleyunos.dop5");
this.add("com.aoleyunos.dop6");
this.add("com.aoleyunos.dop7");
this.add("com.aoleyunos.dop8");
this.add("com.aoleyunos.dop9");
this.add("com.aoleyunos.dop10");
// this.add("com.uiuios.jgy1");
// this.add("com.uiuios.jgy2");
// this.add("com.android.uiuios");
// this.add("com.shoufei.aole");
}};
public static List<String> aoleyunAPP = new ArrayList<String>() {{
@@ -939,7 +950,7 @@ public class ApkUtils {
this.add("com.wyt.tongbuyouxue");
this.add("com.qi.wyt.setting");
this.add("air.wyt.modloader");
this.add("com.google.android.inputmethod.pinyin");
// this.add("com.google.android.inputmethod.pinyin");
this.add("com.android.calculator2");
this.add("com.qi.TFSystem");
this.add("com.qi.appstore");
@@ -979,14 +990,73 @@ public class ApkUtils {
this.add("com.shoufei.aole");
this.add("com.ygyb.yischool");
this.add("com.tencent.wework");
this.add("com.tencent.mm");
this.add("cn.wps.moffice_eng");
this.add("com.baidu.BaiduMap");
}};
public static Set<String> jxwApp = new HashSet<String>() {{
this.add("air.com.zhihuiyoujiao.flashplayer");
this.add("com.example.arithmeticformula");
this.add("com.example.elementcycleapp");
this.add("com.example.pianpangbushou");
this.add("com.iflytek.cyber.iot.show.core");
this.add("com.iflytek.speechcloud");
this.add("com.jxw.bihuamingcheng");
this.add("com.jxw.bishunguize");
this.add("com.jxw.characterlearning");
this.add("com.jxw.dmxcy");
this.add("com.jxw.englishsoundmark");
this.add("com.jxw.examsystem");
this.add("com.jxw.game");
this.add("com.jxw.gb.zwpg");
this.add("com.jxw.handwrite");
this.add("com.jxw.jinfangyici");
this.add("com.jxw.jxwbook");
this.add("com.jxw.jxwcalculator");
this.add("com.jxw.laboratory");
this.add("com.jxw.learnchinesepinyin");
this.add("com.jxw.letterstudynew");
this.add("com.jxw.liancichengju");
this.add("com.jxw.mskt.video");
this.add("com.jxw.newyouer.video");
this.add("com.jxw.online_study");
this.add("com.jxw.question");
this.add("com.jxw.schultegrid");
this.add("com.jxw.singsound");
this.add("com.jxw.studydigital");
this.add("com.jxw.teacher.video");
this.add("com.jxw.wuweijidanci");
this.add("com.jxw.youer.video");
this.add("com.jxw.yuwenxiezuo");
this.add("com.jxw.yyhb");
this.add("com.jxw.zncd");
this.add("com.oirsdfg89.flg");
this.add("com.study.flashplayer");
this.add("com.tech.translate");
this.add("com.uiui.zybrowser");
this.add("com.uiui.zysn");
this.add("com.jxw.launcher");
this.add("com.uiui.zyappstore");
this.add("com.uiui.zy");
this.add("com.uiui.zyos");
this.add("com.teclast.zyos");
this.add("com.teclast.zybrowser");
this.add("com.teclast.zyappstore");
this.add("com.teclast.zy");
}};
public static void showAllAPP(Context context) {
PackageManager pm = context.getPackageManager();
// 查询所有已经安装的应用程序
List<PackageInfo> packages = pm.getInstalledPackages(PackageManager.COMPONENT_ENABLED_STATE_ENABLED | PackageManager.COMPONENT_ENABLED_STATE_DISABLED);
for (PackageInfo packageInfo : packages) {
Log.i(TAG, "showAllAPP: " + packageInfo.packageName);
//如果是自带可以卸载的,除开不需要管控的
if (canremove_systemapp.contains(packageInfo.packageName)
&& !show_canremove_systemapp.contains(packageInfo.packageName)) {
@@ -1197,6 +1267,13 @@ public class ApkUtils {
this.add("com.aoleyunos.dop1");
this.add("com.aoleyunos.dop2");
this.add("com.aoleyunos.dop3");
this.add("com.aoleyunos.dop4");
this.add("com.aoleyunos.dop5");
this.add("com.aoleyunos.dop6");
this.add("com.aoleyunos.dop7");
this.add("com.aoleyunos.dop8");
this.add("com.aoleyunos.dop9");
this.add("com.aoleyunos.dop10");
this.add("com.jiepier.filemanager");
this.add("com.calendar.uiui");
this.add("com.notepad.uiui");
@@ -1205,6 +1282,7 @@ public class ApkUtils {
this.add("com.uiui.speed");
}};
public static String getRunningAppInfo(Context context) {
// ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
// List<ActivityManager.RunningServiceInfo> infoList = activityManager.getRunningServices(Integer.MAX_VALUE);
@@ -1215,8 +1293,8 @@ public class ApkUtils {
Log.e(TAG, "getRunningAppInfo: " + topPkg);
for (PackageInfo packageInfo : packages) {
String packageName = packageInfo.packageName;
//排除桌面app和出厂自带app
if (desktopAPP.contains(packageName) || factoryapp.contains(packageName)) {
//排除出厂自带app
if (factoryapp.contains(packageName)) {
continue;
}
//排除所有系统应用,不显示
@@ -1302,11 +1380,9 @@ public class ApkUtils {
}
public static long getPackageSize(Context context, String filePath) {
long size = new File(filePath).length();
return size;
}
}
}

View File

@@ -2,11 +2,6 @@ package com.aoleyun.sn.utils;
import android.graphics.drawable.Drawable;
import androidx.annotation.NonNull;
import com.google.gson.Gson;
import com.google.gson.JsonParser;
import java.io.Serializable;
public class FlowInfo implements Serializable {

View File

@@ -10,8 +10,6 @@ import android.provider.Settings;
import android.text.TextUtils;
import android.util.Log;
import com.tencent.mmkv.MMKV;
import java.util.List;
public class ForegroundAppUtil {

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 {
//爱华设置,暂时屏蔽

View File

@@ -7,13 +7,10 @@ import android.net.ConnectivityManager;
import android.net.NetworkCapabilities;
import android.net.NetworkInfo;
import android.os.Build;
import android.telephony.CellInfo;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.Log;
import java.util.List;
/**
* @author fanhuitong
*/

View File

@@ -17,6 +17,7 @@ import com.aoleyun.sn.comm.JGYActions;
import com.aoleyun.sn.gson.GsonUtils;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import java.util.ArrayList;
import java.util.List;
@@ -51,8 +52,9 @@ public class SysSettingUtils {
setIcon(context, jsonObject);
setCanReset(context, jsonObject);
setAutoTime(context, jsonObject);
JsonObject navJson = jsonObject.get("setting_nav").getAsJsonObject();
SPUtils.put(context, JGYActions.ACTION_STATUSBAR_STATUS, jsonObject.get("setting_nav").toString());
String navJsonString = jsonObject.get("setting_nav").getAsString();
JsonObject navJson = JsonParser.parseString(navJsonString).getAsJsonObject();
SPUtils.put(context, JGYActions.ACTION_STATUSBAR_STATUS, navJsonString);
setStatusBar(context, navJson);
setBrowserInput(context, jsonObject);
// TODO: 2022/4/11 不是酷比定制的会报错,无法抛出异常
@@ -101,6 +103,7 @@ public class SysSettingUtils {
setAutoTime(context, 0);
setBrowserInput(context, 0);
JGYUtils.getInstance().setDeveloperOptions(0);
setStatusBar(context, 0);
}
private static void setPhoneList(Context context, int state) {
@@ -166,7 +169,15 @@ public class SysSettingUtils {
boolean aole_usb_choose = Settings.System.putString(context.getContentResolver(), "aole_usb_choose", "usb_charge");
Log.e(TAG, "aole_usb_choose:" + aole_usb_choose);
String usbStatus = CommonConfig.AOLE_ACTION_USB_USB_CHARGE;
Intent usbIntent = new Intent(usbStatus).setPackage("com.android.settings");
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.AH6016Platform) {
usbStatus = CommonConfig.AOLE_ACTION_USB_USB_MTP;
}
Intent usbIntent = new Intent(usbStatus);
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.TeclastP20sPlatform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.AH6016Platform
) {
usbIntent.setPackage("com.android.settings");
}
context.sendBroadcast(usbIntent);
} catch (NoClassDefFoundError | Exception e) {
Log.e(TAG, "setUSBstate: " + e.getMessage());
@@ -195,8 +206,9 @@ public class SysSettingUtils {
} else {
boolean aole_usb_choose = Settings.System.putString(context.getContentResolver(), "aole_usb_choose", setting_usb);
Log.e("setUSBstate", "aole_usb_choose: " + aole_usb_choose);
String usbStatus = CommonConfig.AOLE_ACTION_USB_USB_CHARGE;
String usbStatus;
switch (setting_usb) {
default:
case "usb_charge":
usbStatus = CommonConfig.AOLE_ACTION_USB_USB_CHARGE;
break;
@@ -206,9 +218,13 @@ public class SysSettingUtils {
case "usb_midi":
usbStatus = CommonConfig.AOLE_ACTION_USB_USB_MIDI;
break;
default:
}
Intent usbIntent = new Intent(usbStatus).setPackage("com.android.settings");
Intent usbIntent = new Intent(usbStatus);
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.TeclastP20sPlatform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.AH6016Platform
) {
usbIntent.setPackage("com.android.settings");
}
context.sendBroadcast(usbIntent);
}
}

View File

@@ -50,9 +50,7 @@ import androidx.annotation.VisibleForTesting;
import com.aoleyun.sn.BuildConfig;
import com.aoleyun.sn.R;
import com.aoleyun.sn.base.BaseApplication;
import com.aoleyun.sn.comm.CommonConfig;
import com.aoleyun.sn.network.NetInterfaceManager;
import com.arialyy.aria.core.Aria;
import com.blankj.utilcode.util.FileUtils;
import com.google.gson.JsonObject;
@@ -62,8 +60,6 @@ import com.google.zxing.WriterException;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.qrcode.QRCodeWriter;
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
import com.squareup.moshi.Json;
import com.tencent.mmkv.MMKV;
import java.io.BufferedReader;
import java.io.DataOutputStream;
@@ -75,7 +71,6 @@ import java.io.IOException;
import java.io.InputStreamReader;
import java.io.LineNumberReader;
import java.io.Reader;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.Inet4Address;
import java.net.InetAddress;
@@ -1189,14 +1184,21 @@ public class Utils {
* @param jsonObject
*/
public static void ariaDownload(Context context, String url, JsonObject jsonObject) {
Log.e(TAG, "ariaDownload: " + jsonObject);
String fileName = getFileNamefromURL(url);
String urlMD5 = jsonObject.get("MD5").getAsString();
String urlMD5 = "";
if (jsonObject.get("MD5") == null) {
if (jsonObject.get("app_md5") != null)
urlMD5 = jsonObject.get("app_md5").getAsString();
} else {
if (jsonObject.get("MD5") != null)
urlMD5 = jsonObject.get("MD5").getAsString();
}
Log.e("ariaDownload", "urlMD5=" + urlMD5);
String p = JGYUtils.getInstance().getDownLoadPath();
File file = new File(JGYUtils.getInstance().getDownLoadPath() + fileName);
if (file.exists() && !file.isDirectory()) {
String filenameMD5 = getMD5fromFileName(url);
String fileMD5 = FileUtils.getFileMD5ToString(file);
Log.e("ariaDownload", "filenameMD5=" + filenameMD5);
Log.e("ariaDownload", "fileMD5=" + fileMD5);
@@ -1210,7 +1212,6 @@ public class Utils {
.ignoreFilePathOccupy()
.setExtendField(jsonObject.toString())
.create(); //启动下载}
// }
}
} else {
Aria.download(context)
@@ -1755,6 +1756,8 @@ public class Utils {
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MTKPlatform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MTK11Platform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.TeclastP20sPlatform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.AH6016Platform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.ZR6016Platform
) {
return Utils.getProperty("ro.build.display.id", "获取失败");
} else {