feat(platform): 新增高通平台适配与浏览器应用禁用控制
This commit is contained in:
@@ -18,8 +18,8 @@ android {
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.aoleyun.sn"
|
||||
versionCode 242
|
||||
versionName "1.6.0918"
|
||||
versionCode 245
|
||||
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.
|
||||
minSdkVersion 24
|
||||
@@ -304,6 +304,15 @@ android {
|
||||
v1SigningEnabled true
|
||||
v2SigningEnabled true
|
||||
}
|
||||
|
||||
SM8150 {
|
||||
storeFile file("keystore/sm8150.jks")
|
||||
storePassword "logan-123456789"
|
||||
keyAlias "platformkey"
|
||||
keyPassword "logan-123456789"
|
||||
v1SigningEnabled true
|
||||
v2SigningEnabled true
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
@@ -354,13 +363,13 @@ android {
|
||||
buildConfigField "String", "platform", '"QualcommA"'
|
||||
versionNameSuffix "_debug"
|
||||
debuggable true
|
||||
signingConfig signingConfigs.zhanRui
|
||||
signingConfig signingConfigs.SM8150
|
||||
}
|
||||
|
||||
QualcommRelease.initWith(release)
|
||||
QualcommRelease {
|
||||
buildConfigField "String", "platform", '"QualcommA"'
|
||||
signingConfig signingConfigs.zhanRui
|
||||
signingConfig signingConfigs.SM8150
|
||||
}
|
||||
|
||||
G128TDebug.initWith(debug)
|
||||
|
||||
BIN
app/keystore/sm8150.jks
Normal file
BIN
app/keystore/sm8150.jks
Normal file
Binary file not shown.
@@ -204,6 +204,10 @@ public class SplashActivity extends AppCompatActivity {
|
||||
// audioManager.setStreamVolume(AudioManager.STREAM_VOICE_CALL, voiceMax, 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")
|
||||
|
||||
@@ -5,7 +5,7 @@ import android.content.Intent;
|
||||
import android.util.Log;
|
||||
|
||||
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.tencent.mmkv.MMKV;
|
||||
|
||||
@@ -13,25 +13,28 @@ public class AoleyunActivityController extends IActivityController.Stub {
|
||||
private static final String TAG = "AoleyunActivityController";
|
||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
|
||||
|
||||
@Override
|
||||
public boolean activityStarting(Intent intent, String pkg) {
|
||||
Log.e(TAG, "activityStarting: " + pkg + ", intent= " + intent);
|
||||
|
||||
// if (JgyUtils.getInstance().isHidedApp(pkg)) {
|
||||
// return false;
|
||||
// }
|
||||
|
||||
if (JgyUtils.getInstance().checkTimePeriod(pkg)) {
|
||||
//false 则不会启动,直接返回。
|
||||
if (JgyUtils.getInstance().isCloudLessonMod(pkg)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
Toaster.show("专注模式只允许使用指定应用");
|
||||
if (ApkUtils.disableSystemapp.contains(pkg)) {
|
||||
Toaster.show("应用已被禁用");
|
||||
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
|
||||
|
||||
@@ -4234,7 +4234,8 @@ public class NetInterfaceManager {
|
||||
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) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -4244,7 +4245,8 @@ public class NetInterfaceManager {
|
||||
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) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -4256,7 +4258,8 @@ public class NetInterfaceManager {
|
||||
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) {
|
||||
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));
|
||||
}
|
||||
}
|
||||
@@ -4266,7 +4269,8 @@ public class NetInterfaceManager {
|
||||
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) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1218,21 +1218,34 @@ public class PushManager {
|
||||
JsonElement keyboardElement = jsonObject.get("default_IME");
|
||||
if (keyboardElement.isJsonNull() || TextUtils.isEmpty(keyboardElement.getAsString())) {
|
||||
Intent intent = new Intent("setDefaultInputMethod");
|
||||
intent.putExtra("package", "com.android.inputmethod.latin");
|
||||
intent.setPackage("com.android.settings");
|
||||
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.QualcommPlatform) {
|
||||
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);
|
||||
} else {
|
||||
String default_IME = jsonObject.get("default_IME").getAsString();
|
||||
Intent intent = new Intent("setDefaultInputMethod");
|
||||
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);
|
||||
}
|
||||
|
||||
String default_browser = jsonObject.get("default_browser").getAsString();
|
||||
Intent intent = new Intent("setDefaultBrowser");
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -307,7 +307,12 @@ public class GuardService extends Service {
|
||||
} else if (setting_statusbar == 1) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -483,12 +488,12 @@ public class GuardService extends Service {
|
||||
|
||||
private void dumpBatterystats() {
|
||||
Observable.create(new ObservableOnSubscribe<StringBuffer>() {
|
||||
@Override
|
||||
public void subscribe(@NonNull ObservableEmitter<StringBuffer> emitter) throws Throwable {
|
||||
StringBuffer shellExec = CmdUtil.shellExec(" dumpsys batterystats");
|
||||
emitter.onNext(shellExec);
|
||||
}
|
||||
}).subscribeOn(Schedulers.io())
|
||||
@Override
|
||||
public void subscribe(@NonNull ObservableEmitter<StringBuffer> emitter) throws Throwable {
|
||||
StringBuffer shellExec = CmdUtil.shellExec(" dumpsys batterystats");
|
||||
emitter.onNext(shellExec);
|
||||
}
|
||||
}).subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<StringBuffer>() {
|
||||
@Override
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.aoleyun.sn.service.main;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.ActivityManagerNative;
|
||||
import android.app.AlarmManager;
|
||||
import android.app.IActivityManager;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
import android.content.BroadcastReceiver;
|
||||
@@ -21,6 +23,7 @@ import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.os.IBinder;
|
||||
import android.os.Looper;
|
||||
import android.os.RemoteException;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.DisplayMetrics;
|
||||
@@ -47,6 +50,7 @@ import com.aoleyun.sn.comm.JGYActions;
|
||||
import com.aoleyun.sn.comm.PackageNames;
|
||||
import com.aoleyun.sn.detection.SensorCheckUtil;
|
||||
import com.aoleyun.sn.gson.GsonUtils;
|
||||
import com.aoleyun.sn.hook.AoleyunActivityController;
|
||||
import com.aoleyun.sn.network.NetInterfaceManager;
|
||||
import com.aoleyun.sn.rlog.LogDBManager;
|
||||
import com.aoleyun.sn.service.DetectionService;
|
||||
@@ -409,6 +413,7 @@ public class MainService extends BaseService implements NetworkUtils.OnNetworkSt
|
||||
|
||||
try {
|
||||
JgyUtils.getInstance().hideApp("com.android.email");
|
||||
JgyUtils.getInstance().hideApp("com.android.browser");
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "onCreate: " + e.getMessage());
|
||||
}
|
||||
@@ -456,13 +461,13 @@ public class MainService extends BaseService implements NetworkUtils.OnNetworkSt
|
||||
|
||||
// aliyunPushInit();
|
||||
|
||||
// IActivityManager activityManager = ActivityManagerNative.getDefault();
|
||||
// try {
|
||||
// activityManager.setActivityController(new AoleyunActivityController(), false);
|
||||
// } catch (RemoteException e) {
|
||||
// Log.e(TAG, "setActivityController: " + e.getMessage());
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
IActivityManager activityManager = ActivityManagerNative.getDefault();
|
||||
try {
|
||||
activityManager.setActivityController(new AoleyunActivityController(), false);
|
||||
} catch (RemoteException e) {
|
||||
Log.e(TAG, "setActivityController: " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
mMMKV.encode(CommonConfig.DEVICES_FRIST_START, 1);
|
||||
Observable.create(killSubscribe)
|
||||
@@ -495,6 +500,8 @@ public class MainService extends BaseService implements NetworkUtils.OnNetworkSt
|
||||
if (shakeReminder == 1) {
|
||||
startService(new Intent(this, ShakeDetectionService.class));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void initLiveData() {
|
||||
|
||||
@@ -351,6 +351,10 @@ public class ApkUtils {
|
||||
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.email");
|
||||
this.add("com.jiaoguanyi.sysc");
|
||||
// this.add("com.android.browser");
|
||||
}};
|
||||
|
||||
/**
|
||||
|
||||
@@ -176,7 +176,7 @@ public class JgyUtils {
|
||||
public static final int U1302Platform = 26;
|
||||
public static final int MT6765Platform = 28;
|
||||
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 G12NLPlatform = 32;
|
||||
|
||||
@@ -365,7 +365,7 @@ public class JgyUtils {
|
||||
return G128TPlatform;
|
||||
} else if (Qualcomm_TAG.equalsIgnoreCase(platform)) {
|
||||
Log.i(TAG, "checkAppPlatform: " + "QualcommA");
|
||||
return QualcommTPlatform;
|
||||
return QualcommPlatform;
|
||||
} else if (G12NL_TAG.equalsIgnoreCase(platform)) {
|
||||
Log.i(TAG, "checkAppPlatform: " + "G12NL");
|
||||
return G12NLPlatform;
|
||||
@@ -439,7 +439,7 @@ public class JgyUtils {
|
||||
} else if (G128T_TAG.equalsIgnoreCase(platform)) {
|
||||
getAppPlatformCallback.AppPlatform(G128TPlatform);
|
||||
} else if (Qualcomm_TAG.equalsIgnoreCase(platform)) {
|
||||
getAppPlatformCallback.AppPlatform(QualcommTPlatform);
|
||||
getAppPlatformCallback.AppPlatform(QualcommPlatform);
|
||||
} else if (G12NL_TAG.equalsIgnoreCase(platform)) {
|
||||
getAppPlatformCallback.AppPlatform(G12NLPlatform);
|
||||
} else if (DX11_TAG.equalsIgnoreCase(platform)) {
|
||||
|
||||
@@ -562,6 +562,9 @@ public class SysSettingUtils {
|
||||
}
|
||||
Intent navIntent = new Intent(navigationStatus);
|
||||
// Intent navIntent = new Intent(navigationStatus).setPackage("com.android.systemui");
|
||||
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.QualcommPlatform) {
|
||||
navIntent.setPackage("com.onyx");
|
||||
}
|
||||
context.sendBroadcast(navIntent);
|
||||
|
||||
|
||||
@@ -608,6 +611,9 @@ public class SysSettingUtils {
|
||||
}
|
||||
// Intent navIntent = new Intent(navigationStatus).setPackage("com.android.systemui");
|
||||
Intent navIntent = new Intent(navigationStatus);
|
||||
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.QualcommPlatform) {
|
||||
navIntent.setPackage("com.onyx");
|
||||
}
|
||||
context.sendBroadcast(navIntent);
|
||||
|
||||
if (JgyUtils.isAllWinnerDevice()) {
|
||||
|
||||
@@ -1845,7 +1845,7 @@ public class Utils {
|
||||
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.U1302Platform
|
||||
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.MT6765Platform
|
||||
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.G128TPlatform
|
||||
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.QualcommTPlatform
|
||||
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.QualcommPlatform
|
||||
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.DX11Platform
|
||||
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.G12NLPlatform
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user