version:1.5.0714

bugfixes:
add:增加浏览器下载开关,去掉易学派应用后台结束进程
This commit is contained in:
2025-07-14 15:02:00 +08:00
parent 2e2eae508a
commit 81e4f050ca
6 changed files with 85 additions and 40 deletions

View File

@@ -29,8 +29,8 @@ android {
defaultConfig {
applicationId "com.aoleyun.sn"
versionCode 185
versionName "1.5.0707"
versionCode 186
versionName "1.5.0714"
//There are no CERT files because If the mini sdk version is 23+, the AGP will ignore the V1 scheme signature.
minSdkVersion 24

View File

@@ -74,17 +74,18 @@ public class BaseApplication extends MultiDexApplication {
initAliasObservable();
initTagObservable();
aliyunPushInit();
NetInterfaceManager.init(this);
AllwinnerCubeMdmManager.init(this);
JgyUtils.init(this);
NetInterfaceManager.init(this);
if (JgyUtils.isAllWinnerDevice()) {
AllwinnerCubeMdmManager.init(this);
}
WiFiUtils.init(this);
XAPKUtils.init(this);
LogDBManager.init(this);
FileManager.init(this);
ConnectManager.init(this);
// JgyUtils.getInstance().hookWebView();
JgyUtils.getInstance().hookWebView();
Aria.init(this);
Aria.get(this).getDownloadConfig().setMaxTaskNum(1);
Aria.get(this).getDownloadConfig().setConvertSpeed(true);

View File

@@ -1320,12 +1320,16 @@ public class NetInterfaceManager {
List<String> forceApp = forceDownloadData.stream().map(ForceDownloadData::getApp_package).collect(Collectors.toList());
boolean aole_force_app = Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_FORCE_APP, String.join(",", forceApp));
Log.e("getForceDownload", "aole_force_app:" + aole_force_app);
AllwinnerCubeMdmManager.getInstance().setForbidUnInstallPackageList(forceApp);
if (JgyUtils.isAllWinnerDevice()) {
AllwinnerCubeMdmManager.getInstance().setForbidUnInstallPackageList(forceApp);
}
} else if (forceDownloadBean.code == -200) {
cacheHelper.put(UrlAddress.GET_FORCE_INSTALL_LIST, "");
boolean aole_force_app = Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_FORCE_APP, "invalid");
Log.e("getForceDownload", "aole_force_app:" + aole_force_app);
AllwinnerCubeMdmManager.getInstance().setForbidUnInstallPackageList(new ArrayList<>());
if (JgyUtils.isAllWinnerDevice()) {
AllwinnerCubeMdmManager.getInstance().setForbidUnInstallPackageList(new ArrayList<>());
}
} else {
cacheHelper.put(UrlAddress.GET_FORCE_INSTALL_LIST, "");
Log.e("getForceDownload", forceDownloadBean.msg);
@@ -1366,12 +1370,16 @@ public class NetInterfaceManager {
List<String> forceApp = forceDownloadBean.stream().map(ForceDownloadData::getApp_package).collect(Collectors.toList());
boolean aole_force_app = Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_FORCE_APP, String.join(",", forceApp));
Log.e("getForceDownload", "aole_force_app:" + aole_force_app);
AllwinnerCubeMdmManager.getInstance().setForbidUnInstallPackageList(forceApp);
if (JgyUtils.isAllWinnerDevice()) {
AllwinnerCubeMdmManager.getInstance().setForbidUnInstallPackageList(forceApp);
}
} else {
cacheHelper.put(UrlAddress.GET_FORCE_INSTALL_LIST, "");
boolean aole_force_app = Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_FORCE_APP, "invalid");
Log.e("getForceDownload", "aole_force_app:" + aole_force_app);
AllwinnerCubeMdmManager.getInstance().setForbidUnInstallPackageList(new ArrayList<>());
if (JgyUtils.isAllWinnerDevice()) {
AllwinnerCubeMdmManager.getInstance().setForbidUnInstallPackageList(new ArrayList<>());
}
}
}

View File

@@ -217,7 +217,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
JgyUtils.getInstance().killPackage(PackageNames.NOTIFICATIONS);
JgyUtils.getInstance().killPackage(PackageNames.BROWSER);
JgyUtils.getInstance().killPackage(PackageNames.AILOG);
JgyUtils.getInstance().killPackage("com.ygyb.yischool");
// JgyUtils.getInstance().killPackage("com.ygyb.yischool");
}
@Override

View File

@@ -870,7 +870,9 @@ public class JgyUtils {
if (blackList != null) {
List<String> installedBlackApps = blackList.stream().filter(s -> ApkUtils.isAvailable(mContext, s)).collect(Collectors.toList());
Log.e(TAG, "setAppNetwork: installedBlackApps = " + installedBlackApps);
AllwinnerCubeMdmManager.getInstance().setBlackNetApp(installedBlackApps);
if (JgyUtils.isAllWinnerDevice()) {
AllwinnerCubeMdmManager.getInstance().setBlackNetApp(installedBlackApps);
}
}
mMMKV.encode(CommonConfig.AOLE_ACTION_NETWORK_ALLOW, whiteList);
@@ -1482,7 +1484,9 @@ public class JgyUtils {
pkgSet.addAll(getWhitePkgList());
pkgSet.removeIf(TextUtils::isEmpty);
AllwinnerCubeMdmManager.getInstance().setInstallPackageWhiteList(new ArrayList<>(pkgSet));
if (JgyUtils.isAllWinnerDevice()) {
AllwinnerCubeMdmManager.getInstance().setInstallPackageWhiteList(new ArrayList<>(pkgSet));
}
String aole_app_forbid = String.join(",", pkgSet);
Log.e(TAG, "writeAppPackageList: " + aole_app_forbid);
@@ -1505,7 +1509,9 @@ public class JgyUtils {
pkgSet.addAll(getWhitePkgList());
pkgSet.removeIf(TextUtils::isEmpty);
AllwinnerCubeMdmManager.getInstance().setInstallPackageWhiteList(new ArrayList<>(pkgSet));
if (JgyUtils.isAllWinnerDevice()) {
AllwinnerCubeMdmManager.getInstance().setInstallPackageWhiteList(new ArrayList<>(pkgSet));
}
String aole_app_forbid = String.join(",", pkgSet);
Log.e(TAG, "writeAppPackageList: " + aole_app_forbid);
@@ -2094,7 +2100,9 @@ public class JgyUtils {
Settings.Global.putInt(crv, Settings.Global.ADB_ENABLED, state);
}
// }
AllwinnerCubeMdmManager.getInstance().setDeveloperEnable(state == 1);
if (JgyUtils.isAllWinnerDevice()) {
AllwinnerCubeMdmManager.getInstance().setDeveloperEnable(state == 1);
}
}
private String chromium_pkg = "org.chromium.browser";
@@ -3663,7 +3671,9 @@ public class JgyUtils {
}
String componentName = JgyUtils.getInstance().getInputMethComponentName(pkg);
Log.e(TAG, "setDefaultInputMethod: " + componentName);
AllwinnerCubeMdmManager.getInstance().setDefaultInputMethod(componentName);
if (JgyUtils.isAllWinnerDevice()) {
AllwinnerCubeMdmManager.getInstance().setDefaultInputMethod(componentName);
}
}
public String getInputMethComponentName(String pkg) {
@@ -3694,7 +3704,9 @@ public class JgyUtils {
return;
}
Log.e(TAG, "setAllwinnerDefaulBrowser: " + pkg);
AllwinnerCubeMdmManager.getInstance().setDefaultInputMethod(pkg);
if (JgyUtils.isAllWinnerDevice()) {
AllwinnerCubeMdmManager.getInstance().setDefaultInputMethod(pkg);
}
}
}

View File

@@ -73,6 +73,7 @@ public class SysSettingUtils {
setNotification(context, jsonObject);
setPanelShow(context, jsonObject);
setDisAllowCamera(context, jsonObject);
}
/**
@@ -358,7 +359,9 @@ public class SysSettingUtils {
}
JgyUtils.getInstance().setBluetoothEnable(state == 0);
AllwinnerCubeMdmManager.getInstance().setBluetoothEnable(state == 0);
if (JgyUtils.isAllWinnerDevice()) {
AllwinnerCubeMdmManager.getInstance().setBluetoothEnable(state == 0);
}
}
/**
@@ -461,8 +464,9 @@ public class SysSettingUtils {
}
JgyUtils.getInstance().setBluetoothEnable(setting_bht == 0);
AllwinnerCubeMdmManager.getInstance().setBluetoothEnable(setting_bht == 0);
if (JgyUtils.isAllWinnerDevice()) {
AllwinnerCubeMdmManager.getInstance().setBluetoothEnable(setting_bht == 0);
}
}
private static void setHotspot(Context context, int state) {
@@ -474,7 +478,9 @@ public class SysSettingUtils {
boolean aole_hotspot_forbid_on = Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_HOTSPOT_FORBID_ON, state);
Log.e(TAG, "aole_hotspot_forbid_on:" + aole_hotspot_forbid_on);
AllwinnerCubeMdmManager.getInstance().setWifiHotSpotStatus(state);
if (JgyUtils.isAllWinnerDevice()) {
AllwinnerCubeMdmManager.getInstance().setWifiHotSpotStatus(state);
}
} catch (Exception e) {
Log.e(TAG, "setHotspot: " + e.getMessage());
}
@@ -493,7 +499,9 @@ public class SysSettingUtils {
Log.e(TAG, "aole_hotspot_forbid_on---------" + setting_hotspot);
Log.e(TAG, "aole_hotspot_forbid_on---------" + aole_hotspot_forbid_on);
AllwinnerCubeMdmManager.getInstance().setWifiHotSpotStatus(setting_hotspot);
if (JgyUtils.isAllWinnerDevice()) {
AllwinnerCubeMdmManager.getInstance().setWifiHotSpotStatus(setting_hotspot);
}
} catch (Exception e) {
Log.e(TAG, "setHotspot: " + e.getMessage());
}
@@ -566,7 +574,9 @@ public class SysSettingUtils {
Intent navIntent = new Intent(navigationStatus);
context.sendBroadcast(navIntent);
AllwinnerCubeMdmManager.getInstance().setNavigationStatus(setting_navigation == 0);
if (JgyUtils.isAllWinnerDevice()) {
AllwinnerCubeMdmManager.getInstance().setNavigationStatus(setting_navigation == 0);
}
//状态栏显示开关
int setting_statusbar = changeNum(jsonObject.get("setting_statusbar").getAsInt());
@@ -592,7 +602,9 @@ public class SysSettingUtils {
context.sendBroadcast(statusIntent);
// }
AllwinnerCubeMdmManager.getInstance().setStatusBarEnable(setting_statusbar == 0);
if (JgyUtils.isAllWinnerDevice()) {
AllwinnerCubeMdmManager.getInstance().setStatusBarEnable(setting_statusbar == 0);
}
}
private static void setCamera(Context context, int state) {
@@ -645,7 +657,9 @@ public class SysSettingUtils {
private static void setTF(Context context, int state) {
//存储卡
AllwinnerCubeMdmManager.getInstance().setSDEnable(state == 0);
if (JgyUtils.isAllWinnerDevice()) {
AllwinnerCubeMdmManager.getInstance().setSDEnable(state == 0);
}
JgyUtils.getInstance().setSDOTGEnable(state == 0);
boolean aole_sdcard_forbid_on = Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_SDCARD_FORBID_ON, state);
@@ -685,7 +699,9 @@ public class SysSettingUtils {
private static void setTF(Context context, JsonObject jsonObject) {
//存储卡
int setting_memory = changeNum(jsonObject.get("setting_memory").getAsInt());
AllwinnerCubeMdmManager.getInstance().setSDEnable(setting_memory == 0);
if (JgyUtils.isAllWinnerDevice()) {
AllwinnerCubeMdmManager.getInstance().setSDEnable(setting_memory == 0);
}
Log.e(TAG, "setTF: setting_memory = " + setting_memory);
JgyUtils.getInstance().setSDOTGEnable(setting_memory == 0);
@@ -750,7 +766,9 @@ public class SysSettingUtils {
Log.e(TAG, "setCanReset: state = " + state);
Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_RESTORE_FORBID_ON, state);
//默认打开
AllwinnerCubeMdmManager.getInstance().setResetFactoryEnable(state == 0);
if (JgyUtils.isAllWinnerDevice()) {
AllwinnerCubeMdmManager.getInstance().setResetFactoryEnable(state == 0);
}
}
//aole_restore_forbid_on=1禁止恢复出厂设置
@@ -763,8 +781,9 @@ public class SysSettingUtils {
} else {
Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_RESTORE_FORBID_ON, 1);
}
AllwinnerCubeMdmManager.getInstance().setResetFactoryEnable(mode == 1);
if (JgyUtils.isAllWinnerDevice()) {
AllwinnerCubeMdmManager.getInstance().setResetFactoryEnable(mode == 1);
}
}
//系统默认“使用网络提供时间”且不可点击
@@ -862,12 +881,14 @@ public class SysSettingUtils {
mStatusBarManager.disable(StatusBarManager.DISABLE_NONE);//显示隐藏的虚拟按键
}
/**
* 设置浏览器禁止输入
*
* @param context
* @param jsonObject
*/
// TODO: 2025/7/14 待优化,逻辑太差了
private static void setBrowserInput(Context context, JsonObject jsonObject) {
int state = 1;
try {
@@ -888,17 +909,15 @@ public class SysSettingUtils {
Settings.System.putInt(context.getContentResolver(), "qch_Browser_input", 0);
}
try {
int is_browser_network;
if (TextUtils.isEmpty(jsonObject.get("is_browser_network").getAsString())) {
is_browser_network = 0;
} else {
is_browser_network = jsonObject.get("is_browser_network").getAsInt();
}
if (jsonObject.get("is_browser_network") != null) {
int is_browser_network = jsonObject.get("is_browser_network").getAsInt();
Log.e(TAG, "setBrowserInput: is_browser_network = " + is_browser_network);
Settings.Global.putInt(context.getContentResolver(), "is_browser_network", is_browser_network);
} catch (Exception e) {
Log.e(TAG, "setBrowserInput: e: " + e.getMessage());
}
if (jsonObject.get("browser_down") != null) {
int browser_down = jsonObject.get("browser_down").getAsInt();
Settings.System.putInt(context.getContentResolver(), "aoleyun_browser_down", browser_down);
}
}
@@ -911,6 +930,7 @@ public class SysSettingUtils {
private static void setBrowserInput(Context context, int state) {
Settings.System.putInt(context.getContentResolver(), "qch_Browser_input", 0);
Settings.Global.putInt(context.getContentResolver(), "is_browser_network", changeNum(state));
Settings.System.putInt(context.getContentResolver(), "aoleyun_browser_down", state);
}
private static void setAdminApp(Context context, JsonObject jsonObject) {
@@ -919,7 +939,9 @@ public class SysSettingUtils {
int is_app_install = appInstall.getAsInt();
Log.e(TAG, "setAdminApp: is_app_install = " + is_app_install);
Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_APP_ALLOW_INSTALL, is_app_install);
AllwinnerCubeMdmManager.getInstance().setInstallPackageEnable(is_app_install == 1);
if (JgyUtils.isAllWinnerDevice()) {
AllwinnerCubeMdmManager.getInstance().setInstallPackageEnable(is_app_install == 1);
}
} else {
Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_APP_ALLOW_INSTALL, 0);
}
@@ -945,7 +967,9 @@ public class SysSettingUtils {
private static void setAdminApp(Context context, int state) {
Log.e(TAG, "setAdminApp: state = " + state);
AllwinnerCubeMdmManager.getInstance().setInstallPackageEnable(state == 0);
if (JgyUtils.isAllWinnerDevice()) {
AllwinnerCubeMdmManager.getInstance().setInstallPackageEnable(state == 0);
}
Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_APP_ALLOW_INSTALL, changeNum(state));
Settings.Global.putInt(context.getContentResolver(), "is_admin_app", changeNum(state));
}