feat(platform): 新增高通平台适配与浏览器应用禁用控制

This commit is contained in:
2026-10-12 10:09:25 +08:00
parent f60ab78568
commit b3c0355eb7
12 changed files with 100 additions and 44 deletions

View File

@@ -18,8 +18,8 @@ android {
defaultConfig { defaultConfig {
applicationId "com.aoleyun.sn" applicationId "com.aoleyun.sn"
versionCode 242 versionCode 245
versionName "1.6.0918" versionName "1.6.1010"
//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
@@ -304,6 +304,15 @@ android {
v1SigningEnabled true v1SigningEnabled true
v2SigningEnabled true v2SigningEnabled true
} }
SM8150 {
storeFile file("keystore/sm8150.jks")
storePassword "logan-123456789"
keyAlias "platformkey"
keyPassword "logan-123456789"
v1SigningEnabled true
v2SigningEnabled true
}
} }
buildTypes { buildTypes {
@@ -354,13 +363,13 @@ android {
buildConfigField "String", "platform", '"QualcommA"' buildConfigField "String", "platform", '"QualcommA"'
versionNameSuffix "_debug" versionNameSuffix "_debug"
debuggable true debuggable true
signingConfig signingConfigs.zhanRui signingConfig signingConfigs.SM8150
} }
QualcommRelease.initWith(release) QualcommRelease.initWith(release)
QualcommRelease { QualcommRelease {
buildConfigField "String", "platform", '"QualcommA"' buildConfigField "String", "platform", '"QualcommA"'
signingConfig signingConfigs.zhanRui signingConfig signingConfigs.SM8150
} }
G128TDebug.initWith(debug) G128TDebug.initWith(debug)

BIN
app/keystore/sm8150.jks Normal file

Binary file not shown.

View File

@@ -204,6 +204,10 @@ public class SplashActivity extends AppCompatActivity {
// audioManager.setStreamVolume(AudioManager.STREAM_VOICE_CALL, voiceMax, 0); // audioManager.setStreamVolume(AudioManager.STREAM_VOICE_CALL, voiceMax, 0);
// audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, musicMax, 0); //音乐音量 // audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, musicMax, 0); //音乐音量
} }
// Intent intent = new Intent(Intent.ACTION_VIEW);
// intent.setData(Uri.parse("https://www.baidu.com"));
// startActivity(intent);
} }
@SuppressLint("NewApi") @SuppressLint("NewApi")

View File

@@ -5,7 +5,7 @@ import android.content.Intent;
import android.util.Log; import android.util.Log;
import com.aoleyun.sn.comm.CommonConfig; import com.aoleyun.sn.comm.CommonConfig;
import com.aoleyun.sn.utils.JgyUtils; import com.aoleyun.sn.utils.ApkUtils;
import com.hjq.toast.Toaster; import com.hjq.toast.Toaster;
import com.tencent.mmkv.MMKV; import com.tencent.mmkv.MMKV;
@@ -13,25 +13,28 @@ public class AoleyunActivityController extends IActivityController.Stub {
private static final String TAG = "AoleyunActivityController"; private static final String TAG = "AoleyunActivityController";
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE); private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
@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)) { if (ApkUtils.disableSystemapp.contains(pkg)) {
// return false; Toaster.show("应用已被禁用");
// }
if (JgyUtils.getInstance().checkTimePeriod(pkg)) {
//false 则不会启动,直接返回。
if (JgyUtils.getInstance().isCloudLessonMod(pkg)) {
return true;
} else {
return false;
}
} else {
Toaster.show("专注模式只允许使用指定应用");
return false; return false;
} }
return true;
// if (JgyUtils.getInstance().checkTimePeriod(pkg)) {
// //false 则不会启动,直接返回。
// if (JgyUtils.getInstance().isCloudLessonMod(pkg)) {
// return true;
// } else {
// return false;
// }
// } else {
// Toaster.show("专注模式只允许使用指定应用");
// return false;
// }
} }
@Override @Override

View File

@@ -4234,7 +4234,8 @@ public class NetInterfaceManager {
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); Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_APP_WEB_WHITE_LIST, null);
} else { } else {
if ("Ebox201w".equals(Build.MODEL) && JgyUtils.getInstance().checkAppPlatform() == JgyUtils.MT8768Platform) { if (("Ebox201w".equals(Build.MODEL) && JgyUtils.getInstance().checkAppPlatform() == JgyUtils.MT8768Platform)
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.QualcommPlatform) {
Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_APP_WEB_WHITE_LIST, null); Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_APP_WEB_WHITE_LIST, null);
} }
} }
@@ -4244,7 +4245,8 @@ public class NetInterfaceManager {
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); Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_APP_WEB_WHITE_LIST, null);
} else { } else {
if ("Ebox201w".equals(Build.MODEL) && JgyUtils.getInstance().checkAppPlatform() == JgyUtils.MT8768Platform) { if (("Ebox201w".equals(Build.MODEL) && JgyUtils.getInstance().checkAppPlatform() == JgyUtils.MT8768Platform)
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.QualcommPlatform) {
Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_APP_WEB_WHITE_LIST, null); Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_APP_WEB_WHITE_LIST, null);
} }
} }
@@ -4256,7 +4258,8 @@ public class NetInterfaceManager {
strings.remove("ttstd.com"); strings.remove("ttstd.com");
Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_APP_WEB_WHITE_LIST, String.join(",", strings)); Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_APP_WEB_WHITE_LIST, String.join(",", strings));
} else { } else {
if ("Ebox201w".equals(Build.MODEL) && JgyUtils.getInstance().checkAppPlatform() == JgyUtils.MT8768Platform) { if (("Ebox201w".equals(Build.MODEL) && JgyUtils.getInstance().checkAppPlatform() == JgyUtils.MT8768Platform)
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.QualcommPlatform) {
Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_APP_WEB_WHITE_LIST, String.join(",", strings)); Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_APP_WEB_WHITE_LIST, String.join(",", strings));
} }
} }
@@ -4266,7 +4269,8 @@ public class NetInterfaceManager {
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); Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_APP_WEB_WHITE_LIST, null);
} else { } else {
if ("Ebox201w".equals(Build.MODEL) && JgyUtils.getInstance().checkAppPlatform() == JgyUtils.MT8768Platform) { if (("Ebox201w".equals(Build.MODEL) && JgyUtils.getInstance().checkAppPlatform() == JgyUtils.MT8768Platform)
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.QualcommPlatform) {
Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_APP_WEB_WHITE_LIST, null); Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_APP_WEB_WHITE_LIST, null);
} }
} }

View File

@@ -1218,21 +1218,34 @@ public class PushManager {
JsonElement keyboardElement = jsonObject.get("default_IME"); JsonElement keyboardElement = jsonObject.get("default_IME");
if (keyboardElement.isJsonNull() || TextUtils.isEmpty(keyboardElement.getAsString())) { if (keyboardElement.isJsonNull() || TextUtils.isEmpty(keyboardElement.getAsString())) {
Intent intent = new Intent("setDefaultInputMethod"); Intent intent = new Intent("setDefaultInputMethod");
intent.putExtra("package", "com.android.inputmethod.latin"); if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.QualcommPlatform) {
intent.setPackage("com.android.settings"); intent.putExtra("package", "com.onyx.kime");
intent.setPackage("com.onyx.neoservice");
} else {
intent.putExtra("package", "com.android.inputmethod.latin");
intent.setPackage("com.android.settings");
}
mContext.sendBroadcast(intent); mContext.sendBroadcast(intent);
} else { } else {
String default_IME = jsonObject.get("default_IME").getAsString(); String default_IME = jsonObject.get("default_IME").getAsString();
Intent intent = new Intent("setDefaultInputMethod"); Intent intent = new Intent("setDefaultInputMethod");
intent.putExtra("package", default_IME); intent.putExtra("package", default_IME);
intent.setPackage("com.android.settings"); if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.QualcommPlatform) {
intent.setPackage("com.onyx.neoservice");
} else {
intent.setPackage("com.android.settings");
}
mContext.sendBroadcast(intent); mContext.sendBroadcast(intent);
} }
String default_browser = jsonObject.get("default_browser").getAsString(); String default_browser = jsonObject.get("default_browser").getAsString();
Intent intent = new Intent("setDefaultBrowser"); Intent intent = new Intent("setDefaultBrowser");
intent.putExtra("package", default_browser); intent.putExtra("package", default_browser);
intent.setPackage("com.android.settings"); if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.QualcommPlatform) {
intent.setPackage("com.onyx.neoservice");
} else {
intent.setPackage("com.android.settings");
}
mContext.sendBroadcast(intent); mContext.sendBroadcast(intent);
} }
} }

View File

@@ -307,7 +307,12 @@ public class GuardService extends Service {
} else if (setting_statusbar == 1) { } else if (setting_statusbar == 1) {
statusbarStatus = CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR; statusbarStatus = CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR;
} }
Intent navIntent = new Intent(statusbarStatus).setPackage("com.android.systemui"); Intent navIntent = new Intent(statusbarStatus);
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.QualcommPlatform) {
} else {
navIntent.setPackage("com.android.systemui");
}
context.sendBroadcast(navIntent); context.sendBroadcast(navIntent);
} }
} }
@@ -483,12 +488,12 @@ public class GuardService extends Service {
private void dumpBatterystats() { private void dumpBatterystats() {
Observable.create(new ObservableOnSubscribe<StringBuffer>() { Observable.create(new ObservableOnSubscribe<StringBuffer>() {
@Override @Override
public void subscribe(@NonNull ObservableEmitter<StringBuffer> emitter) throws Throwable { public void subscribe(@NonNull ObservableEmitter<StringBuffer> emitter) throws Throwable {
StringBuffer shellExec = CmdUtil.shellExec(" dumpsys batterystats"); StringBuffer shellExec = CmdUtil.shellExec(" dumpsys batterystats");
emitter.onNext(shellExec); emitter.onNext(shellExec);
} }
}).subscribeOn(Schedulers.io()) }).subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<StringBuffer>() { .subscribe(new Observer<StringBuffer>() {
@Override @Override

View File

@@ -1,7 +1,9 @@
package com.aoleyun.sn.service.main; package com.aoleyun.sn.service.main;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.ActivityManagerNative;
import android.app.AlarmManager; import android.app.AlarmManager;
import android.app.IActivityManager;
import android.app.NotificationChannel; import android.app.NotificationChannel;
import android.app.NotificationManager; import android.app.NotificationManager;
import android.content.BroadcastReceiver; import android.content.BroadcastReceiver;
@@ -21,6 +23,7 @@ import android.os.Build;
import android.os.Handler; import android.os.Handler;
import android.os.IBinder; import android.os.IBinder;
import android.os.Looper; import android.os.Looper;
import android.os.RemoteException;
import android.provider.Settings; import android.provider.Settings;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.DisplayMetrics; import android.util.DisplayMetrics;
@@ -47,6 +50,7 @@ import com.aoleyun.sn.comm.JGYActions;
import com.aoleyun.sn.comm.PackageNames; import com.aoleyun.sn.comm.PackageNames;
import com.aoleyun.sn.detection.SensorCheckUtil; import com.aoleyun.sn.detection.SensorCheckUtil;
import com.aoleyun.sn.gson.GsonUtils; import com.aoleyun.sn.gson.GsonUtils;
import com.aoleyun.sn.hook.AoleyunActivityController;
import com.aoleyun.sn.network.NetInterfaceManager; import com.aoleyun.sn.network.NetInterfaceManager;
import com.aoleyun.sn.rlog.LogDBManager; import com.aoleyun.sn.rlog.LogDBManager;
import com.aoleyun.sn.service.DetectionService; import com.aoleyun.sn.service.DetectionService;
@@ -409,6 +413,7 @@ public class MainService extends BaseService implements NetworkUtils.OnNetworkSt
try { try {
JgyUtils.getInstance().hideApp("com.android.email"); JgyUtils.getInstance().hideApp("com.android.email");
JgyUtils.getInstance().hideApp("com.android.browser");
} catch (Exception e) { } catch (Exception e) {
Log.e(TAG, "onCreate: " + e.getMessage()); Log.e(TAG, "onCreate: " + e.getMessage());
} }
@@ -456,13 +461,13 @@ public class MainService extends BaseService implements NetworkUtils.OnNetworkSt
// aliyunPushInit(); // aliyunPushInit();
// IActivityManager activityManager = ActivityManagerNative.getDefault(); IActivityManager activityManager = ActivityManagerNative.getDefault();
// try { try {
// activityManager.setActivityController(new AoleyunActivityController(), false); activityManager.setActivityController(new AoleyunActivityController(), false);
// } catch (RemoteException e) { } catch (RemoteException e) {
// Log.e(TAG, "setActivityController: " + e.getMessage()); Log.e(TAG, "setActivityController: " + e.getMessage());
// e.printStackTrace(); e.printStackTrace();
// } }
mMMKV.encode(CommonConfig.DEVICES_FRIST_START, 1); mMMKV.encode(CommonConfig.DEVICES_FRIST_START, 1);
Observable.create(killSubscribe) Observable.create(killSubscribe)
@@ -495,6 +500,8 @@ public class MainService extends BaseService implements NetworkUtils.OnNetworkSt
if (shakeReminder == 1) { if (shakeReminder == 1) {
startService(new Intent(this, ShakeDetectionService.class)); startService(new Intent(this, ShakeDetectionService.class));
} }
} }
private void initLiveData() { private void initLiveData() {

View File

@@ -351,6 +351,10 @@ public class ApkUtils {
this.add("com.baidu.BaiduMap"); this.add("com.baidu.BaiduMap");
}}; }};
public static final Set<String> disableSystemapp = new HashSet<String>() {{
this.add("com.android.browser");
}};
/** /**
* 预置的可以卸载的系统应用,判断出来为第三方 * 预置的可以卸载的系统应用,判断出来为第三方
*/ */
@@ -361,6 +365,7 @@ public class ApkUtils {
this.add("com.android.musicfx"); this.add("com.android.musicfx");
this.add("com.android.email"); this.add("com.android.email");
this.add("com.jiaoguanyi.sysc"); this.add("com.jiaoguanyi.sysc");
// this.add("com.android.browser");
}}; }};
/** /**

View File

@@ -176,7 +176,7 @@ public class JgyUtils {
public static final int U1302Platform = 26; public static final int U1302Platform = 26;
public static final int MT6765Platform = 28; public static final int MT6765Platform = 28;
public static final int G128TPlatform = 29; public static final int G128TPlatform = 29;
public static final int QualcommTPlatform = 30; public static final int QualcommPlatform = 30;
public static final int DX11Platform = 31; public static final int DX11Platform = 31;
public static final int G12NLPlatform = 32; public static final int G12NLPlatform = 32;
@@ -365,7 +365,7 @@ public class JgyUtils {
return G128TPlatform; return G128TPlatform;
} else if (Qualcomm_TAG.equalsIgnoreCase(platform)) { } else if (Qualcomm_TAG.equalsIgnoreCase(platform)) {
Log.i(TAG, "checkAppPlatform: " + "QualcommA"); Log.i(TAG, "checkAppPlatform: " + "QualcommA");
return QualcommTPlatform; return QualcommPlatform;
} else if (G12NL_TAG.equalsIgnoreCase(platform)) { } else if (G12NL_TAG.equalsIgnoreCase(platform)) {
Log.i(TAG, "checkAppPlatform: " + "G12NL"); Log.i(TAG, "checkAppPlatform: " + "G12NL");
return G12NLPlatform; return G12NLPlatform;
@@ -439,7 +439,7 @@ public class JgyUtils {
} else if (G128T_TAG.equalsIgnoreCase(platform)) { } else if (G128T_TAG.equalsIgnoreCase(platform)) {
getAppPlatformCallback.AppPlatform(G128TPlatform); getAppPlatformCallback.AppPlatform(G128TPlatform);
} else if (Qualcomm_TAG.equalsIgnoreCase(platform)) { } else if (Qualcomm_TAG.equalsIgnoreCase(platform)) {
getAppPlatformCallback.AppPlatform(QualcommTPlatform); getAppPlatformCallback.AppPlatform(QualcommPlatform);
} else if (G12NL_TAG.equalsIgnoreCase(platform)) { } else if (G12NL_TAG.equalsIgnoreCase(platform)) {
getAppPlatformCallback.AppPlatform(G12NLPlatform); getAppPlatformCallback.AppPlatform(G12NLPlatform);
} else if (DX11_TAG.equalsIgnoreCase(platform)) { } else if (DX11_TAG.equalsIgnoreCase(platform)) {

View File

@@ -562,6 +562,9 @@ public class SysSettingUtils {
} }
Intent navIntent = new Intent(navigationStatus); Intent navIntent = new Intent(navigationStatus);
// Intent navIntent = new Intent(navigationStatus).setPackage("com.android.systemui"); // Intent navIntent = new Intent(navigationStatus).setPackage("com.android.systemui");
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.QualcommPlatform) {
navIntent.setPackage("com.onyx");
}
context.sendBroadcast(navIntent); context.sendBroadcast(navIntent);
@@ -608,6 +611,9 @@ public class SysSettingUtils {
} }
// Intent navIntent = new Intent(navigationStatus).setPackage("com.android.systemui"); // Intent navIntent = new Intent(navigationStatus).setPackage("com.android.systemui");
Intent navIntent = new Intent(navigationStatus); Intent navIntent = new Intent(navigationStatus);
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.QualcommPlatform) {
navIntent.setPackage("com.onyx");
}
context.sendBroadcast(navIntent); context.sendBroadcast(navIntent);
if (JgyUtils.isAllWinnerDevice()) { if (JgyUtils.isAllWinnerDevice()) {

View File

@@ -1845,7 +1845,7 @@ public class Utils {
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.U1302Platform || JgyUtils.getInstance().checkAppPlatform() == JgyUtils.U1302Platform
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.MT6765Platform || JgyUtils.getInstance().checkAppPlatform() == JgyUtils.MT6765Platform
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.G128TPlatform || JgyUtils.getInstance().checkAppPlatform() == JgyUtils.G128TPlatform
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.QualcommTPlatform || JgyUtils.getInstance().checkAppPlatform() == JgyUtils.QualcommPlatform
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.DX11Platform || JgyUtils.getInstance().checkAppPlatform() == JgyUtils.DX11Platform
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.G12NLPlatform || JgyUtils.getInstance().checkAppPlatform() == JgyUtils.G12NLPlatform
) { ) {