version:G10P 1.0.2
fix: update:华瑞安G10P适配
This commit is contained in:
@@ -107,7 +107,7 @@ public class SplashActivity extends AppCompatActivity {
|
||||
if (BuildConfig.DEBUG) {
|
||||
JGYUtils.getModel();
|
||||
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();
|
||||
Log.e(TAG, "initView: " + NetworkUtils.getPhoneNumber(this));
|
||||
FlowInfo flowInfo1 = GetFlowUtil.getAppFlowInfo(BuildConfig.APPLICATION_ID, this);
|
||||
|
||||
@@ -45,7 +45,7 @@ public class CheckNetActivity extends BaseActivity implements CheckNetContact.Ma
|
||||
Button bt_confirm;
|
||||
|
||||
private CheckNetPresenter mCheckNetPresenter;
|
||||
private MMKV mMMKV = MMKV.defaultMMKV();
|
||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
|
||||
@Override
|
||||
public void onDisconnected() {
|
||||
|
||||
@@ -251,6 +251,7 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView,
|
||||
private void getDevicesInfo() {
|
||||
tv_model.setText(Build.MODEL);
|
||||
String sn = Utils.getSerial(this);
|
||||
Log.e(TAG, "getDevicesInfo: " + sn);
|
||||
tv_serial.setText(sn);
|
||||
getIMEI();
|
||||
setMac();
|
||||
|
||||
@@ -11,6 +11,7 @@ import androidx.multidex.MultiDexApplication;
|
||||
|
||||
import com.aoleyun.sn.BuildConfig;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.comm.CommonConfig;
|
||||
import com.aoleyun.sn.manager.MapManager;
|
||||
import com.aoleyun.sn.manager.ConnectManager;
|
||||
import com.aoleyun.sn.manager.FileManager;
|
||||
@@ -123,7 +124,7 @@ public class BaseApplication extends MultiDexApplication {
|
||||
public void onSuccess(Object data, int flag) {
|
||||
//token在设备卸载重装的时候有可能会变
|
||||
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<>();
|
||||
accountInfoList.add(new XGPushManager.AccountInfo(XGPushManager.AccountType.CUSTOM.getValue(), Utils.getSerial(getApplicationContext())));
|
||||
if (Utils.NOSN.equalsIgnoreCase(Utils.getSerial())) {
|
||||
|
||||
@@ -2,7 +2,9 @@ package com.aoleyun.sn.comm;
|
||||
|
||||
|
||||
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";
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.graphics.drawable.Drawable;
|
||||
import android.os.Environment;
|
||||
import android.util.Log;
|
||||
|
||||
import com.aoleyun.sn.comm.CommonConfig;
|
||||
import com.jakewharton.disklrucache.DiskLruCache;
|
||||
import com.tencent.mmkv.BuildConfig;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
@@ -31,7 +32,7 @@ import java.io.Serializable;
|
||||
public class CacheHelper {
|
||||
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 int MAX_COUNT = 1024 * 1024 * 1024;
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.aoleyun.sn.comm.CommonConfig;
|
||||
import com.aoleyun.sn.utils.TimeUtils;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
|
||||
@@ -33,7 +34,7 @@ public class ConnectManager {
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
private static ConnectManager sInstance;
|
||||
private Context mContext;
|
||||
private MMKV mMMKV = MMKV.defaultMMKV();
|
||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
|
||||
private ConnectManager(Context context) {
|
||||
if (context == null) {
|
||||
|
||||
@@ -173,7 +173,7 @@ public class NetInterfaceManager {
|
||||
private Context mContext;
|
||||
private Retrofit mRetrofit;
|
||||
private OkHttpClient okHttpClient;
|
||||
private MMKV mMMKV = MMKV.defaultMMKV();
|
||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
private CacheHelper cacheHelper;
|
||||
|
||||
private static final int OK = 200;
|
||||
@@ -365,7 +365,7 @@ public class NetInterfaceManager {
|
||||
return mRetrofit.create(MACAddressApi.class)
|
||||
.sendMACaddress(Utils.getSerial(mContext),
|
||||
Utils.getAndroid10MAC(mContext),
|
||||
MMKV.defaultMMKV().decodeString("XGPushtoken", "未知"),
|
||||
MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE).decodeString("XGPushtoken", "未知"),
|
||||
Utils.getCustomVersion(),
|
||||
BuildConfig.VERSION_NAME,
|
||||
Utils.getAPPVersionName(PackageNames.APPSTORE, mContext),
|
||||
@@ -1795,23 +1795,23 @@ public class NetInterfaceManager {
|
||||
}
|
||||
|
||||
private void setDefaultDesktop(String defaultApp) {
|
||||
int aihuaUnlock = Settings.System.getInt(mContext.getContentResolver(), CommonConfig.AIHUA_UNLOCK, 0);
|
||||
if (aihuaUnlock == 1) {
|
||||
JGYUtils.getInstance().setDefaultDesktop(PackageNames.DESKTOP);
|
||||
} else {
|
||||
if (!TextUtils.isEmpty(defaultApp)) {
|
||||
JGYUtils.getInstance().setDefaultDesktop(defaultApp);
|
||||
SPUtils.put(mContext, "default_launcher", defaultApp);
|
||||
} else {
|
||||
String default_launcher = (String) SPUtils.get(mContext, "default_launcher", "");
|
||||
Log.e("getDefaultApp", "onNext: " + default_launcher);
|
||||
if (TextUtils.isEmpty(default_launcher)) {
|
||||
JGYUtils.getInstance().setDefaultDesktop();
|
||||
} else {
|
||||
JGYUtils.getInstance().setDefaultDesktop(default_launcher);
|
||||
}
|
||||
}
|
||||
}
|
||||
// int aihuaUnlock = Settings.System.getInt(mContext.getContentResolver(), CommonConfig.AIHUA_UNLOCK, 0);
|
||||
// if (aihuaUnlock == 1) {
|
||||
// JGYUtils.getInstance().setDefaultDesktop(PackageNames.DESKTOP);
|
||||
// } else {
|
||||
// if (!TextUtils.isEmpty(defaultApp)) {
|
||||
// JGYUtils.getInstance().setDefaultDesktop(defaultApp);
|
||||
// SPUtils.put(mContext, "default_launcher", defaultApp);
|
||||
// } else {
|
||||
// String default_launcher = (String) SPUtils.get(mContext, "default_launcher", "");
|
||||
// Log.e("getDefaultApp", "onNext: " + default_launcher);
|
||||
// if (TextUtils.isEmpty(default_launcher)) {
|
||||
// JGYUtils.getInstance().setDefaultDesktop();
|
||||
// } else {
|
||||
// JGYUtils.getInstance().setDefaultDesktop(default_launcher);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
public interface StudesInfoListener {
|
||||
@@ -3323,7 +3323,7 @@ public class NetInterfaceManager {
|
||||
public void onNext(@NonNull WhoisBean whoisBean) {
|
||||
Log.e("GetWhois", "onNext: " + whoisBean);
|
||||
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);
|
||||
if (whoisBean != null && !TextUtils.isEmpty(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 {
|
||||
callbak.getPublicIp("unknown");
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ public class UrlAddress {
|
||||
|
||||
/*开机动画*/
|
||||
public static final String GET_LOGO_IMG = "Sn/getLogoImg";
|
||||
/*获取默认桌面升级*/
|
||||
// /*获取默认桌面升级*/
|
||||
public static final String GET_DESKTOP = "Sn/getSnDesktop";
|
||||
/*获取系统默认程序*/
|
||||
public static final String GET_DEFAULT_APP = "app/getDefaultApp";
|
||||
|
||||
@@ -76,7 +76,7 @@ public class BootReceiver extends BroadcastReceiver {
|
||||
default:
|
||||
break;
|
||||
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) {
|
||||
LogDBManager.getInstance().creatRebootLog("首次启动", TimeUtils.transferLongToDate(System.currentTimeMillis()));
|
||||
SPUtils.put(context, CommonConfig.FIRST_STARTUP, 1);
|
||||
|
||||
@@ -40,7 +40,7 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
private MainSContact.MainView mView;
|
||||
private Context mContext;
|
||||
private ContentResolver crv;
|
||||
private MMKV mMMKV = MMKV.defaultMMKV();
|
||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
private CacheHelper cacheHelper;
|
||||
|
||||
private BehaviorSubject<ActivityEvent> lifecycle;
|
||||
|
||||
@@ -5,6 +5,8 @@ import android.app.AlarmManager;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.Service;
|
||||
import android.app.role.OnRoleHoldersChangedListener;
|
||||
import android.app.role.RoleManager;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
@@ -21,6 +23,7 @@ import android.os.Binder;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.os.IBinder;
|
||||
import android.os.UserHandle;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.DisplayMetrics;
|
||||
@@ -76,6 +79,7 @@ import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
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();
|
||||
|
||||
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
|
||||
public void onDisconnected() {
|
||||
@@ -172,6 +178,8 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
tagSets.add(JGYUtils.ZhanruiTag);
|
||||
} else if (platform == JGYUtils.CubePlatform) {
|
||||
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();
|
||||
task.execute("ntp.aliyun.com");
|
||||
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()) {
|
||||
ApkUtils.UninstallAPP(this, "com.joytv.live");
|
||||
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 {
|
||||
getPackageManager().setApplicationEnabledSetting("com.android.email", PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
|
||||
@@ -948,7 +973,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
|
||||
@Override
|
||||
public void sendNetworkFinish() {
|
||||
Log.e(TAG, "sendNetworkFinish: " );
|
||||
Log.e(TAG, "sendNetworkFinish: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -97,97 +97,97 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
||||
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管控*/
|
||||
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自启联网滑动管控*/
|
||||
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使用时间*/
|
||||
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内网页管控*/
|
||||
private final String APP_WEBSITE = "16";
|
||||
private static final String APP_WEBSITE = "16";
|
||||
/*禁止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霸屏*/
|
||||
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数据*/
|
||||
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*/
|
||||
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*/
|
||||
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;
|
||||
@@ -511,7 +511,7 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
||||
ToastUtil.betaShow("收到管控:设备重置");
|
||||
JGYUtils.getInstance().cleanAoleLauncher3Cache();
|
||||
Utils.doMasterClear(mContext);
|
||||
MMKV.defaultMMKV().clearAll();
|
||||
MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE).clearAll();
|
||||
JGYUtils.getInstance().cleanAoleAppCache();
|
||||
JGYUtils.getInstance().wakeUpAoleyunAPP();
|
||||
sendRefreshBroadcast(context);
|
||||
@@ -1278,7 +1278,6 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
||||
e.printStackTrace();
|
||||
Log.e(TAG, "defaultCallMediaPlayer: " + e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void setMaxVolume(Context mContext) {
|
||||
@@ -1293,7 +1292,6 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
||||
audioManager.setSpeakerphoneOn(true);
|
||||
}
|
||||
|
||||
|
||||
private void cleanCache(String extras) {
|
||||
JSONObject jsonObject = JSONObject.parseObject(extras);
|
||||
String packageName = jsonObject.getString("app_package");
|
||||
|
||||
@@ -974,6 +974,9 @@ public class ApkUtils {
|
||||
this.add("com.ckl.fcfilemanager");
|
||||
|
||||
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) {
|
||||
|
||||
@@ -109,22 +109,21 @@ public class JGYUtils {
|
||||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
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 ContentResolver crv;
|
||||
|
||||
public static int UnknowPlatform = 0;
|
||||
public static int MTKPlatform = 1;
|
||||
// TODO: 2022/4/23 标签替换未完成
|
||||
public static int CubePlatform = 2;
|
||||
public static int ZhanruiPlatform = 3;
|
||||
public static final int UnknowPlatform = 0;
|
||||
public static final int MTKPlatform = 1;
|
||||
public static final int CubePlatform = 2;
|
||||
public static final int ZhanruiPlatform = 3;
|
||||
public static final int MTK11Platform = 5;
|
||||
|
||||
|
||||
public static String Other = "其他";
|
||||
public static String MTKTag = "MTK";
|
||||
// TODO: 2022/4/23 标签替换未完成
|
||||
public static String CubeTag = "展锐cube";
|
||||
public static String ZhanruiTag = "展锐";
|
||||
public static final String Other = "其他";
|
||||
public static final String MTKTag = "MTK";
|
||||
public static final String CubeTag = "展锐cube";
|
||||
public static final String ZhanruiTag = "展锐";
|
||||
public static final String MTK11Tag = "MTK11";
|
||||
|
||||
private CacheHelper cacheHelper;
|
||||
|
||||
@@ -179,8 +178,11 @@ public class JGYUtils {
|
||||
Log.i(TAG, "checkAppPlatform: " + "展锐平台");
|
||||
return ZhanruiPlatform;
|
||||
} else if ("ZhanRuiCube".equalsIgnoreCase(platform)) {
|
||||
Log.i(TAG, "checkAppPlatform: " + "酷比平台");
|
||||
Log.i(TAG, "checkAppPlatform: " + "ZhanRuiCube");
|
||||
return CubePlatform;
|
||||
} else if ("MTK11".equalsIgnoreCase(platform)) {
|
||||
Log.i(TAG, "checkAppPlatform: " + "MTK11");
|
||||
return MTK11Platform;
|
||||
} else {
|
||||
Log.i(TAG, "checkAppPlatform: " + "没有数据");
|
||||
return UnknowPlatform;
|
||||
@@ -208,6 +210,8 @@ public class JGYUtils {
|
||||
getAppPlatformCallback.AppPlatform(ZhanruiPlatform);
|
||||
} else if ("ZhanRuiCube".equalsIgnoreCase(platform)) {
|
||||
getAppPlatformCallback.AppPlatform(CubePlatform);
|
||||
} else if ("MTK11".equalsIgnoreCase(platform)) {
|
||||
getAppPlatformCallback.AppPlatform(MTK11Platform);
|
||||
} else {
|
||||
getAppPlatformCallback.AppPlatform(UnknowPlatform);
|
||||
}
|
||||
@@ -221,6 +225,8 @@ public class JGYUtils {
|
||||
return ZhanruiTag;
|
||||
} else if ("ZhanRuiCube".equalsIgnoreCase(platform)) {
|
||||
return CubeTag;
|
||||
} else if ("MTK11".equalsIgnoreCase(platform)) {
|
||||
return MTK11Tag;
|
||||
} else {
|
||||
return Other;
|
||||
}
|
||||
@@ -1344,6 +1350,10 @@ public class JGYUtils {
|
||||
|
||||
//删除用户除了在应用市场的其他应用
|
||||
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);
|
||||
if (locked == 1) {
|
||||
return;
|
||||
@@ -2071,16 +2081,26 @@ public class JGYUtils {
|
||||
* @param 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);
|
||||
if (TextUtils.isEmpty(pkg)) {
|
||||
openLauncher3();
|
||||
String className = getStartClassName(pkg);
|
||||
if (TextUtils.isEmpty(className)) {
|
||||
Log.e(TAG, "setJxwLauncher: empty");
|
||||
} else {
|
||||
String className = getStartClassName(pkg);
|
||||
if (TextUtils.isEmpty(className)) {
|
||||
openLauncher3();
|
||||
} else {
|
||||
setDefaultDesktop(pkg, className);
|
||||
}
|
||||
setDefaultDesktop(pkg, className);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2126,7 +2146,7 @@ public class JGYUtils {
|
||||
|
||||
public void setDefaultDesktop(String pkg, String className) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
setRoleHolderAsUser(mContext, pkg);
|
||||
// setRoleHolderAsUser(mContext, pkg);
|
||||
Log.e(TAG, "setDefaultDesktop: setRoleHolderAsUser");
|
||||
} else {
|
||||
//爱华设置,暂时屏蔽
|
||||
|
||||
@@ -325,9 +325,10 @@ public class SysSettingUtils {
|
||||
case 1:
|
||||
navigationStatus = CommonConfig.AOLE_ACTION_HIDE_NAVIGATION_BAR;
|
||||
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);
|
||||
|
||||
|
||||
@@ -346,8 +347,10 @@ public class SysSettingUtils {
|
||||
case 1:
|
||||
statusbarStatus = CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR;
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -367,8 +370,10 @@ public class SysSettingUtils {
|
||||
case 1:
|
||||
navigationStatus = CommonConfig.AOLE_ACTION_HIDE_NAVIGATION_BAR;
|
||||
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);
|
||||
|
||||
|
||||
@@ -387,8 +392,10 @@ public class SysSettingUtils {
|
||||
case 1:
|
||||
statusbarStatus = CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR;
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -806,7 +806,7 @@ public class Utils {
|
||||
Log.e("getSerial", "读取设备序列号异常:" + e.toString());
|
||||
}
|
||||
if (BuildConfig.DEBUG) {
|
||||
// return "QNG2DKB00463";
|
||||
return "LTPKD22110000051";
|
||||
// serial = "012345679ABCDEF";
|
||||
}
|
||||
if (NOSN.equalsIgnoreCase(serial)) {
|
||||
@@ -1309,12 +1309,17 @@ public class Utils {
|
||||
|
||||
@SuppressLint("HardwareIds")
|
||||
public static String getIMEI(Context context, int slotIndex) {
|
||||
String imei;
|
||||
TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
return tm.getImei(slotIndex);
|
||||
imei = tm.getImei(slotIndex);
|
||||
} else {
|
||||
return tm.getDeviceId(slotIndex);
|
||||
imei = tm.getDeviceId(slotIndex);
|
||||
}
|
||||
if (TextUtils.isEmpty(imei)) {
|
||||
return "暂无数据";
|
||||
}
|
||||
return imei;
|
||||
}
|
||||
|
||||
@SuppressLint("HardwareIds")
|
||||
@@ -1695,11 +1700,11 @@ public class Utils {
|
||||
* @return
|
||||
*/
|
||||
public static String getCustomVersion() {
|
||||
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.ZhanruiPlatform) {
|
||||
return Utils.getProperty("ro.build.display.id", "获取失败");
|
||||
} else if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.CubePlatform) {
|
||||
return Utils.getProperty("ro.build.display.id", "获取失败");
|
||||
} else if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MTKPlatform) {
|
||||
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.ZhanruiPlatform
|
||||
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.CubePlatform
|
||||
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MTKPlatform
|
||||
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MTK11Platform
|
||||
) {
|
||||
return Utils.getProperty("ro.build.display.id", "获取失败");
|
||||
} else {
|
||||
return Utils.getProperty("ro.custom.build.version", "获取失败");
|
||||
|
||||
@@ -9,6 +9,7 @@ import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.aoleyun.sn.bean.WiFiAlias;
|
||||
import com.aoleyun.sn.comm.CommonConfig;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
@@ -176,7 +177,7 @@ public class WiFiUtils {
|
||||
|
||||
|
||||
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);
|
||||
Gson gson = new Gson();
|
||||
Type listType = new TypeToken<List<WiFiAlias>>() {
|
||||
|
||||
Reference in New Issue
Block a user