chore: 更新网络接口管理与推送相关代码及构建配置
This commit is contained in:
@@ -18,8 +18,8 @@ android {
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.aoleyun.sn"
|
||||
versionCode 240
|
||||
versionName "1.6.0915"
|
||||
versionCode 242
|
||||
versionName "1.6.0918"
|
||||
|
||||
//There are no CERT files because If the mini sdk version is 23+, the AGP will ignore the V1 scheme signature.
|
||||
minSdkVersion 24
|
||||
|
||||
@@ -4231,13 +4231,23 @@ public class NetInterfaceManager {
|
||||
if (blacklistBeanBaseResponse.isSuccess()) {
|
||||
WhitelistBean whitelistBean = blacklistBeanBaseResponse.data;
|
||||
if (whitelistBean == null) {
|
||||
if ("Ebox201W".equals(Build.MODEL) || "Ebox201".equals(Build.MODEL) || "G128A".equals(Build.MODEL))
|
||||
if ("Ebox201W".equals(Build.MODEL) || "Ebox201".equals(Build.MODEL) || "G128A".equals(Build.MODEL)) {
|
||||
Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_APP_WEB_WHITE_LIST, null);
|
||||
} else {
|
||||
if ("Ebox201w".equals(Build.MODEL) && JgyUtils.getInstance().checkAppPlatform() == JgyUtils.MT8768Platform) {
|
||||
Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_APP_WEB_WHITE_LIST, null);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
List<String> strings = whitelistBean.getWhitelist();
|
||||
if (strings == null || strings.isEmpty()) {
|
||||
if ("Ebox201W".equals(Build.MODEL) || "Ebox201".equals(Build.MODEL) || "G128A".equals(Build.MODEL))
|
||||
if ("Ebox201W".equals(Build.MODEL) || "Ebox201".equals(Build.MODEL) || "G128A".equals(Build.MODEL)) {
|
||||
Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_APP_WEB_WHITE_LIST, null);
|
||||
} else {
|
||||
if ("Ebox201w".equals(Build.MODEL) && JgyUtils.getInstance().checkAppPlatform() == JgyUtils.MT8768Platform) {
|
||||
Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_APP_WEB_WHITE_LIST, null);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ("Ebox201W".equals(Build.MODEL) || "Ebox201".equals(Build.MODEL) || "G128A".equals(Build.MODEL)) {
|
||||
// TODO: 2024/10/31 需要多写一次保证数据库变化
|
||||
@@ -4245,12 +4255,21 @@ public class NetInterfaceManager {
|
||||
Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_APP_WEB_WHITE_LIST, String.join(",", strings));
|
||||
strings.remove("ttstd.com");
|
||||
Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_APP_WEB_WHITE_LIST, String.join(",", strings));
|
||||
} else {
|
||||
if ("Ebox201w".equals(Build.MODEL) && JgyUtils.getInstance().checkAppPlatform() == JgyUtils.MT8768Platform) {
|
||||
Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_APP_WEB_WHITE_LIST, String.join(",", strings));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ("Ebox201W".equals(Build.MODEL) || "Ebox201".equals(Build.MODEL) || "G128A".equals(Build.MODEL))
|
||||
if ("Ebox201W".equals(Build.MODEL) || "Ebox201".equals(Build.MODEL) || "G128A".equals(Build.MODEL)) {
|
||||
Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_APP_WEB_WHITE_LIST, null);
|
||||
} else {
|
||||
if ("Ebox201w".equals(Build.MODEL) && JgyUtils.getInstance().checkAppPlatform() == JgyUtils.MT8768Platform) {
|
||||
Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_APP_WEB_WHITE_LIST, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ import com.aoleyun.sn.utils.JgyUtils;
|
||||
import com.aoleyun.sn.utils.MySQLData;
|
||||
import com.aoleyun.sn.utils.SPUtils;
|
||||
import com.aoleyun.sn.utils.ServiceAliveUtils;
|
||||
import com.aoleyun.sn.utils.SysSettingUtils;
|
||||
import com.aoleyun.sn.utils.TimeUtils;
|
||||
import com.aoleyun.sn.utils.Utils;
|
||||
import com.arialyy.aria.core.Aria;
|
||||
@@ -325,6 +326,7 @@ public class PushManager {
|
||||
Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_FORCE_APP, "");
|
||||
Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID, "");
|
||||
sendRefreshBroadcast(mContext);
|
||||
SysSettingUtils.setDisableSetting(mContext);
|
||||
break;
|
||||
case MSG_INSTALL:
|
||||
Toaster.debugShow("收到管控:应用安装");
|
||||
|
||||
@@ -94,7 +94,7 @@ public class BootReceiver extends BroadcastReceiver {
|
||||
new BootManager(context).start();
|
||||
break;
|
||||
case BOOT_COMPLETED:
|
||||
new BootManager(context).start();
|
||||
// new BootManager(context).start();
|
||||
case Intent.ACTION_BATTERY_CHANGED:
|
||||
case Intent.ACTION_BATTERY_LOW:
|
||||
case Intent.ACTION_BATTERY_OKAY:
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.aoleyun.sn.utils;
|
||||
|
||||
import static android.app.ActivityManager.RECENT_IGNORE_UNAVAILABLE;
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.ActivityManager;
|
||||
import android.app.ActivityManagerNative;
|
||||
@@ -863,23 +864,91 @@ public class JgyUtils {
|
||||
this.add("com.aoleyunos.natuer");
|
||||
}};
|
||||
|
||||
/**
|
||||
* 获取所有声明了 android.permission.INTERNET 权限的系统应用的包名
|
||||
* <p>
|
||||
* 未申请 INTERNET 权限的系统应用本身就无法访问网络,将其加入联网白名单没有意义,
|
||||
* 反而会无谓地扩大白名单范围,因此这里只收集真正需要联网的系统应用。
|
||||
*/
|
||||
private Set<String> getSystemAppSet() {
|
||||
Set<String> systemAppSet = new HashSet<>();
|
||||
if (mContext == null) {
|
||||
Log.e(TAG, "getSystemAppSet: mContext is null");
|
||||
return systemAppSet;
|
||||
}
|
||||
try {
|
||||
PackageManager pm = mContext.getPackageManager();
|
||||
// 一次性取回所有已安装应用及其权限声明,避免按包名逐个查询
|
||||
List<PackageInfo> packageInfos = pm.getInstalledPackages(PackageManager.GET_PERMISSIONS);
|
||||
for (PackageInfo packageInfo : packageInfos) {
|
||||
ApplicationInfo appInfo = packageInfo.applicationInfo;
|
||||
if (appInfo == null) {
|
||||
continue;
|
||||
}
|
||||
boolean isSystem = (appInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0;
|
||||
boolean isUpdatedSystem = (appInfo.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0;
|
||||
if (!isSystem && !isUpdatedSystem) {
|
||||
continue;
|
||||
}
|
||||
if (!isInternetPermissionDeclared(packageInfo.requestedPermissions)) {
|
||||
continue;
|
||||
}
|
||||
systemAppSet.add(appInfo.packageName);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "getSystemAppSet: " + e.getMessage());
|
||||
}
|
||||
Log.e(TAG, "getSystemAppSet: " + systemAppSet);
|
||||
return systemAppSet;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断应用是否在清单文件中声明了 android.permission.INTERNET 权限
|
||||
*
|
||||
* @param requestedPermissions 应用申请的权限列表
|
||||
* @return true 表示该应用申请了联网权限
|
||||
*/
|
||||
private boolean isInternetPermissionDeclared(String[] requestedPermissions) {
|
||||
if (requestedPermissions == null || requestedPermissions.length == 0) {
|
||||
return false;
|
||||
}
|
||||
for (String permission : requestedPermissions) {
|
||||
if (Manifest.permission.INTERNET.equals(permission)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public void setAppNetwork(HashSet<String> blackList, HashSet<String> whiteList) {
|
||||
Log.e(TAG, "setAppNetwork: " + "设置应用联网管控 blackList =" + blackList);
|
||||
Log.e(TAG, "setAppNetwork: " + "设置应用联网管控 whiteList =" + whiteList);
|
||||
|
||||
//两个Ebox201W不一样,签名不一样,分开处理
|
||||
if ("Ebox201W".equals(Build.MODEL) || "Ebox201".equals(Build.MODEL) || "G128A".equals(Build.MODEL)) {
|
||||
Log.e(TAG, "setAppNetwork: Ebox201 skip delete");
|
||||
} else {
|
||||
try {
|
||||
Settings.System.putString(crv, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, null);
|
||||
CmdUtil.Result result = CmdUtil.execute(" settings delete system aole_network_allow");
|
||||
Log.e(TAG, "setAppNetwork: " + result);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
if ("Ebox201w".equals(Build.MODEL) && checkAppPlatform() == JgyUtils.MT8768Platform) {
|
||||
Set<String> whiteAppSet = new HashSet<>();
|
||||
whiteAppSet.addAll(getSystemAppSet());
|
||||
whiteAppSet.addAll(whiteList);
|
||||
whiteAppSet.addAll(ApkUtils.aoleyunAPP);
|
||||
Set<String> filter = whiteAppSet.stream().filter(s -> ApkUtils.isAvailable(mContext, s)).collect(Collectors.toSet());
|
||||
Log.e(TAG, "setAppNetwork: filter = " + filter);
|
||||
Settings.System.putString(crv, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, String.join(",", filter));
|
||||
} else {
|
||||
try {
|
||||
Settings.System.putString(crv, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, null);
|
||||
CmdUtil.Result result = CmdUtil.execute(" settings delete system aole_network_allow");
|
||||
Log.e(TAG, "setAppNetwork: " + result);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!MTK11Tag.equals(JgyUtils.getInstance().getAppPlatform())) {
|
||||
if (!MTK11Tag.equals(getAppPlatform())) {
|
||||
if (blackList == null || blackList.size() == 0) {
|
||||
Settings.System.putString(crv, CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, null);
|
||||
} else {
|
||||
@@ -932,20 +1001,31 @@ public class JgyUtils {
|
||||
if ("Ebox201W".equals(Build.MODEL) || "Ebox201".equals(Build.MODEL) || "G128A".equals(Build.MODEL)) {
|
||||
|
||||
} else {
|
||||
Settings.System.putString(crv, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, null);
|
||||
try {
|
||||
CmdUtil.Result result = CmdUtil.execute(" settings delete system aole_network_allow");
|
||||
Log.e(TAG, "updateNetworkWhiteList: " + result);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
if ("Ebox201w".equals(Build.MODEL) && checkAppPlatform() == JgyUtils.MT8768Platform) {
|
||||
Set<String> whiteList = mMMKV.decodeStringSet(CommonConfig.AOLE_ACTION_NETWORK_ALLOW, new HashSet<>());
|
||||
Set<String> whiteAppSet = new HashSet<>();
|
||||
whiteAppSet.addAll(getSystemAppSet());
|
||||
whiteAppSet.addAll(whiteList);
|
||||
whiteAppSet.addAll(ApkUtils.aoleyunAPP);
|
||||
Set<String> filter = whiteAppSet.stream().filter(s -> ApkUtils.isAvailable(mContext, s)).collect(Collectors.toSet());
|
||||
Log.e(TAG, "setAppNetwork: filter = " + filter);
|
||||
Settings.System.putString(crv, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, String.join(",", filter));
|
||||
} else {
|
||||
try {
|
||||
Settings.System.putString(crv, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, null);
|
||||
CmdUtil.Result result = CmdUtil.execute(" settings delete system aole_network_allow");
|
||||
Log.e(TAG, "updateNetworkWhiteList: " + result);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ("Ebox201W".equals(Build.MODEL) || "Ebox201".equals(Build.MODEL) || "G128A".equals(Build.MODEL)) {
|
||||
|
||||
} else {
|
||||
Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_APP_WEB_BLACK_LIST, null);
|
||||
try {
|
||||
Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_APP_WEB_BLACK_LIST, null);
|
||||
CmdUtil.Result result = CmdUtil.execute(" settings delete system app_web_black_list");
|
||||
Log.e(TAG, "updateNetworkWhiteList: " + result);
|
||||
} catch (Exception e) {
|
||||
@@ -956,12 +1036,17 @@ public class JgyUtils {
|
||||
if ("Ebox201W".equals(Build.MODEL) || "Ebox201".equals(Build.MODEL) || "G128A".equals(Build.MODEL)) {
|
||||
|
||||
} else {
|
||||
Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_APP_WEB_WHITE_LIST, null);
|
||||
try {
|
||||
CmdUtil.Result result = CmdUtil.execute(" settings delete system app_web_white_list");
|
||||
Log.e(TAG, "updateNetworkWhiteList: " + result);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
if ("Ebox201w".equals(Build.MODEL) && checkAppPlatform() == JgyUtils.MT8768Platform) {
|
||||
Log.e(TAG, "updateNetworkWhiteList: SystemString = " + Settings.System.getString(mContext.getContentResolver(), CommonConfig.AOLE_APP_WEB_WHITE_LIST));
|
||||
Log.e(TAG, "updateNetworkWhiteList: MT8768 Ebox201w");
|
||||
} else {
|
||||
try {
|
||||
Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_APP_WEB_WHITE_LIST, null);
|
||||
CmdUtil.Result result = CmdUtil.execute(" settings delete system app_web_white_list");
|
||||
Log.e(TAG, "updateNetworkWhiteList: " + result);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -995,7 +1080,7 @@ public class JgyUtils {
|
||||
}
|
||||
|
||||
public void onBootSendNetwork() {
|
||||
if (!MTK11Tag.equals(JgyUtils.getInstance().getAppPlatform())) {
|
||||
if (!MTK11Tag.equals(getAppPlatform())) {
|
||||
String oldBlackListString = (String) SPUtils.get(mContext, CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, "");
|
||||
HashSet<String> oldBlackListSet = new HashSet<>(Arrays.asList(oldBlackListString.split(",")));
|
||||
Log.e(TAG, "setAppNetwork: oldBlackListSet: " + oldBlackListSet);
|
||||
@@ -1417,7 +1502,7 @@ public class JgyUtils {
|
||||
}
|
||||
SPUtils.put(mContext, JGYActions.ACTION_STATUSBAR_STATUS, "");
|
||||
} else {
|
||||
if (JgyUtils.getInstance().getAppPlatform().equals(JgyUtils.ZR6016Tag)) {
|
||||
if (getAppPlatform().equals(JgyUtils.ZR6016Tag)) {
|
||||
Log.e(TAG, "SettingSysData: ZR6016Tag");
|
||||
SysSettingUtils.setBluetooth(mContext, 0);
|
||||
}
|
||||
@@ -1493,7 +1578,7 @@ public class JgyUtils {
|
||||
pkgSet.add("com.copilot");
|
||||
pkgSet.add("com.xty22");
|
||||
}
|
||||
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.G11Platform) {
|
||||
if (checkAppPlatform() == JgyUtils.G11Platform) {
|
||||
pkgSet.addAll(ApkUtils.G11Pkgs);
|
||||
}
|
||||
if (JgyUtils.DX11_TAG.equals(Build.MODEL)) {
|
||||
@@ -1502,13 +1587,13 @@ public class JgyUtils {
|
||||
if ("MX11".equals(Build.MODEL)) {
|
||||
pkgSet.addAll(ApkUtils.MX11App);
|
||||
}
|
||||
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.YXPD1Platform) {
|
||||
if (checkAppPlatform() == JgyUtils.YXPD1Platform) {
|
||||
pkgSet.add("com.tencent.wemeet.app");
|
||||
}
|
||||
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.G10PPlatform) {
|
||||
if (checkAppPlatform() == JgyUtils.G10PPlatform) {
|
||||
pkgSet.add("com.gaomuxuexi34");
|
||||
}
|
||||
if (JgyUtils.C2Tag.equalsIgnoreCase(JgyUtils.getInstance().getAppPlatform())) {
|
||||
if (JgyUtils.C2Tag.equalsIgnoreCase(getAppPlatform())) {
|
||||
pkgSet.remove("com.tencent.mm");
|
||||
}
|
||||
return pkgSet;
|
||||
@@ -1585,7 +1670,7 @@ public class JgyUtils {
|
||||
// }.getType();
|
||||
// List<ForceDownloadData> forceDownloadData = gson.fromJson(jsonString, listType);
|
||||
// if (forceDownloadData != null) {
|
||||
// JgyUtils.getInstance().forceDownload(forceDownloadData);
|
||||
// forceDownload(forceDownloadData);
|
||||
// }
|
||||
// }
|
||||
NetInterfaceManager.getInstance().getForceDownload();
|
||||
@@ -2000,7 +2085,7 @@ public class JgyUtils {
|
||||
|
||||
public void checkBootFile(String url, String MD5) {
|
||||
String urlFileName = Utils.getFileNamefromURL(url);
|
||||
File bootFile = new File(JgyUtils.getInstance().getDownLoadPath() + urlFileName);
|
||||
File bootFile = new File(getDownLoadPath() + urlFileName);
|
||||
Log.e(TAG, "checkBootFile: bootFile file path=" + bootFile.getAbsolutePath());
|
||||
Log.e(TAG, "checkBootFile: bootFile exists=" + bootFile.exists() + " isFile=" + bootFile.isFile());
|
||||
if (bootFile.exists() && bootFile.isFile()) {
|
||||
@@ -2111,7 +2196,7 @@ public class JgyUtils {
|
||||
|
||||
public void removeBootanimation() {
|
||||
File systemFile;
|
||||
// if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.MT8768Platform) {
|
||||
// if (checkAppPlatform() == JgyUtils.MT8768Platform) {
|
||||
systemFile = new File(BOOTANIMATION_PATH_G10J);
|
||||
// } else {
|
||||
// systemFile = new File(BOOTANIMATION_PATH);
|
||||
@@ -2123,7 +2208,7 @@ public class JgyUtils {
|
||||
Log.e(TAG, "removeBootanimation: delete: " + "false");
|
||||
}
|
||||
}
|
||||
// if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.MT8768Platform) {
|
||||
// if (checkAppPlatform() == JgyUtils.MT8768Platform) {
|
||||
Intent intent = new Intent("com.hra.setBootanimation");
|
||||
mContext.sendBroadcast(intent);
|
||||
// }
|
||||
@@ -2299,7 +2384,7 @@ public class JgyUtils {
|
||||
Intent intent = new Intent(Intent.ACTION_MAIN);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
/*知道要跳转应用的包命与目标Activity*/
|
||||
switch (JgyUtils.getInstance().checkAppPlatform()) {
|
||||
switch (checkAppPlatform()) {
|
||||
default:
|
||||
case JgyUtils.YXPD1Platform:
|
||||
intent.setComponent(new ComponentName("com.adups.fota", "com.adups.fota.GoogleOtaClient"));
|
||||
@@ -2673,7 +2758,7 @@ public class JgyUtils {
|
||||
UserHandle user = Process.myUserHandle();
|
||||
Log.i("setRoleHolderAsUser", (add ? "Adding" : "Removing") + " package as role holder, role: "
|
||||
+ roleName + ", package: " + packageName);
|
||||
if (JgyUtils.getInstance().checkAppPlatform() != JgyUtils.MTKPlatform) {
|
||||
if (checkAppPlatform() != JgyUtils.MTKPlatform) {
|
||||
RoleManager roleManager = context.getSystemService(RoleManager.class);
|
||||
Executor executor = context.getMainExecutor();
|
||||
Consumer<Boolean> callback = successful -> {
|
||||
@@ -2698,23 +2783,23 @@ public class JgyUtils {
|
||||
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 (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.G11Platform) {
|
||||
JgyUtils.getInstance().setJXWDefaultDesktop();
|
||||
// } else if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.ZhanruiPlatform) {
|
||||
// JgyUtils.getInstance().setJXWDefaultDesktop();
|
||||
} else if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.AUDG104Platform
|
||||
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.G11JPlatform
|
||||
if (checkAppPlatform() == JgyUtils.YXPD1Platform) {
|
||||
setDop7DefaultDesktop();
|
||||
} else if (checkAppPlatform() == JgyUtils.G11Platform) {
|
||||
setJXWDefaultDesktop();
|
||||
// } else if (checkAppPlatform() == JgyUtils.ZhanruiPlatform) {
|
||||
// setJXWDefaultDesktop();
|
||||
} else if (checkAppPlatform() == JgyUtils.AUDG104Platform
|
||||
|| checkAppPlatform() == JgyUtils.G11JPlatform
|
||||
) {
|
||||
JgyUtils.getInstance().setAiuduDefaultDesktop();
|
||||
} else if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.MT6765Platform) {
|
||||
setAiuduDefaultDesktop();
|
||||
} else if (checkAppPlatform() == JgyUtils.MT6765Platform) {
|
||||
setDefaultDesktop(AlyOs, AlyOsClass);
|
||||
}
|
||||
} else {
|
||||
if (pkg.equalsIgnoreCase(desktopPkg)) {
|
||||
setDefaultDesktop(pkg);
|
||||
} else if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.MT6765Platform) {
|
||||
} else if (checkAppPlatform() == JgyUtils.MT6765Platform) {
|
||||
setDefaultDesktop(AlyOs, AlyOsClass);
|
||||
}
|
||||
}
|
||||
@@ -2806,11 +2891,11 @@ public class JgyUtils {
|
||||
if (ApkUtils.isAvailable(mContext, AoleyunOs)
|
||||
|| "C2".equals(Build.MODEL)) {
|
||||
setDefaultDesktop(AoleyunOs, AoleyunOsClass);
|
||||
} else if (JgyUtils.getInstance().isAiuduPlatform()) {
|
||||
} else if (isAiuduPlatform()) {
|
||||
setDefaultDesktop(AiUDuOs, AiUDuOsClass);
|
||||
} else if (JgyUtils.isAllWinnerDevice()) {
|
||||
setDefaultDesktop(schoolosOs, schoolosClass);
|
||||
} else if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.MT6765Platform) {
|
||||
} else if (checkAppPlatform() == JgyUtils.MT6765Platform) {
|
||||
setDefaultDesktop(AlyOs, AlyOsClass);
|
||||
} else {
|
||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.Q) {
|
||||
@@ -2825,11 +2910,11 @@ public class JgyUtils {
|
||||
if (ApkUtils.isAvailable(mContext, AoleyunOs)
|
||||
|| "C2".equals(Build.MODEL)) {
|
||||
ApkUtils.openPackage(mContext, AoleyunOs, AoleyunOsClass);
|
||||
} else if (JgyUtils.getInstance().isAiuduPlatform()) {
|
||||
} else if (isAiuduPlatform()) {
|
||||
ApkUtils.openPackage(mContext, AiUDuOs, AiUDuOsClass);
|
||||
} else if (JgyUtils.isAllWinnerDevice()) {
|
||||
ApkUtils.openPackage(mContext, schoolosOs, schoolosClass);
|
||||
} else if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.MT6765Platform) {
|
||||
} else if (checkAppPlatform() == JgyUtils.MT6765Platform) {
|
||||
ApkUtils.openPackage(mContext, AlyOs, AlyOsClass);
|
||||
} else {
|
||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.Q) {
|
||||
@@ -2896,7 +2981,7 @@ public class JgyUtils {
|
||||
Intent intent = new Intent("setDefaultLauncher");
|
||||
intent.putExtra("package", pkg);
|
||||
intent.putExtra("className", className);
|
||||
// if (JgyUtils.getInstance().checkAppPlatform() == MTKPlatform) {
|
||||
// if (checkAppPlatform() == MTKPlatform) {
|
||||
// Log.e(TAG, "setDefaultDesktop: MTK");
|
||||
// //爱华定制
|
||||
// intent.setComponent(new ComponentName("com.android.settings", "com.android.settings.AoleReceiver"));
|
||||
@@ -2970,7 +3055,7 @@ public class JgyUtils {
|
||||
jsonObject.addProperty("LAN_ip", Utils.getIPAddress(mContext));
|
||||
jsonObject.addProperty("bluetooth", Utils.getBluetoothList(mContext));
|
||||
jsonObject.addProperty("wifi_name", Utils.getWifiAlias(mContext));
|
||||
jsonObject.addProperty("platform", JgyUtils.getInstance().getAppPlatform());
|
||||
jsonObject.addProperty("platform", getAppPlatform());
|
||||
return jsonObject.toString();
|
||||
}
|
||||
|
||||
@@ -3624,7 +3709,7 @@ public class JgyUtils {
|
||||
* @return true为能打开
|
||||
*/
|
||||
public boolean isCloudLessonMod(String pkg) {
|
||||
if (JgyUtils.getInstance().isForbid(pkg)) {
|
||||
if (isForbid(pkg)) {
|
||||
return false;
|
||||
}
|
||||
if (ApkUtils.isSystemApp(mContext, pkg)) {
|
||||
@@ -3801,7 +3886,7 @@ public class JgyUtils {
|
||||
Log.e(TAG, "cubeMdmManager setDefaultInputMethod: " + pkg + " is not installed");
|
||||
return;
|
||||
}
|
||||
String componentName = JgyUtils.getInstance().getInputMethComponentName(pkg);
|
||||
String componentName = getInputMethComponentName(pkg);
|
||||
Log.e(TAG, "setDefaultInputMethod: " + componentName);
|
||||
if (JgyUtils.isAllWinnerDevice()) {
|
||||
AllwinnerCubeMdmManager.getInstance().setDefaultInputMethod(componentName);
|
||||
|
||||
@@ -109,7 +109,7 @@ public class SysSettingUtils {
|
||||
}
|
||||
setStatusBar(context, 1);
|
||||
setAdminApp(context, 1);
|
||||
setSystemAppDisable(context, 0);
|
||||
setSystemAppDisable(context, 1);
|
||||
setNotification(context, 0);
|
||||
setSettingsMenuShow(context);
|
||||
setEyeProtectionModeEntrance(context, 1);
|
||||
@@ -646,7 +646,7 @@ public class SysSettingUtils {
|
||||
public static void setCamera(Context context, int state) {
|
||||
try {
|
||||
//摄像头开关
|
||||
boolean qch_app_camera = Settings.System.putInt(context.getContentResolver(), "qch_app_camera", 0);
|
||||
boolean qch_app_camera = Settings.System.putInt(context.getContentResolver(), "qch_app_camera", state);
|
||||
Log.e(TAG, "qch_app_camera1:" + state);
|
||||
// ApkUtils.hideSystemSettingAPP(context, "com.mediatek.camera");
|
||||
Log.e(TAG, "setting_camera---------" + qch_app_camera);
|
||||
@@ -1082,6 +1082,14 @@ public class SysSettingUtils {
|
||||
} else {
|
||||
Settings.System.putInt(context.getContentResolver(), "qch_app_sms", 0);
|
||||
}
|
||||
|
||||
JsonElement calcCategory = jsonObject.get("calculator_control");
|
||||
if (calcCategory != null && !calcCategory.isJsonNull()) {
|
||||
int calculator_control = calcCategory.getAsInt();
|
||||
Settings.System.putInt(context.getContentResolver(), "aole_app_calculator", changeNum(calculator_control));
|
||||
} else {
|
||||
Settings.System.putInt(context.getContentResolver(), "aole_app_calculator", 0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1096,6 +1104,7 @@ public class SysSettingUtils {
|
||||
Settings.System.putInt(context.getContentResolver(), "qch_app_soundrecorder", status);
|
||||
Settings.System.putInt(context.getContentResolver(), "qch_app_browser", status);
|
||||
Settings.System.putInt(context.getContentResolver(), "qch_app_sms", status);
|
||||
Settings.System.putInt(context.getContentResolver(), "aole_app_calculator", status);
|
||||
}
|
||||
|
||||
public static void setSnSetting(Context context, SnSetting snSetting) {
|
||||
|
||||
Reference in New Issue
Block a user