bugfixes:修复应用安装开关问题,修改打开之后不会删除应用,id管控默认写入一条无效数据,修复应用安装之后不能联网的问题
This commit is contained in:
2024-10-15 09:30:58 +08:00
parent c6bec5cd43
commit c360344acc
12 changed files with 158 additions and 53 deletions

View File

@@ -29,8 +29,8 @@ android {
defaultConfig { defaultConfig {
applicationId "com.aoleyun.sn" applicationId "com.aoleyun.sn"
versionCode 157 versionCode 161
versionName "1.4.0913" versionName "1.4.1014"
//There are no CERT files because If the mini sdk version is 23+, the AGP will ignore the V1 scheme signature. //There are no CERT files because If the mini sdk version is 23+, the AGP will ignore the V1 scheme signature.
minSdkVersion 24 minSdkVersion 24
@@ -198,6 +198,15 @@ android {
v1SigningEnabled true v1SigningEnabled true
v2SigningEnabled true v2SigningEnabled true
} }
T40Air {
storeFile file("keystore/T40Air.jks")
storePassword "123456"
keyAlias "T40Air"
keyPassword "123456"
v1SigningEnabled true
v2SigningEnabled true
}
} }
// Disable release builds for now // Disable release builds for now
@@ -209,6 +218,20 @@ android {
} }
buildTypes { buildTypes {
T40AirDebug.initWith(debug)
T40AirDebug {
versionNameSuffix "-debug"
debuggable true
signingConfig signingConfigs.T40Air
buildConfigField "String", "platform", '"HL500"'
}
T40AirRelease.initWith(release)
T40AirRelease {
signingConfig signingConfigs.T40Air
buildConfigField "String", "platform", '"HL500"'
}
AiUduDebug.initWith(debug) AiUduDebug.initWith(debug)
AiUduDebug { AiUduDebug {
versionNameSuffix "-debug" versionNameSuffix "-debug"

BIN
app/keystore/T40Air.jks Normal file

Binary file not shown.

View File

@@ -138,7 +138,7 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
Settings.System.putString(getContentResolver(), CommonConfig.ACTIVATIONBEAN_CODE_KEY, Utils.getSerial(this)); Settings.System.putString(getContentResolver(), CommonConfig.ACTIVATIONBEAN_CODE_KEY, Utils.getSerial(this));
} }
Log.e(TAG, "initView: " + Build.MODEL); Log.e(TAG, "initView: Build.MODEL = " + Build.MODEL);
if ("YX-T01".equalsIgnoreCase(Build.MODEL)) { if ("YX-T01".equalsIgnoreCase(Build.MODEL)) {
mViewDataBinding.clBind.setVisibility(View.GONE); mViewDataBinding.clBind.setVisibility(View.GONE);
mViewDataBinding.clQrcode.setVisibility(View.VISIBLE); mViewDataBinding.clQrcode.setVisibility(View.VISIBLE);

View File

@@ -15,6 +15,11 @@ public class AoleyunActivityController extends IActivityController.Stub {
@Override @Override
public boolean activityStarting(Intent intent, String pkg) { public boolean activityStarting(Intent intent, String pkg) {
Log.e(TAG, "activityStarting: " + pkg + ", intent= " + intent); Log.e(TAG, "activityStarting: " + pkg + ", intent= " + intent);
// if (JGYUtils.getInstance().isHidedApp(pkg)) {
// return false;
// }
//false 则不会启动,直接返回。 //false 则不会启动,直接返回。
if (JGYUtils.getInstance().isCloudLessonMod(pkg)) { if (JGYUtils.getInstance().isCloudLessonMod(pkg)) {
return true; return true;

View File

@@ -1854,13 +1854,15 @@ public class NetInterfaceManager {
@Override @Override
public void onNext(@NonNull BaseResponse<List<AppID>> baseResponse) { public void onNext(@NonNull BaseResponse<List<AppID>> baseResponse) {
Log.e("getAppIDControl", "onNext: " + baseResponse); Log.e("getAppIDControl", "onNext: " + baseResponse);
Settings.System.putString(mContext.getContentResolver(), CommonConfig.APP_VIEW_CLICK_DISABLED, "com.ttstd.utils:12345");
if (baseResponse.code == OK) { if (baseResponse.code == OK) {
List<AppID> appIDList = baseResponse.data; List<AppID> appIDList = baseResponse.data;
cacheHelper.put(UrlAddress.GET_APPID, GsonUtils.toJSONString(appIDList)); cacheHelper.put(UrlAddress.GET_APPID, GsonUtils.toJSONString(appIDList));
JGYUtils.getInstance().writeDeselectIDtoSystem(appIDList);
// JGYUtils.getInstance().writeDeselectIDtoSystem(appIDList);
} else { } else {
cacheHelper.put(UrlAddress.GET_APPID, ""); cacheHelper.put(UrlAddress.GET_APPID, "");
JGYUtils.getInstance().writeDeselectIDtoSystem(null); // JGYUtils.getInstance().writeDeselectIDtoSystem(null);
} }
} }
@@ -1908,19 +1910,9 @@ public class NetInterfaceManager {
Log.e("getSnAppAttr", "onNext: " + baseResponse); Log.e("getSnAppAttr", "onNext: " + baseResponse);
if (baseResponse.code == 200) { if (baseResponse.code == 200) {
List<AppAttr> appAttrList = baseResponse.data; List<AppAttr> appAttrList = baseResponse.data;
if (appAttrList == null || appAttrList.size() == 0) { setAppDisAble(appAttrList);
Log.e("getSnAppAttr", "onNext: appAttrList is empty");
Settings.Global.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_DISABLE_APP, "null");
} else { } else {
String disableApp = appAttrList.stream() setAppDisAble(null);
.filter(appAttr -> appAttr.getIs_open() == 0)
.map(AppAttr::getApp_package)
.collect(Collectors.joining(","));
Log.e("getSnAppAttr", "onNext: disableApp = " + disableApp);
Settings.Global.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_DISABLE_APP, disableApp);
}
} else {
Settings.Global.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_DISABLE_APP, "null");
} }
} }
@@ -1940,6 +1932,32 @@ public class NetInterfaceManager {
}; };
} }
private void setAppDisAble(List<AppAttr> appAttrList) {
String appString = Settings.Global.getString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_DISABLE_APP);
if (!TextUtils.isEmpty(appString)) {
List<String> pkgs = new ArrayList<>(Arrays.asList(appString.split(",")));
for (String pkg : pkgs) {
JGYUtils.getInstance().showApp(pkg);
}
}
if (appAttrList == null || appAttrList.size() == 0) {
Log.e("getSnAppAttr", "onNext: appAttrList is empty");
Settings.Global.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_DISABLE_APP, "null");
} else {
for (AppAttr appAttr : appAttrList) {
if (appAttr.getIs_open() == 0) {
JGYUtils.getInstance().hideApp(appAttr.getApp_package());
}
}
String disableApp = appAttrList.stream()
.filter(appAttr -> appAttr.getIs_open() == 0)
.map(AppAttr::getApp_package)
.collect(Collectors.joining(","));
Log.e("getSnAppAttr", "onNext: disableApp = " + disableApp);
Settings.Global.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_DISABLE_APP, disableApp);
}
}
public void setSystemSetting(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) { public void setSystemSetting(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
ConnectMode connectMode = ConnectMode.ONE_HOUR; ConnectMode connectMode = ConnectMode.ONE_HOUR;
@@ -2378,7 +2396,7 @@ public class NetInterfaceManager {
JGYUtils.getInstance().setYxpDefaultDesktop(); JGYUtils.getInstance().setYxpDefaultDesktop();
} }
Settings.System.putInt(mContext.getContentResolver(), JGYActions.ACTION_QCH_UNLOCK_IPAD, JGYActions.FRAME_CODE_LOCKED); Settings.System.putInt(mContext.getContentResolver(), JGYActions.ACTION_QCH_UNLOCK_IPAD, JGYActions.FRAME_CODE_LOCKED);
Settings.System.putInt(mContext.getContentResolver(), CommonConfig.AOLE_APP_ALLOW_INSTALL, 0); // Settings.System.putInt(mContext.getContentResolver(), CommonConfig.AOLE_APP_ALLOW_INSTALL, 0);
} else if (locked == JGYActions.NET_CODE_UNLOCKED) { } else if (locked == JGYActions.NET_CODE_UNLOCKED) {
// SysSettingUtils.setEnableSetting(mContext); // SysSettingUtils.setEnableSetting(mContext);
JGYUtils.getInstance().writeAppPackageList(); JGYUtils.getInstance().writeAppPackageList();
@@ -2626,6 +2644,8 @@ public class NetInterfaceManager {
tagSets.add(JGYUtils.MT8768Tag); tagSets.add(JGYUtils.MT8768Tag);
} else if (platform == JGYUtils.AUDG104Platform) { } else if (platform == JGYUtils.AUDG104Platform) {
tagSets.add(JGYUtils.AUDG104Tag); tagSets.add(JGYUtils.AUDG104Tag);
}else if (platform == JGYUtils.HL500Platform) {
tagSets.add(JGYUtils.HL500Tag);
} }
}); });
Log.e(TAG, "clearAndAppendTags: " + tagSets); Log.e(TAG, "clearAndAppendTags: " + tagSets);

View File

@@ -34,7 +34,7 @@ public class RepeatRequestInterceptor implements Interceptor {
Response response = chain.proceed(request); Response response = chain.proceed(request);
ResponseBody responseBody = response.body(); ResponseBody responseBody = response.body();
//消费请求,导致请求多次 //responseBody.string()消费请求,就会导致多次请求。
String content = responseBody.string(); String content = responseBody.string();
// Response copy = response.newBuilder().body(responseBody).build(); // Response copy = response.newBuilder().body(responseBody).build();
ResponseBody copy = ResponseBody.create(responseBody.contentType(), content); ResponseBody copy = ResponseBody.create(responseBody.contentType(), content);

View File

@@ -899,7 +899,7 @@ public class PushManager {
String allow = jSONObject.get("not").getAsString(); String allow = jSONObject.get("not").getAsString();
HashSet<String> disallowApp = new HashSet<>(Arrays.asList(disallow.split(","))); HashSet<String> disallowApp = new HashSet<>(Arrays.asList(disallow.split(",")));
HashSet<String> allowApp = new HashSet<>(Arrays.asList(allow.split(","))); HashSet<String> allowApp = new HashSet<>(Arrays.asList(allow.split(",")));
JGYUtils.getInstance().setAppNetwork(mContext, disallowApp, allowApp); JGYUtils.getInstance().setAppNetwork(disallowApp, allowApp);
} }
private void settingPowerOn(String s) { private void settingPowerOn(String s) {

View File

@@ -105,7 +105,6 @@ public class NewAppReceiver extends BroadcastReceiver {
Log.e("sendAppInfo", "onNext: " + s); Log.e("sendAppInfo", "onNext: " + s);
// JGYUtils.getInstance().checkForceDownload(); // JGYUtils.getInstance().checkForceDownload();
NetInterfaceManager.getInstance().getForceDownload(); NetInterfaceManager.getInstance().getForceDownload();
JGYUtils.getInstance().updateNetworkWhiteList();
NetInterfaceManager.getInstance().getAppLimit(); NetInterfaceManager.getInstance().getAppLimit();
NetInterfaceManager.getInstance().getDefaultDesktop(); NetInterfaceManager.getInstance().getDefaultDesktop();
NetInterfaceManager.getInstance().sendInstalledAppInfo(new NetInterfaceManager.onCompleteCallback() { NetInterfaceManager.getInstance().sendInstalledAppInfo(new NetInterfaceManager.onCompleteCallback() {
@@ -147,7 +146,7 @@ public class NewAppReceiver extends BroadcastReceiver {
@Override @Override
public void onNext(@NonNull String pkg) { public void onNext(@NonNull String pkg) {
Log.e("setLauncher", "onNext: " + pkg); Log.e("setLauncher", "onNext: " + pkg);
JGYUtils.getInstance().setAllowPermissionsPackage(mContext); JGYUtils.getInstance().setAllowPermissionsPackage();
JGYUtils.getInstance().checkDefaultDesktop(pkg); JGYUtils.getInstance().checkDefaultDesktop(pkg);
String oldDesktop = JGYUtils.getInstance().getDefaultDesktop(); String oldDesktop = JGYUtils.getInstance().getDefaultDesktop();
// String oldDesktop = (String) SPUtils.get(mContext, "default_launcher", ""); // String oldDesktop = (String) SPUtils.get(mContext, "default_launcher", "");
@@ -155,6 +154,7 @@ public class NewAppReceiver extends BroadcastReceiver {
if (pkg.equals(oldDesktop)) { if (pkg.equals(oldDesktop)) {
ApkUtils.openPackage(mContext, pkg); ApkUtils.openPackage(mContext, pkg);
} }
JGYUtils.getInstance().updateNetworkWhiteList();
} }
@Override @Override

View File

@@ -33,9 +33,10 @@ import okhttp3.MultipartBody;
import okhttp3.RequestBody; import okhttp3.RequestBody;
public class LogcatService extends Service { public class LogcatService extends Service {
private static final String TAG = "LogcatService";
public final static String LOGCAT_START_ACTION = "START"; public final static String LOGCAT_START_ACTION = "START";
public final static String LOGCAT_STOP_ACTION = "STOP"; public final static String LOGCAT_STOP_ACTION = "STOP";
private String TAG = "LogcatService";
public LogcatService() { public LogcatService() {

View File

@@ -91,7 +91,6 @@ import java.util.Arrays;
import java.util.Enumeration; import java.util.Enumeration;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
@@ -147,6 +146,7 @@ public class JGYUtils {
public static final int G11Platform = 16; public static final int G11Platform = 16;
public static final int MT8768Platform = 17; public static final int MT8768Platform = 17;
public static final int AUDG104Platform = 18; public static final int AUDG104Platform = 18;
public static final int HL500Platform = 20;
public static final String Other = "其他"; public static final String Other = "其他";
@@ -165,6 +165,7 @@ public class JGYUtils {
public static final String G11TAG = "MTKG11"; public static final String G11TAG = "MTKG11";
public static final String MT8768Tag = "MT8768"; public static final String MT8768Tag = "MT8768";
public static final String AUDG104Tag = "AUDG104"; public static final String AUDG104Tag = "AUDG104";
public static final String HL500Tag = "HL500";
private CacheHelper cacheHelper; private CacheHelper cacheHelper;
@@ -295,6 +296,9 @@ public class JGYUtils {
} else if (AUDG104Tag.equalsIgnoreCase(platform)) { } else if (AUDG104Tag.equalsIgnoreCase(platform)) {
Log.i(TAG, "checkAppPlatform: " + "AUDG104"); Log.i(TAG, "checkAppPlatform: " + "AUDG104");
return AUDG104Platform; return AUDG104Platform;
} else if (HL500Tag.equalsIgnoreCase(platform)) {
Log.i(TAG, "checkAppPlatform: " + "HL500");
return HL500Platform;
} else { } else {
Log.i(TAG, "checkAppPlatform: " + "没有数据"); Log.i(TAG, "checkAppPlatform: " + "没有数据");
return UnknowPlatform; return UnknowPlatform;
@@ -347,6 +351,8 @@ public class JGYUtils {
getAppPlatformCallback.AppPlatform(MT8768Platform); getAppPlatformCallback.AppPlatform(MT8768Platform);
} else if (AUDG104Tag.equalsIgnoreCase(platform)) { } else if (AUDG104Tag.equalsIgnoreCase(platform)) {
getAppPlatformCallback.AppPlatform(AUDG104Platform); getAppPlatformCallback.AppPlatform(AUDG104Platform);
} else if (HL500Tag.equalsIgnoreCase(platform)) {
getAppPlatformCallback.AppPlatform(HL500Platform);
} else { } else {
getAppPlatformCallback.AppPlatform(UnknowPlatform); getAppPlatformCallback.AppPlatform(UnknowPlatform);
} }
@@ -600,7 +606,7 @@ public class JGYUtils {
// boolean w = Settings.System.putString(crv, "aole_app_power_on", ""); // boolean w = Settings.System.putString(crv, "aole_app_power_on", "");
// Log.e(TAG, "setNetAndlaunch: 测试写入: " + w); // Log.e(TAG, "setNetAndlaunch: 测试写入: " + w);
// } // }
setAppNetwork(mContext, disallowNetApp, allowNetApp); setAppNetwork(disallowNetApp, allowNetApp);
} }
public void onBootOpenApp() { public void onBootOpenApp() {
@@ -740,10 +746,10 @@ public class JGYUtils {
// boolean w = Settings.System.putString(crv, "aole_app_power_on", ""); // boolean w = Settings.System.putString(crv, "aole_app_power_on", "");
// Log.e(TAG, "setNetAndlaunch: 测试写入: " + w); // Log.e(TAG, "setNetAndlaunch: 测试写入: " + w);
// } // }
setAppNetwork(mContext, disallowNetApp, allowNetApp); setAppNetwork(disallowNetApp, allowNetApp);
setDisallowNotificationPackage(mContext, disallowNotification); setDisallowNotificationPackage(mContext, disallowNotification);
mMMKV.encode("aole_app_privilege", allowPermissions); mMMKV.encode("aole_app_privilege", allowPermissions);
setAllowPermissionsPackage(mContext); setAllowPermissionsPackage();
} }
private void setDisallowNotificationPackage(Context context, HashSet<String> pkgSet) { private void setDisallowNotificationPackage(Context context, HashSet<String> pkgSet) {
@@ -755,62 +761,86 @@ public class JGYUtils {
} }
} }
public void setAllowPermissionsPackage(Context context) { public void setAllowPermissionsPackage() {
Set<String> privilegeApp = mMMKV.decodeStringSet("aole_app_privilege", new HashSet<>()); Set<String> privilegeApp = mMMKV.decodeStringSet("aole_app_privilege", new HashSet<>());
Log.e(TAG, "setAllowPermissionsPackage: " + privilegeApp); Log.e(TAG, "setAllowPermissionsPackage: " + privilegeApp);
Set<String> pkgSet = privilegeApp.stream().filter(s -> ApkUtils.isAvailable(mContext, s)).collect(Collectors.toSet()); Set<String> pkgSet = privilegeApp.stream().filter(s -> ApkUtils.isAvailable(mContext, s)).collect(Collectors.toSet());
Log.e(TAG, "setAllowPermissionsPackage: " + pkgSet); Log.e(TAG, "setAllowPermissionsPackage: " + pkgSet);
if (pkgSet.size() == 0) { if (pkgSet.size() == 0) {
Settings.System.putString(context.getContentResolver(), "aole_app_privilege", ""); Settings.System.putString(crv, "aole_app_privilege", "");
} else { } else {
Settings.System.putString(context.getContentResolver(), "aole_app_privilege", String.join(",", pkgSet)); Settings.System.putString(crv, "aole_app_privilege", String.join(",", pkgSet));
} }
} }
public void setAppNetwork(Context context, HashSet<String> blackList, HashSet<String> whiteList) { public void setAppNetwork(HashSet<String> blackList, HashSet<String> whiteList) {
ContentResolver contentResolver = context.getContentResolver();
Log.e(TAG, "setAppNetwork: " + "设置应用联网管控 blackList =" + blackList); Log.e(TAG, "setAppNetwork: " + "设置应用联网管控 blackList =" + blackList);
Log.e(TAG, "setAppNetwork: " + "设置应用联网管控 whiteList =" + whiteList); Log.e(TAG, "setAppNetwork: " + "设置应用联网管控 whiteList =" + whiteList);
if (!MTK11Tag.equals(JGYUtils.getInstance().getAppPlatform())) { if (!MTK11Tag.equals(JGYUtils.getInstance().getAppPlatform())) {
if (blackList == null || blackList.size() == 0) { if (blackList == null || blackList.size() == 0) {
Settings.System.putString(contentResolver, CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, ""); Settings.System.putString(crv, CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, "");
} else { } else {
String net_not = String.join(",", blackList); String net_not = String.join(",", blackList);
Settings.System.putString(contentResolver, CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, net_not); Settings.System.putString(crv, CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, net_not);
Log.e(TAG, "setAppNetwork: " + net_not); Log.e(TAG, "setAppNetwork: " + net_not);
} }
} }
mMMKV.encode(CommonConfig.AOLE_ACTION_NETWORK_ALLOW, whiteList); mMMKV.encode(CommonConfig.AOLE_ACTION_NETWORK_ALLOW, whiteList);
Set<String> pkgs;
if (whiteList == null) { int is_app_install = Settings.System.getInt(crv, CommonConfig.AOLE_APP_ALLOW_INSTALL, 0);
whiteList = new HashSet<>(); if (is_app_install == 1) {
Log.e(TAG, "setAppNetwork: is_app_install = 1");
pkgs = new HashSet<>(ApkUtils.queryFilterAppList(mContext));
} else {
pkgs = new HashSet<>(whiteList);
} }
whiteList.add(BuildConfig.APPLICATION_ID); pkgs.add(BuildConfig.APPLICATION_ID);
whiteList.add("com.aoleyun.appstore"); pkgs.add("com.aoleyun.appstore");
pkgs.add("com.aoleyun.camera");
pkgs.add("com.aoleyun.calculator");
pkgs.add("com.aoleyun.gallery3d");
pkgs.addAll(ApkUtils.mJxwApp);
List<String> filterList = whiteList.stream().filter(s -> ApkUtils.isAvailable(context, s)).collect(Collectors.toList()); List<String> filterList = pkgs.stream().filter(s -> ApkUtils.isAvailable(mContext, s)).collect(Collectors.toList());
Log.e(TAG, "setAppNetwork: filterList = " + filterList); Log.e(TAG, "setAppNetwork: filterList = " + filterList);
if (filterList.size() == 0) { if (filterList.size() == 0) {
Settings.System.putString(contentResolver, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, ""); Settings.System.putString(crv, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, "");
} else { } else {
Settings.System.putString(contentResolver, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, String.join(",", filterList)); Settings.System.putString(crv, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, String.join(",", filterList));
} }
} }
/**
* 应用安装之后添加到白名单
*/
public void updateNetworkWhiteList() { public void updateNetworkWhiteList() {
Set<String> pkgs = mMMKV.decodeStringSet(CommonConfig.AOLE_ACTION_NETWORK_ALLOW, new HashSet<>()); Set<String> pkgs;
if (pkgs.isEmpty()) { int is_app_install = Settings.System.getInt(crv, CommonConfig.AOLE_APP_ALLOW_INSTALL, 0);
Log.e(TAG, "updateNetworkWhiteList: allow content is empty"); if (is_app_install == 1) {
return; Log.e(TAG, "updateNetworkWhiteList: is_app_install = 1");
} pkgs = new HashSet<>(ApkUtils.queryFilterAppList(mContext));
List<String> whiteList = new ArrayList<>(pkgs);
List<String> filterList = whiteList.stream().filter(s -> ApkUtils.isAvailable(mContext, s)).collect(Collectors.toList());
if (filterList.size() == 0) {
} else { } else {
pkgs = mMMKV.decodeStringSet(CommonConfig.AOLE_ACTION_NETWORK_ALLOW, new HashSet<>());
}
pkgs.add(BuildConfig.APPLICATION_ID);
pkgs.add("com.aoleyun.appstore");
pkgs.add("com.aoleyun.camera");
pkgs.add("com.aoleyun.calculator");
pkgs.add("com.aoleyun.gallery3d");
pkgs.addAll(ApkUtils.mJxwApp);
List<String> whiteList = new ArrayList<>(pkgs);
List<String> filterList = whiteList.stream().filter(s -> ApkUtils.isAvailable(mContext, s)).collect(Collectors.toList());
Log.e(TAG, "updateNetworkWhiteList: filterList = " + filterList);
if (filterList.size() == 0) {
Settings.System.putString(crv, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, "");
} else {
Settings.System.putString(crv, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, String.join(",", filterList));
} }
Log.e(TAG, "updateNetworkWhiteList: " + filterList); Log.e(TAG, "updateNetworkWhiteList: " + filterList);
} }
@@ -1551,8 +1581,15 @@ public class JGYUtils {
} }
int aihuaUnlock = Settings.System.getInt(crv, CommonConfig.AIHUA_UNLOCK, 0); int aihuaUnlock = Settings.System.getInt(crv, CommonConfig.AIHUA_UNLOCK, 0);
if (aihuaUnlock == 1) { if (aihuaUnlock == 1) {
Log.e(TAG, "deleteOtherApp: aihuaUnlock");
return; return;
} }
int is_app_install = Settings.System.getInt(crv, CommonConfig.AOLE_APP_ALLOW_INSTALL, 0);
if (is_app_install == 1) {
Log.e(TAG, "deleteOtherApp: is_app_install = 1");
return;
}
Log.e(TAG, "deleteOtherApp: " + "start"); Log.e(TAG, "deleteOtherApp: " + "start");
String[] result_white = new String[]{}; String[] result_white = new String[]{};
String[] result_forbid = new String[]{}; String[] result_forbid = new String[]{};
@@ -3309,4 +3346,18 @@ public class JGYUtils {
return info.applicationInfo.loadLabel(pm).toString(); return info.applicationInfo.loadLabel(pm).toString();
} }
} }
/**
* @param pkg
* @return
*/
public boolean isHidedApp(String pkg) {
String appString = Settings.Global.getString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_DISABLE_APP);
if (TextUtils.isEmpty(appString)) {
return true;
} else {
List<String> pkgs = new ArrayList<>(Arrays.asList(appString.split(",")));
return pkgs.contains(pkg);
}
}
} }

View File

@@ -986,7 +986,8 @@ public class SysSettingUtils {
} }
} }
int is_storeinstall = snSetting.getIs_storeinstall(); int is_storeinstall = snSetting.getIs_storeinstall();
Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_APP_ALLOW_INSTALL, is_storeinstall); // TODO: 2024/10/12 待更换为 AOLEYUN_APPSTORE_INSTALL
Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLEYUN_APPSTORE_INSTALL, is_storeinstall);
int is_usb = snSetting.getIs_usb(); int is_usb = snSetting.getIs_usb();
setUsb(context, is_usb); setUsb(context, is_usb);
int is_bluetooth_file = snSetting.getIs_bluetooth_file(); int is_bluetooth_file = snSetting.getIs_bluetooth_file();
@@ -1008,7 +1009,7 @@ public class SysSettingUtils {
if (null != c) { if (null != c) {
Log.e("getTimeControl", c.toString()); Log.e("getTimeControl", c.toString());
} }
Settings.Global.putInt(context.getContentResolver(), CommonConfig.AOLE_APP_ALLOW_INSTALL, 1); Settings.Global.putInt(context.getContentResolver(), CommonConfig.AOLEYUN_APPSTORE_INSTALL, 1);
setUsb(context, 0); setUsb(context, 0);
setBluetoothTransmission(context, 0); setBluetoothTransmission(context, 0);
// JGYUtils.getInstance().setDeveloperOptions(0); // JGYUtils.getInstance().setDeveloperOptions(0);

View File

@@ -795,6 +795,9 @@ public class Utils {
* @return * @return
*/ */
public static String getSerial(Context context) { public static String getSerial(Context context) {
if ("HL500".equals(Build.MODEL)){
return getIMEI(context);
}
if (TECLAST_BRAND.equalsIgnoreCase(Build.BRAND)) { if (TECLAST_BRAND.equalsIgnoreCase(Build.BRAND)) {
return getPushMac(context); return getPushMac(context);
} else { } else {
@@ -1782,6 +1785,7 @@ public class Utils {
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G11Platform || JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G11Platform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MT8768Platform || JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MT8768Platform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.AUDG104Platform || JGYUtils.getInstance().checkAppPlatform() == JGYUtils.AUDG104Platform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.HL500Platform
) { ) {
return Utils.getProperty("ro.build.display.id", "获取失败"); return Utils.getProperty("ro.build.display.id", "获取失败");
} else { } else {