version:G10P 1.0.2

fix:
update:华瑞安G10P适配
This commit is contained in:
2023-03-30 10:08:02 +08:00
parent 93f87d3b68
commit e5cdbc2ecc
24 changed files with 912 additions and 541 deletions

View File

@@ -56,10 +56,9 @@ android {
lintOptions { lintOptions {
checkReleaseBuilds false checkReleaseBuilds false
} // Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
dexOptions { abortOnError false
jumboMode true
} }
compileOptions { compileOptions {
@@ -90,10 +89,17 @@ android {
//MTK //MTK
MTKnewly { MTKnewly {
flavorDimensions "default" flavorDimensions "default"
versionCode 48 versionCode 52
versionName "2.3.8" versionName "2.4.2"
buildConfigField "String", "platform", '"MTK"' buildConfigField "String", "platform", '"MTK"'
} }
Huaruian {
flavorDimensions "default"
versionCode 3
versionName "1.0.2"
buildConfigField "String", "platform", '"MTK11"'
}
} }
sourceSets { sourceSets {
@@ -132,6 +138,24 @@ android {
v2SigningEnabled true v2SigningEnabled true
} }
G10P{
storeFile file("keystore/G10PMTK11.jks")
storePassword "123456"
keyAlias "G10PMTK11"
keyPassword "123456"
v1SigningEnabled true
v2SigningEnabled true
}
G10PUserDebug{
storeFile file("keystore/G10PUserDebug.jks")
storePassword "123456"
keyAlias "G10PUserDebug"
keyPassword "123456"
v1SigningEnabled true
v2SigningEnabled true
}
mtk12 { mtk12 {
storeFile file("keystore/mtkAndroid12.keystore") storeFile file("keystore/mtkAndroid12.keystore")
storePassword "123456" storePassword "123456"
@@ -184,6 +208,25 @@ android {
signingConfig signingConfigs.mtk12 signingConfig signingConfigs.mtk12
} }
G10PDebug.initWith(debug)
G10PDebug {
versionNameSuffix "-debug"
debuggable true
signingConfig signingConfigs.G10P
}
G10PRelease.initWith(release)
G10PRelease {
signingConfig signingConfigs.G10P
}
G10PUserDebug.initWith(debug)
G10PUserDebug {
versionNameSuffix "-debug"
debuggable true
signingConfig signingConfigs.G10PUserDebug
}
zhanRuiDebug.initWith(debug) zhanRuiDebug.initWith(debug)
zhanRuiDebug { zhanRuiDebug {
debuggable true debuggable true

BIN
app/keystore/G10PMTK11.jks Normal file

Binary file not shown.

Binary file not shown.

View File

@@ -171,9 +171,9 @@
</activity> </activity>
<activity <activity
android:name=".activity.main.MainActivity" android:name=".activity.main.MainActivity"
android:screenOrientation="userPortrait"
android:excludeFromRecents="true" android:excludeFromRecents="true"
android:launchMode="singleTop" /> android:launchMode="singleTop"
android:screenOrientation="userPortrait" />
<activity android:name=".activity.TopActivity" /> <activity android:name=".activity.TopActivity" />
<activity android:name=".activity.MainActivity1" /> <activity android:name=".activity.MainActivity1" />
<activity <activity
@@ -414,8 +414,7 @@
android:value="AppGlideModule" /> android:value="AppGlideModule" />
<meta-data <meta-data
android:name="com.baidu.lbsapi.API_KEY" android:name="com.baidu.lbsapi.API_KEY"
android:value="bQxx6zC6AvZ6O41UUPYq6X1LsQuC36dh" > android:value="bQxx6zC6AvZ6O41UUPYq6X1LsQuC36dh" />
</meta-data>
</application> </application>
</manifest> </manifest>

View File

@@ -107,7 +107,7 @@ public class SplashActivity extends AppCompatActivity {
if (BuildConfig.DEBUG) { if (BuildConfig.DEBUG) {
JGYUtils.getModel(); JGYUtils.getModel();
Log.e(TAG, "getOperators: " + NetworkUtils.getOperators(this)); Log.e(TAG, "getOperators: " + NetworkUtils.getOperators(this));
Log.e(TAG, "PublicIP: " + MMKV.defaultMMKV().decodeString(NetInterfaceManager.PublicIP, "")); Log.e(TAG, "PublicIP: " + MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE).decodeString(NetInterfaceManager.PublicIP, ""));
NetInterfaceManager.GetWhois(); NetInterfaceManager.GetWhois();
Log.e(TAG, "initView: " + NetworkUtils.getPhoneNumber(this)); Log.e(TAG, "initView: " + NetworkUtils.getPhoneNumber(this));
FlowInfo flowInfo1 = GetFlowUtil.getAppFlowInfo(BuildConfig.APPLICATION_ID, this); FlowInfo flowInfo1 = GetFlowUtil.getAppFlowInfo(BuildConfig.APPLICATION_ID, this);

View File

@@ -45,7 +45,7 @@ public class CheckNetActivity extends BaseActivity implements CheckNetContact.Ma
Button bt_confirm; Button bt_confirm;
private CheckNetPresenter mCheckNetPresenter; private CheckNetPresenter mCheckNetPresenter;
private MMKV mMMKV = MMKV.defaultMMKV(); private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
@Override @Override
public void onDisconnected() { public void onDisconnected() {

View File

@@ -251,6 +251,7 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView,
private void getDevicesInfo() { private void getDevicesInfo() {
tv_model.setText(Build.MODEL); tv_model.setText(Build.MODEL);
String sn = Utils.getSerial(this); String sn = Utils.getSerial(this);
Log.e(TAG, "getDevicesInfo: " + sn);
tv_serial.setText(sn); tv_serial.setText(sn);
getIMEI(); getIMEI();
setMac(); setMac();

View File

@@ -11,6 +11,7 @@ import androidx.multidex.MultiDexApplication;
import com.aoleyun.sn.BuildConfig; import com.aoleyun.sn.BuildConfig;
import com.aoleyun.sn.bean.BaseResponse; import com.aoleyun.sn.bean.BaseResponse;
import com.aoleyun.sn.comm.CommonConfig;
import com.aoleyun.sn.manager.MapManager; import com.aoleyun.sn.manager.MapManager;
import com.aoleyun.sn.manager.ConnectManager; import com.aoleyun.sn.manager.ConnectManager;
import com.aoleyun.sn.manager.FileManager; import com.aoleyun.sn.manager.FileManager;
@@ -123,7 +124,7 @@ public class BaseApplication extends MultiDexApplication {
public void onSuccess(Object data, int flag) { public void onSuccess(Object data, int flag) {
//token在设备卸载重装的时候有可能会变 //token在设备卸载重装的时候有可能会变
Log.e("TPush", "注册成功设备token为" + data); Log.e("TPush", "注册成功设备token为" + data);
MMKV.defaultMMKV().encode("XGPushtoken", data.toString()); MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE).encode("XGPushtoken", data.toString());
List<XGPushManager.AccountInfo> accountInfoList = new ArrayList<>(); List<XGPushManager.AccountInfo> accountInfoList = new ArrayList<>();
accountInfoList.add(new XGPushManager.AccountInfo(XGPushManager.AccountType.CUSTOM.getValue(), Utils.getSerial(getApplicationContext()))); accountInfoList.add(new XGPushManager.AccountInfo(XGPushManager.AccountType.CUSTOM.getValue(), Utils.getSerial(getApplicationContext())));
if (Utils.NOSN.equalsIgnoreCase(Utils.getSerial())) { if (Utils.NOSN.equalsIgnoreCase(Utils.getSerial())) {

View File

@@ -2,7 +2,9 @@ package com.aoleyun.sn.comm;
public class CommonConfig { public class CommonConfig {
public static String AES_KEY = "0123456789ABCDEF"; public static final String MMKV_ID = "InterProcessKV";
public static final String AES_KEY = "0123456789ABCDEF";
/*爱华解锁标识*/ /*爱华解锁标识*/
public final static String AIHUA_UNLOCK = "Aihua_unlock_state"; public final static String AIHUA_UNLOCK = "Aihua_unlock_state";

View File

@@ -6,6 +6,7 @@ import android.graphics.drawable.Drawable;
import android.os.Environment; import android.os.Environment;
import android.util.Log; import android.util.Log;
import com.aoleyun.sn.comm.CommonConfig;
import com.jakewharton.disklrucache.DiskLruCache; import com.jakewharton.disklrucache.DiskLruCache;
import com.tencent.mmkv.BuildConfig; import com.tencent.mmkv.BuildConfig;
import com.tencent.mmkv.MMKV; import com.tencent.mmkv.MMKV;
@@ -31,7 +32,7 @@ import java.io.Serializable;
public class CacheHelper { public class CacheHelper {
private static final String TAG = CacheHelper.class.getSimpleName(); private static final String TAG = CacheHelper.class.getSimpleName();
private MMKV mMMKV = MMKV.defaultMMKV(); private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
private static final String DIR_NAME = "diskCache"; private static final String DIR_NAME = "diskCache";
private static final int MAX_COUNT = 1024 * 1024 * 1024; private static final int MAX_COUNT = 1024 * 1024 * 1024;

View File

@@ -4,6 +4,7 @@ import android.annotation.SuppressLint;
import android.content.Context; import android.content.Context;
import android.util.Log; import android.util.Log;
import com.aoleyun.sn.comm.CommonConfig;
import com.aoleyun.sn.utils.TimeUtils; import com.aoleyun.sn.utils.TimeUtils;
import com.tencent.mmkv.MMKV; import com.tencent.mmkv.MMKV;
@@ -33,7 +34,7 @@ public class ConnectManager {
@SuppressLint("StaticFieldLeak") @SuppressLint("StaticFieldLeak")
private static ConnectManager sInstance; private static ConnectManager sInstance;
private Context mContext; private Context mContext;
private MMKV mMMKV = MMKV.defaultMMKV(); private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
private ConnectManager(Context context) { private ConnectManager(Context context) {
if (context == null) { if (context == null) {

View File

@@ -173,7 +173,7 @@ public class NetInterfaceManager {
private Context mContext; private Context mContext;
private Retrofit mRetrofit; private Retrofit mRetrofit;
private OkHttpClient okHttpClient; private OkHttpClient okHttpClient;
private MMKV mMMKV = MMKV.defaultMMKV(); private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
private CacheHelper cacheHelper; private CacheHelper cacheHelper;
private static final int OK = 200; private static final int OK = 200;
@@ -365,7 +365,7 @@ public class NetInterfaceManager {
return mRetrofit.create(MACAddressApi.class) return mRetrofit.create(MACAddressApi.class)
.sendMACaddress(Utils.getSerial(mContext), .sendMACaddress(Utils.getSerial(mContext),
Utils.getAndroid10MAC(mContext), Utils.getAndroid10MAC(mContext),
MMKV.defaultMMKV().decodeString("XGPushtoken", "未知"), MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE).decodeString("XGPushtoken", "未知"),
Utils.getCustomVersion(), Utils.getCustomVersion(),
BuildConfig.VERSION_NAME, BuildConfig.VERSION_NAME,
Utils.getAPPVersionName(PackageNames.APPSTORE, mContext), Utils.getAPPVersionName(PackageNames.APPSTORE, mContext),
@@ -1795,23 +1795,23 @@ public class NetInterfaceManager {
} }
private void setDefaultDesktop(String defaultApp) { private void setDefaultDesktop(String defaultApp) {
int aihuaUnlock = Settings.System.getInt(mContext.getContentResolver(), CommonConfig.AIHUA_UNLOCK, 0); // int aihuaUnlock = Settings.System.getInt(mContext.getContentResolver(), CommonConfig.AIHUA_UNLOCK, 0);
if (aihuaUnlock == 1) { // if (aihuaUnlock == 1) {
JGYUtils.getInstance().setDefaultDesktop(PackageNames.DESKTOP); // JGYUtils.getInstance().setDefaultDesktop(PackageNames.DESKTOP);
} else { // } else {
if (!TextUtils.isEmpty(defaultApp)) { // if (!TextUtils.isEmpty(defaultApp)) {
JGYUtils.getInstance().setDefaultDesktop(defaultApp); // JGYUtils.getInstance().setDefaultDesktop(defaultApp);
SPUtils.put(mContext, "default_launcher", defaultApp); // SPUtils.put(mContext, "default_launcher", defaultApp);
} else { // } else {
String default_launcher = (String) SPUtils.get(mContext, "default_launcher", ""); // String default_launcher = (String) SPUtils.get(mContext, "default_launcher", "");
Log.e("getDefaultApp", "onNext: " + default_launcher); // Log.e("getDefaultApp", "onNext: " + default_launcher);
if (TextUtils.isEmpty(default_launcher)) { // if (TextUtils.isEmpty(default_launcher)) {
JGYUtils.getInstance().setDefaultDesktop(); // JGYUtils.getInstance().setDefaultDesktop();
} else { // } else {
JGYUtils.getInstance().setDefaultDesktop(default_launcher); // JGYUtils.getInstance().setDefaultDesktop(default_launcher);
} // }
} // }
} // }
} }
public interface StudesInfoListener { public interface StudesInfoListener {
@@ -3323,7 +3323,7 @@ public class NetInterfaceManager {
public void onNext(@NonNull WhoisBean whoisBean) { public void onNext(@NonNull WhoisBean whoisBean) {
Log.e("GetWhois", "onNext: " + whoisBean); Log.e("GetWhois", "onNext: " + whoisBean);
if (whoisBean != null && !TextUtils.isEmpty(whoisBean.getAddr())) { if (whoisBean != null && !TextUtils.isEmpty(whoisBean.getAddr())) {
MMKV.defaultMMKV().encode(WHOIS_ADDR, whoisBean.getAddr()); MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE).encode(WHOIS_ADDR, whoisBean.getAddr());
} }
} }
@@ -3520,7 +3520,7 @@ public class NetInterfaceManager {
Log.e("getPublicIp", "onNext: " + whoisBean); Log.e("getPublicIp", "onNext: " + whoisBean);
if (whoisBean != null && !TextUtils.isEmpty(whoisBean.getIp())) { if (whoisBean != null && !TextUtils.isEmpty(whoisBean.getIp())) {
callbak.getPublicIp(whoisBean.getIp()); callbak.getPublicIp(whoisBean.getIp());
MMKV.defaultMMKV().encode(NetInterfaceManager.WHOIS_IP, whoisBean.getIp()); MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE).encode(NetInterfaceManager.WHOIS_IP, whoisBean.getIp());
} else { } else {
callbak.getPublicIp("unknown"); callbak.getPublicIp("unknown");
} }

View File

@@ -111,7 +111,7 @@ public class UrlAddress {
/*开机动画*/ /*开机动画*/
public static final String GET_LOGO_IMG = "Sn/getLogoImg"; public static final String GET_LOGO_IMG = "Sn/getLogoImg";
/*获取默认桌面升级*/ // /*获取默认桌面升级*/
public static final String GET_DESKTOP = "Sn/getSnDesktop"; public static final String GET_DESKTOP = "Sn/getSnDesktop";
/*获取系统默认程序*/ /*获取系统默认程序*/
public static final String GET_DEFAULT_APP = "app/getDefaultApp"; public static final String GET_DEFAULT_APP = "app/getDefaultApp";

View File

@@ -76,7 +76,7 @@ public class BootReceiver extends BroadcastReceiver {
default: default:
break; break;
case Intent.ACTION_BOOT_COMPLETED: case Intent.ACTION_BOOT_COMPLETED:
MMKV.defaultMMKV().encode(ConnectManager.REBOOT_LAST_ONNECT_TIME, System.currentTimeMillis()); MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE).encode(ConnectManager.REBOOT_LAST_ONNECT_TIME, System.currentTimeMillis());
if ((int) SPUtils.get(context, CommonConfig.FIRST_STARTUP, 0) == 0) { if ((int) SPUtils.get(context, CommonConfig.FIRST_STARTUP, 0) == 0) {
LogDBManager.getInstance().creatRebootLog("首次启动", TimeUtils.transferLongToDate(System.currentTimeMillis())); LogDBManager.getInstance().creatRebootLog("首次启动", TimeUtils.transferLongToDate(System.currentTimeMillis()));
SPUtils.put(context, CommonConfig.FIRST_STARTUP, 1); SPUtils.put(context, CommonConfig.FIRST_STARTUP, 1);

View File

@@ -40,7 +40,7 @@ public class MainSPresenter implements MainSContact.Presenter {
private MainSContact.MainView mView; private MainSContact.MainView mView;
private Context mContext; private Context mContext;
private ContentResolver crv; private ContentResolver crv;
private MMKV mMMKV = MMKV.defaultMMKV(); private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
private CacheHelper cacheHelper; private CacheHelper cacheHelper;
private BehaviorSubject<ActivityEvent> lifecycle; private BehaviorSubject<ActivityEvent> lifecycle;

View File

@@ -5,6 +5,8 @@ import android.app.AlarmManager;
import android.app.NotificationChannel; import android.app.NotificationChannel;
import android.app.NotificationManager; import android.app.NotificationManager;
import android.app.Service; import android.app.Service;
import android.app.role.OnRoleHoldersChangedListener;
import android.app.role.RoleManager;
import android.content.BroadcastReceiver; import android.content.BroadcastReceiver;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
@@ -21,6 +23,7 @@ import android.os.Binder;
import android.os.Build; import android.os.Build;
import android.os.Handler; import android.os.Handler;
import android.os.IBinder; import android.os.IBinder;
import android.os.UserHandle;
import android.provider.Settings; import android.provider.Settings;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.DisplayMetrics; import android.util.DisplayMetrics;
@@ -76,6 +79,7 @@ import java.util.Date;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.concurrent.Executor;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import io.reactivex.rxjava3.core.Observable; import io.reactivex.rxjava3.core.Observable;
@@ -89,7 +93,9 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
private static final String TAG = MainService.class.getSimpleName(); private static final String TAG = MainService.class.getSimpleName();
public MainSPresenter mPresenter; public MainSPresenter mPresenter;
private MMKV mMMKV = MMKV.defaultMMKV(); private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
private static final String JXW_LAUNCHER = "com.wyt.wangkexueximvvm";
@Override @Override
public void onDisconnected() { public void onDisconnected() {
@@ -172,6 +178,8 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
tagSets.add(JGYUtils.ZhanruiTag); tagSets.add(JGYUtils.ZhanruiTag);
} else if (platform == JGYUtils.CubePlatform) { } else if (platform == JGYUtils.CubePlatform) {
tagSets.add(JGYUtils.CubeTag); tagSets.add(JGYUtils.CubeTag);
} else if (platform == JGYUtils.MTK11Platform) {
tagSets.add(JGYUtils.MTK11Tag);
} }
} }
}); });
@@ -358,12 +366,29 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
TimeTask task = new TimeTask(); TimeTask task = new TimeTask();
task.execute("ntp.aliyun.com"); task.execute("ntp.aliyun.com");
mPresenter.getLockedState(); mPresenter.getLockedState();
// RoleManager mRm = getSystemService(RoleManager.class);
// mRm.addOnRoleHoldersChangedListenerAsUser(new Executor() {
// @Override
// public void execute(Runnable command) {
// Log.e("RoleManager", "execute: " + command);
// }
// }, new OnRoleHoldersChangedListener() {
// @Override
// public void onRoleHoldersChanged(String s, UserHandle userHandle) {
// Log.e("RoleManager", "onRoleHoldersChanged: roleName = " + s + "userHandle = " + userHandle);
// }
// }, UserHandle.ALL);
//根据要求卸载这两个应用 //根据要求卸载这两个应用
if (!JGYUtils.getInstance().getDeviceIsLocked()) { if (!JGYUtils.getInstance().getDeviceIsLocked()) {
ApkUtils.UninstallAPP(this, "com.joytv.live"); ApkUtils.UninstallAPP(this, "com.joytv.live");
ApkUtils.UninstallAPP(this, "com.tencent.android.qqdownloader"); ApkUtils.UninstallAPP(this, "com.tencent.android.qqdownloader");
} }
// Log.e(TAG, "onCreate: " + Build.MODEL);
// if ("K106".equals(Build.MODEL)) {
// if (ApkUtils.isAvailable(MainService.this, JXW_LAUNCHER)) {
// JGYUtils.getInstance().setJxwLauncher(JXW_LAUNCHER);
// }
// }
try { try {
getPackageManager().setApplicationEnabledSetting("com.android.email", PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0); getPackageManager().setApplicationEnabledSetting("com.android.email", PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);

View File

@@ -97,97 +97,97 @@ public class MessageReceiver extends XGPushBaseReceiver {
public static final String LogTag = "xg.test"; public static final String LogTag = "xg.test";
/*删除应用*/ /*删除应用*/
private final String MSG_DELETE = "1"; private static final String MSG_DELETE = "1";
/*系统设置管控*/ /*系统设置管控*/
private final String MSG_SETTING = "2"; private static final String MSG_SETTING = "2";
/*浏览器网址管控*/ /*浏览器网址管控*/
private final String MSG_BROWSER = "4"; private static final String MSG_BROWSER = "4";
/*app id管控*/ /*app id管控*/
private final String MSG_APPID = "5"; private static final String MSG_APPID = "5";
/*应用联网管控*/ /*应用联网管控*/
private final String MSG_NET_CONTROL = "6"; private static final String MSG_NET_CONTROL = "6";
/*APP自启联网滑动管控*/ /*APP自启联网滑动管控*/
private final String MSG_POWER_ON = "7"; private static final String MSG_POWER_ON = "7";
/*重置*/ /*重置*/
private final String MSG_RESET = "8"; private static final String MSG_RESET = "8";
/*强制安装*/ /*强制安装*/
private final String MSG_INSTALL = "9"; private static final String MSG_INSTALL = "9";
/*解锁*/ /*解锁*/
private final String MSG_LOCK = "10"; private static final String MSG_LOCK = "10";
/*旧版相机管控*/ /*旧版相机管控*/
private final String MSG_CAMERA = "11"; private static final String MSG_CAMERA = "11";
private final String MSG_ONEPACKAGES = "12"; private static final String MSG_ONEPACKAGES = "12";
/*app使用时间*/ /*app使用时间*/
private final String GET_APP_USEDTIME = "13"; private static final String GET_APP_USEDTIME = "13";
/*强制下载*/ /*强制下载*/
private final String GET_FORCEDOWNLOADURL = "14"; private static final String GET_FORCEDOWNLOADURL = "14";
/*主页和书签管控*/ /*主页和书签管控*/
private final String SET_HOMEPAG_TAG = "15"; private static final String SET_HOMEPAG_TAG = "15";
/*app内网页管控*/ /*app内网页管控*/
private final String APP_WEBSITE = "16"; private static final String APP_WEBSITE = "16";
/*禁止app升级*/ /*禁止app升级*/
private final String DISABLE_APPUPDATE = "17"; private static final String DISABLE_APPUPDATE = "17";
/*隐藏桌面图标*/ /*隐藏桌面图标*/
private final String HIDE_DESKTOP_ICON = "18"; private static final String HIDE_DESKTOP_ICON = "18";
/*禁止滑动*/ /*禁止滑动*/
private final String DISABLE_APP_SLIDE = "19"; private static final String DISABLE_APP_SLIDE = "19";
/*更新应用白名单*/ /*更新应用白名单*/
private final String UPDATE_INFO = "20"; private static final String UPDATE_INFO = "20";
/*截图*/ /*截图*/
private final String SN_SCREENSHOT = "21"; private static final String SN_SCREENSHOT = "21";
/*重启*/ /*重启*/
private final String DEVICES_REBOOT = "22"; private static final String DEVICES_REBOOT = "22";
/*获取设备详细信息*/ /*获取设备详细信息*/
private final String GET_DEVICES_INFO = "23"; private static final String GET_DEVICES_INFO = "23";
/*霸屏*/ /*霸屏*/
private final String LOCK_SCREEN = "24"; private static final String LOCK_SCREEN = "24";
/*取消霸屏*/ /*取消霸屏*/
private final String UNLOCK_SCREEN = "25"; private static final String UNLOCK_SCREEN = "25";
/*结束进程*/ /*结束进程*/
private final String KILL_SERVER = "26"; private static final String KILL_SERVER = "26";
/*时间管控*/ /*时间管控*/
private final String TIME_CONTROL = "27"; private static final String TIME_CONTROL = "27";
/*app霸屏*/ /*app霸屏*/
private final String TOP_APP = "28"; private static final String TOP_APP = "28";
/*开机动画*/ /*开机动画*/
private final String LOGO_IMG = "29"; private static final String LOGO_IMG = "29";
/*默认应用*/ /*默认应用*/
private final String DEFAULTP_APP = "30"; private static final String DEFAULTP_APP = "30";
/*发出声音*/ /*发出声音*/
private final String PLAY_SOUND = "31"; private static final String PLAY_SOUND = "31";
/*清除app数据*/ /*清除app数据*/
private final String CLEAN_APP_CACHE = "32"; private static final String CLEAN_APP_CACHE = "32";
/*开发人员选项*/ /*开发人员选项*/
private final String DEVELOPER_OPTIONS = "33"; private static final String DEVELOPER_OPTIONS = "33";
/*全局更新*/ /*全局更新*/
private final String GLOBAL_UPDATE = "34"; private static final String GLOBAL_UPDATE = "34";
/*电子书包激活码*/ /*电子书包激活码*/
private final String EBAG_CODE = "35"; private static final String EBAG_CODE = "35";
/*更新白名单*/ /*更新白名单*/
private final String UPDATE_WHITELIST = "36"; private static final String UPDATE_WHITELIST = "36";
/*更换批次不恢复出厂*/ /*更换批次不恢复出厂*/
private final String UPDATE_BATCH = "37"; private static final String UPDATE_BATCH = "37";
/*添加wifi*/ /*添加wifi*/
private final String UPDATE_WIFI_PW = "38"; private static final String UPDATE_WIFI_PW = "38";
/*远程关机*/ /*远程关机*/
private final String DEVICES_SHUTDOWN_NOW = "40"; private static final String DEVICES_SHUTDOWN_NOW = "40";
/*远程定时关机*/ /*远程定时关机*/
private final String DEVICES_POWEROFF = "41"; private static final String DEVICES_POWEROFF = "41";
/*远程log*/ /*远程log*/
private final String SN_RUN_LOG = "43"; private static final String SN_RUN_LOG = "43";
/*自定义指令*/ /*自定义指令*/
private final String CUSTOM_ORDER = "44"; private static final String CUSTOM_ORDER = "44";
/*优化内存*/ /*优化内存*/
private final String CLEAN_MEMORY = "47"; private static final String CLEAN_MEMORY = "47";
/*运行日志设置*/ /*运行日志设置*/
private final String SN_LOG_SETTING = "48"; private static final String SN_LOG_SETTING = "48";
/*禁止应用打开*/ /*禁止应用打开*/
private final String DISABLE_APP_USAGE = "51"; private static final String DISABLE_APP_USAGE = "51";
/*上传电池信息*/ /*上传电池信息*/
private final String INFO_BATTERY_INFO = "53"; private static final String INFO_BATTERY_INFO = "53";
/*判断是否更新桌面*/ /*判断是否更新桌面*/
private final String UPDATE_DESKTOP = "56"; private static final String UPDATE_DESKTOP = "56";
private Context mContext; private Context mContext;
@@ -511,7 +511,7 @@ public class MessageReceiver extends XGPushBaseReceiver {
ToastUtil.betaShow("收到管控:设备重置"); ToastUtil.betaShow("收到管控:设备重置");
JGYUtils.getInstance().cleanAoleLauncher3Cache(); JGYUtils.getInstance().cleanAoleLauncher3Cache();
Utils.doMasterClear(mContext); Utils.doMasterClear(mContext);
MMKV.defaultMMKV().clearAll(); MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE).clearAll();
JGYUtils.getInstance().cleanAoleAppCache(); JGYUtils.getInstance().cleanAoleAppCache();
JGYUtils.getInstance().wakeUpAoleyunAPP(); JGYUtils.getInstance().wakeUpAoleyunAPP();
sendRefreshBroadcast(context); sendRefreshBroadcast(context);
@@ -1278,7 +1278,6 @@ public class MessageReceiver extends XGPushBaseReceiver {
e.printStackTrace(); e.printStackTrace();
Log.e(TAG, "defaultCallMediaPlayer: " + e.getMessage()); Log.e(TAG, "defaultCallMediaPlayer: " + e.getMessage());
} }
} }
private void setMaxVolume(Context mContext) { private void setMaxVolume(Context mContext) {
@@ -1293,7 +1292,6 @@ public class MessageReceiver extends XGPushBaseReceiver {
audioManager.setSpeakerphoneOn(true); audioManager.setSpeakerphoneOn(true);
} }
private void cleanCache(String extras) { private void cleanCache(String extras) {
JSONObject jsonObject = JSONObject.parseObject(extras); JSONObject jsonObject = JSONObject.parseObject(extras);
String packageName = jsonObject.getString("app_package"); String packageName = jsonObject.getString("app_package");

View File

@@ -974,6 +974,9 @@ public class ApkUtils {
this.add("com.ckl.fcfilemanager"); this.add("com.ckl.fcfilemanager");
this.add("com.iflytek.inputmethod"); this.add("com.iflytek.inputmethod");
this.add("com.wyt.wangkexueximvvm1");
this.add("com.android.stk");
this.add("com.shoufei.aole");
}}; }};
public static void showAllAPP(Context context) { public static void showAllAPP(Context context) {

View File

@@ -109,22 +109,21 @@ public class JGYUtils {
@SuppressLint("StaticFieldLeak") @SuppressLint("StaticFieldLeak")
private static JGYUtils sInstance; private static JGYUtils sInstance;
private MMKV mMMKV = MMKV.defaultMMKV(); private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
private Context mContext; private Context mContext;
private ContentResolver crv; private ContentResolver crv;
public static int UnknowPlatform = 0; public static final int UnknowPlatform = 0;
public static int MTKPlatform = 1; public static final int MTKPlatform = 1;
// TODO: 2022/4/23 标签替换未完成 public static final int CubePlatform = 2;
public static int CubePlatform = 2; public static final int ZhanruiPlatform = 3;
public static int ZhanruiPlatform = 3; public static final int MTK11Platform = 5;
public static final String Other = "其他";
public static String Other = "其他"; public static final String MTKTag = "MTK";
public static String MTKTag = "MTK"; public static final String CubeTag = "展锐cube";
// TODO: 2022/4/23 标签替换未完成 public static final String ZhanruiTag = "展锐";
public static String CubeTag = "展锐cube"; public static final String MTK11Tag = "MTK11";
public static String ZhanruiTag = "展锐";
private CacheHelper cacheHelper; private CacheHelper cacheHelper;
@@ -179,8 +178,11 @@ public class JGYUtils {
Log.i(TAG, "checkAppPlatform: " + "展锐平台"); Log.i(TAG, "checkAppPlatform: " + "展锐平台");
return ZhanruiPlatform; return ZhanruiPlatform;
} else if ("ZhanRuiCube".equalsIgnoreCase(platform)) { } else if ("ZhanRuiCube".equalsIgnoreCase(platform)) {
Log.i(TAG, "checkAppPlatform: " + "酷比平台"); Log.i(TAG, "checkAppPlatform: " + "ZhanRuiCube");
return CubePlatform; return CubePlatform;
} else if ("MTK11".equalsIgnoreCase(platform)) {
Log.i(TAG, "checkAppPlatform: " + "MTK11");
return MTK11Platform;
} else { } else {
Log.i(TAG, "checkAppPlatform: " + "没有数据"); Log.i(TAG, "checkAppPlatform: " + "没有数据");
return UnknowPlatform; return UnknowPlatform;
@@ -208,6 +210,8 @@ public class JGYUtils {
getAppPlatformCallback.AppPlatform(ZhanruiPlatform); getAppPlatformCallback.AppPlatform(ZhanruiPlatform);
} else if ("ZhanRuiCube".equalsIgnoreCase(platform)) { } else if ("ZhanRuiCube".equalsIgnoreCase(platform)) {
getAppPlatformCallback.AppPlatform(CubePlatform); getAppPlatformCallback.AppPlatform(CubePlatform);
} else if ("MTK11".equalsIgnoreCase(platform)) {
getAppPlatformCallback.AppPlatform(MTK11Platform);
} else { } else {
getAppPlatformCallback.AppPlatform(UnknowPlatform); getAppPlatformCallback.AppPlatform(UnknowPlatform);
} }
@@ -221,6 +225,8 @@ public class JGYUtils {
return ZhanruiTag; return ZhanruiTag;
} else if ("ZhanRuiCube".equalsIgnoreCase(platform)) { } else if ("ZhanRuiCube".equalsIgnoreCase(platform)) {
return CubeTag; return CubeTag;
} else if ("MTK11".equalsIgnoreCase(platform)) {
return MTK11Tag;
} else { } else {
return Other; return Other;
} }
@@ -1344,6 +1350,10 @@ public class JGYUtils {
//删除用户除了在应用市场的其他应用 //删除用户除了在应用市场的其他应用
public void deleteOtherApp() { public void deleteOtherApp() {
Log.e(TAG, "deleteOtherApp: " + Build.MODEL);
if ("K106".equals(Build.MODEL)) {
return;
}
int locked = Settings.System.getInt(crv, JGYActions.ACTION_QCH_UNLOCK_IPAD, 0); int locked = Settings.System.getInt(crv, JGYActions.ACTION_QCH_UNLOCK_IPAD, 0);
if (locked == 1) { if (locked == 1) {
return; return;
@@ -2071,18 +2081,28 @@ public class JGYUtils {
* @param pkg * @param pkg
*/ */
public void setDefaultDesktop(String pkg) { public void setDefaultDesktop(String pkg) {
// Log.e(TAG, "setDefaultDesktop: " + pkg);
// if (TextUtils.isEmpty(pkg)) {
// openLauncher3();
// } else {
// String className = getStartClassName(pkg);
// if (TextUtils.isEmpty(className)) {
// openLauncher3();
// } else {
// setDefaultDesktop(pkg, className);
// }
// }
}
public void setJxwLauncher(String pkg) {
Log.e(TAG, "setDefaultDesktop: " + pkg); Log.e(TAG, "setDefaultDesktop: " + pkg);
if (TextUtils.isEmpty(pkg)) {
openLauncher3();
} else {
String className = getStartClassName(pkg); String className = getStartClassName(pkg);
if (TextUtils.isEmpty(className)) { if (TextUtils.isEmpty(className)) {
openLauncher3(); Log.e(TAG, "setJxwLauncher: empty");
} else { } else {
setDefaultDesktop(pkg, className); setDefaultDesktop(pkg, className);
} }
} }
}
private void openLauncher3() { private void openLauncher3() {
setDefaultDesktop(Launcher3, Launcher3Class); setDefaultDesktop(Launcher3, Launcher3Class);
@@ -2126,7 +2146,7 @@ public class JGYUtils {
public void setDefaultDesktop(String pkg, String className) { public void setDefaultDesktop(String pkg, String className) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
setRoleHolderAsUser(mContext, pkg); // setRoleHolderAsUser(mContext, pkg);
Log.e(TAG, "setDefaultDesktop: setRoleHolderAsUser"); Log.e(TAG, "setDefaultDesktop: setRoleHolderAsUser");
} else { } else {
//爱华设置,暂时屏蔽 //爱华设置,暂时屏蔽

View File

@@ -325,9 +325,10 @@ public class SysSettingUtils {
case 1: case 1:
navigationStatus = CommonConfig.AOLE_ACTION_HIDE_NAVIGATION_BAR; navigationStatus = CommonConfig.AOLE_ACTION_HIDE_NAVIGATION_BAR;
break; break;
default:
} }
Intent navIntent = new Intent(navigationStatus).setPackage("com.android.systemui"); Intent navIntent = new Intent(navigationStatus);
// Intent navIntent = new Intent(navigationStatus).setPackage("com.android.systemui");
context.sendBroadcast(navIntent); context.sendBroadcast(navIntent);
@@ -346,8 +347,10 @@ public class SysSettingUtils {
case 1: case 1:
statusbarStatus = CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR; statusbarStatus = CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR;
break; break;
default:
} }
Intent statusIntent = new Intent(statusbarStatus).setPackage("com.android.systemui"); Intent statusIntent = new Intent(statusbarStatus);
// Intent statusIntent = new Intent(statusbarStatus).setPackage("com.android.systemui");
context.sendBroadcast(statusIntent); context.sendBroadcast(statusIntent);
} }
} }
@@ -367,8 +370,10 @@ public class SysSettingUtils {
case 1: case 1:
navigationStatus = CommonConfig.AOLE_ACTION_HIDE_NAVIGATION_BAR; navigationStatus = CommonConfig.AOLE_ACTION_HIDE_NAVIGATION_BAR;
break; break;
default:
} }
Intent navIntent = new Intent(navigationStatus).setPackage("com.android.systemui"); // Intent navIntent = new Intent(navigationStatus).setPackage("com.android.systemui");
Intent navIntent = new Intent(navigationStatus);
context.sendBroadcast(navIntent); context.sendBroadcast(navIntent);
@@ -387,8 +392,10 @@ public class SysSettingUtils {
case 1: case 1:
statusbarStatus = CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR; statusbarStatus = CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR;
break; break;
default:
} }
Intent statusIntent = new Intent(statusbarStatus).setPackage("com.android.systemui"); Intent statusIntent = new Intent(statusbarStatus);
// Intent statusIntent = new Intent(statusbarStatus).setPackage("com.android.systemui");
context.sendBroadcast(statusIntent); context.sendBroadcast(statusIntent);
} }
} }

View File

@@ -806,7 +806,7 @@ public class Utils {
Log.e("getSerial", "读取设备序列号异常:" + e.toString()); Log.e("getSerial", "读取设备序列号异常:" + e.toString());
} }
if (BuildConfig.DEBUG) { if (BuildConfig.DEBUG) {
// return "QNG2DKB00463"; return "LTPKD22110000051";
// serial = "012345679ABCDEF"; // serial = "012345679ABCDEF";
} }
if (NOSN.equalsIgnoreCase(serial)) { if (NOSN.equalsIgnoreCase(serial)) {
@@ -1309,12 +1309,17 @@ public class Utils {
@SuppressLint("HardwareIds") @SuppressLint("HardwareIds")
public static String getIMEI(Context context, int slotIndex) { public static String getIMEI(Context context, int slotIndex) {
String imei;
TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
return tm.getImei(slotIndex); imei = tm.getImei(slotIndex);
} else { } else {
return tm.getDeviceId(slotIndex); imei = tm.getDeviceId(slotIndex);
} }
if (TextUtils.isEmpty(imei)) {
return "暂无数据";
}
return imei;
} }
@SuppressLint("HardwareIds") @SuppressLint("HardwareIds")
@@ -1695,11 +1700,11 @@ public class Utils {
* @return * @return
*/ */
public static String getCustomVersion() { public static String getCustomVersion() {
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.ZhanruiPlatform) { if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.ZhanruiPlatform
return Utils.getProperty("ro.build.display.id", "获取失败"); || JGYUtils.getInstance().checkAppPlatform() == JGYUtils.CubePlatform
} else if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.CubePlatform) { || JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MTKPlatform
return Utils.getProperty("ro.build.display.id", "获取失败"); || JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MTK11Platform
} else if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MTKPlatform) { ) {
return Utils.getProperty("ro.build.display.id", "获取失败"); return Utils.getProperty("ro.build.display.id", "获取失败");
} else { } else {
return Utils.getProperty("ro.custom.build.version", "获取失败"); return Utils.getProperty("ro.custom.build.version", "获取失败");

View File

@@ -9,6 +9,7 @@ import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import com.aoleyun.sn.bean.WiFiAlias; import com.aoleyun.sn.bean.WiFiAlias;
import com.aoleyun.sn.comm.CommonConfig;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken; import com.google.gson.reflect.TypeToken;
import com.tencent.mmkv.MMKV; import com.tencent.mmkv.MMKV;
@@ -176,7 +177,7 @@ public class WiFiUtils {
synchronized public static void saveWiFiPasswd(List<WiFiAlias> passwd) { synchronized public static void saveWiFiPasswd(List<WiFiAlias> passwd) {
String jsonString = MMKV.defaultMMKV().decodeString("WiFiPassword", ""); String jsonString = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE).decodeString("WiFiPassword", "");
Log.e(TAG, "saveWiFiPasswd: " + jsonString); Log.e(TAG, "saveWiFiPasswd: " + jsonString);
Gson gson = new Gson(); Gson gson = new Gson();
Type listType = new TypeToken<List<WiFiAlias>>() { Type listType = new TypeToken<List<WiFiAlias>>() {

File diff suppressed because it is too large Load Diff

View File

@@ -481,7 +481,7 @@
<TextView <TextView
android:id="@+id/tv_serial1" android:id="@+id/tv_serial1"
android:layout_width="@dimen/dp_20" android:layout_width="@dimen/dp_30"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_8" android:layout_marginStart="@dimen/dp_8"
android:maxLines="1" android:maxLines="1"
@@ -537,7 +537,7 @@
<TextView <TextView
android:id="@+id/tv_imei1" android:id="@+id/tv_imei1"
android:layout_width="@dimen/dp_20" android:layout_width="@dimen/dp_30"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_8" android:layout_marginStart="@dimen/dp_8"
android:maxLines="1" android:maxLines="1"
@@ -593,7 +593,7 @@
<TextView <TextView
android:id="@+id/tv_mac1" android:id="@+id/tv_mac1"
android:layout_width="@dimen/dp_20" android:layout_width="@dimen/dp_30"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_8" android:layout_marginStart="@dimen/dp_8"
android:maxLines="1" android:maxLines="1"