bugfixes:优化命名
This commit is contained in:
2025-03-13 10:41:32 +08:00
parent 816753a500
commit 8716bf0e36
25 changed files with 458 additions and 397 deletions

View File

@@ -29,8 +29,8 @@ android {
defaultConfig {
applicationId "com.aoleyun.sn"
versionCode 168
versionName "1.4.1126"
versionCode 169
versionName "1.4.1217"
//There are no CERT files because If the mini sdk version is 23+, the AGP will ignore the V1 scheme signature.
minSdkVersion 24
@@ -207,6 +207,15 @@ android {
v1SigningEnabled true
v2SigningEnabled true
}
P50 {
storeFile file("keystore/P50TD.jks")
storePassword "123456"
keyAlias "P50TD"
keyPassword "123456"
v1SigningEnabled true
v2SigningEnabled true
}
}
// Disable release builds for now
@@ -218,6 +227,34 @@ android {
}
buildTypes {
P50Debug.initWith(debug)
P50Debug {
versionNameSuffix "-debug"
debuggable true
signingConfig signingConfigs.P50
buildConfigField "String", "platform", '"P50TD"'
}
P50Release.initWith(release)
P50Release {
signingConfig signingConfigs.P50
buildConfigField "String", "platform", '"P50TD"'
}
G11JDebug.initWith(debug)
G11JDebug {
versionNameSuffix "-debug"
debuggable true
signingConfig signingConfigs.Huaruian8768
buildConfigField "String", "platform", '"aud8786"'
}
G11JRelease.initWith(release)
G11JRelease {
signingConfig signingConfigs.Huaruian8768
buildConfigField "String", "platform", '"aud8786"'
}
T40AirDebug.initWith(debug)
T40AirDebug {
versionNameSuffix "-debug"

BIN
app/keystore/P50TD.jks Normal file

Binary file not shown.

View File

@@ -32,7 +32,7 @@ import com.aoleyun.sn.service.LogcatService;
import com.aoleyun.sn.utils.ApkUtils;
import com.aoleyun.sn.utils.FlowInfo;
import com.aoleyun.sn.utils.GetFlowUtil;
import com.aoleyun.sn.utils.JGYUtils;
import com.aoleyun.sn.utils.JgyUtils;
import com.aoleyun.sn.utils.NetworkUtils;
import com.aoleyun.sn.utils.SPUtils;
import com.aoleyun.sn.utils.ServiceAliveUtils;
@@ -92,8 +92,8 @@ public class SplashActivity extends AppCompatActivity {
private void initView() {
if (BuildConfig.DEBUG) {
// JGYUtils.getInstance().showApp("com.gaomuxuexi34");
JGYUtils.getModel();
// JgyUtils.getInstance().showApp("com.gaomuxuexi34");
JgyUtils.getModel();
Utils.getAndroiodScreenProperty(SplashActivity.this);
Log.e(TAG, "getOperators: " + NetworkUtils.getOperators(this));
Log.e(TAG, "PublicIP: " + MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE).decodeString(NetInterfaceManager.PublicIP, ""));
@@ -108,7 +108,7 @@ public class SplashActivity extends AppCompatActivity {
Log.e(TAG, "initView: " + Utils.getCurrentChargingCurrent());
Log.e(TAG, "initView: " + Utils.getCurrentChargingVoltage());
ApkUtils.showAllApp(this);
// JGYUtils.getInstance().cleanBackgroundMemory();
// JgyUtils.getInstance().cleanBackgroundMemory();
// NetInterfaceManager.getInstance().uploadLogFile();
bt_log = findViewById(R.id.bt_log);
bt_log.setVisibility(View.VISIBLE);
@@ -158,7 +158,7 @@ public class SplashActivity extends AppCompatActivity {
// Settings.System.putString(getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID, aole_app_forbid + ",com.aoleyun.browser");
// }
// Log.e(TAG, "debugTest: aole_app_forbid:" + aole_app_forbid);
Log.i(TAG, "debugTest: ip = " + JGYUtils.getInstance().getIPAddress());
Log.i(TAG, "debugTest: ip = " + JgyUtils.getInstance().getIPAddress());
Log.i(TAG, "debugTest: getPackage = " + Utils.getPackage());
Log.i(TAG, "debugTest: getMacAddress = " + Utils.getAndroid10MAC(this));
// Log.i(TAG, "debugTest: iptables = " + CmdUtil.execute("iptables -L -n" ).toString());
@@ -169,7 +169,7 @@ public class SplashActivity extends AppCompatActivity {
Log.i(TAG, "debugTest: " + BuildConfig.VERSION_NAME);
Log.i(TAG, "debugTest: " + Utils.getAPPVersionName(PackageNames.APPSTORE, this));
Log.i(TAG, "debugTest: " + Utils.getAndroid7MAC());
Log.i(TAG, "debugTest: launcher3 " + JGYUtils.getInstance().getStartClassName("com.android.launcher3"));
Log.i(TAG, "debugTest: launcher3 " + JgyUtils.getInstance().getStartClassName("com.android.launcher3"));
// try {
// new CacheUtils().cleanApplicationUserData(HomeActivity.this, "com.android.launcher3");
// } catch (Exception e) {
@@ -186,7 +186,7 @@ public class SplashActivity extends AppCompatActivity {
// WiFiUtils.getInstance().connectWifiPws("七彩宏云","colorfulyun.com");
// WiFiUtils.getInstance().connectWifiPws("fht","colorfulyun.com");
// WiFiUtils.getInstance().connectWifiPws("tt","colorfulyun.com");
// JGYUtils.getInstance().shutdown();
// JgyUtils.getInstance().shutdown();
Log.e(TAG, "debugTest: " + PathUtils.getExternalDownloadsPath());
Log.e(TAG, "debugTest: " + ContextCompat.getExternalFilesDirs(this, Environment.DIRECTORY_DOWNLOADS)[0]);

View File

@@ -36,7 +36,7 @@ import com.aoleyun.sn.dialog.UpdateDialog;
import com.aoleyun.sn.service.main.MainService;
import com.aoleyun.sn.utils.ApkUtils;
import com.aoleyun.sn.utils.GlideLoadUtils;
import com.aoleyun.sn.utils.JGYUtils;
import com.aoleyun.sn.utils.JgyUtils;
import com.aoleyun.sn.utils.SPUtils;
import com.aoleyun.sn.utils.SysSettingUtils;
import com.aoleyun.sn.utils.Utils;
@@ -78,7 +78,7 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
}
public void openOta(View view) {
JGYUtils.getInstance().openRomOta();
JgyUtils.getInstance().openRomOta();
}
}
@@ -134,7 +134,7 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
String defaultLauncher = mMMKV.decodeString(CommonConfig.DEFAULT_LAUNCHER_PACKAGE_NAME, "");
Log.e(TAG, "initView: defaultLauncher = " + defaultLauncher);
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.YXPD1Platform) {
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.YXPD1Platform) {
Settings.System.putString(getContentResolver(), CommonConfig.ACTIVATIONBEAN_CODE_KEY, Utils.getSerial(this));
}
@@ -148,7 +148,7 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
}
getDevicesInfo();
JGYUtils.startServices(MainActivity.this);
JgyUtils.startServices(MainActivity.this);
if (BuildConfig.DEBUG) {
Settings.Global.putInt(getContentResolver(), Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 1);
@@ -204,7 +204,7 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
Log.e(TAG, "checkSNError: " + sn);
}
//检查平台和sn是否对应
if (JGYUtils.getInstance().checkSNPlatform(sn) != JGYUtils.getInstance().checkAppPlatform()) {
if (JgyUtils.getInstance().checkSNPlatform(sn) != JgyUtils.getInstance().checkAppPlatform()) {
// showSNErrorDialog("SN数据与平台不符请联系管理员");
}
}
@@ -406,7 +406,7 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
.setOnClickBottomListener(new UpdateDialog.OnClickBottomListener() {
@Override
public void onPositiveClick() {
JGYUtils.getInstance().installAPK(jsonObject);
JgyUtils.getInstance().installAPK(jsonObject);
dialog.dismiss();
}
@@ -448,7 +448,7 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
protected void onDestroy() {
super.onDestroy();
unregister();
JGYUtils.startServices(MainActivity.this);
JgyUtils.startServices(MainActivity.this);
}
@Override

View File

@@ -21,9 +21,8 @@ import com.aoleyun.sn.comm.JGYActions;
import com.aoleyun.sn.databinding.ActivityMainBinding;
import com.aoleyun.sn.gson.GsonUtils;
import com.aoleyun.sn.network.NetInterfaceManager;
import com.aoleyun.sn.network.UrlAddress;
import com.aoleyun.sn.utils.AES.CXAESUtil;
import com.aoleyun.sn.utils.JGYUtils;
import com.aoleyun.sn.utils.JgyUtils;
import com.aoleyun.sn.utils.Utils;
import com.google.gson.Gson;
import com.google.gson.JsonElement;
@@ -135,7 +134,7 @@ public class MainViewModel extends BaseViewModel<ActivityMainBinding, ActivityEv
Log.e("getExclusiveAdminApp", "onNext: " + listBaseResponse);
if (listBaseResponse.code == 200) {
List<AdminAppInfo> adminAppInfos = listBaseResponse.data;
JGYUtils.getInstance().installAdminApp(adminAppInfos);
JgyUtils.getInstance().installAdminApp(adminAppInfos);
}
}
@@ -161,7 +160,7 @@ public class MainViewModel extends BaseViewModel<ActivityMainBinding, ActivityEv
NetInterfaceManager.getInstance()
.getUpdateApi()
.getUpdate(BuildConfig.APPLICATION_ID,
JGYUtils.getInstance().checkAppPlatform())
JgyUtils.getInstance().checkAppPlatform())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
@@ -214,7 +213,7 @@ public class MainViewModel extends BaseViewModel<ActivityMainBinding, ActivityEv
}
public void checkTestUpdate() {
if (!JGYUtils.getInstance().tagEmpty()) {
if (!JgyUtils.getInstance().tagEmpty()) {
NetInterfaceManager.getInstance()
.checkTestUpdate(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
@Override
@@ -229,12 +228,12 @@ public class MainViewModel extends BaseViewModel<ActivityMainBinding, ActivityEv
public void getDefaultDesktop() {
Log.e(TAG, "getDefaultDesktop: ");
if (JGYUtils.isOfficialVersion() || !JGYUtils.getInstance().getDeviceIsLocked()) {
if (JgyUtils.isOfficialVersion() || !JgyUtils.getInstance().getDeviceIsLocked()) {
Log.e(TAG, "getDefaultDesktop: " + "Device unLocked");
} else {
int aihuaUnlock = Settings.System.getInt(getCtx().getContentResolver(), CommonConfig.AIHUA_UNLOCK, 0);
if (JGYUtils.getInstance().isAihuaFramwwork() && aihuaUnlock == 1) {
if (JgyUtils.getInstance().isAihuaFramwwork() && aihuaUnlock == 1) {
Log.e(TAG, "getDefaultDesktop: " + "Device aihua");
} else {
@@ -311,10 +310,10 @@ public class MainViewModel extends BaseViewModel<ActivityMainBinding, ActivityEv
Log.e("setSystemSetting", "onNext: " + data);
// cacheHelper.put(UrlAddress.GET_FIRMWARE, data);
//结果保存到本地
JGYUtils.getInstance().SettingSysData(data);
JgyUtils.getInstance().SettingSysData(data);
} else {
if (JGYUtils.G11TAG.equals(JGYUtils.getInstance().getAppPlatform())
if (JgyUtils.G11TAG.equals(JgyUtils.getInstance().getAppPlatform())
|| "HT01".equals(Build.MODEL)) {
mShowPanel.setValue(true);
} else if ("G10-M".equals(Build.MODEL)
@@ -322,7 +321,7 @@ public class MainViewModel extends BaseViewModel<ActivityMainBinding, ActivityEv
mShowPanel.setValue(false);
}
JGYUtils.getInstance().SettingSysData("");
JgyUtils.getInstance().SettingSysData("");
// cacheHelper.put(UrlAddress.GET_FIRMWARE, "");
}

View File

@@ -18,7 +18,7 @@ import com.aoleyun.sn.manager.MapManager;
import com.aoleyun.sn.network.NetInterfaceManager;
import com.aoleyun.sn.push.PushManager;
import com.aoleyun.sn.rlog.LogDBManager;
import com.aoleyun.sn.utils.JGYUtils;
import com.aoleyun.sn.utils.JgyUtils;
import com.aoleyun.sn.utils.Utils;
import com.aoleyun.sn.utils.WiFiUtils;
import com.aoleyun.sn.utils.XAPKUtils;
@@ -67,7 +67,7 @@ public class BaseApplication extends MultiDexApplication {
aliyunPushInit();
NetInterfaceManager.init(this);
JGYUtils.init(this);
JgyUtils.init(this);
WiFiUtils.init(this);
XAPKUtils.init(this);
LogDBManager.init(this);
@@ -75,7 +75,7 @@ public class BaseApplication extends MultiDexApplication {
ConnectManager.init(this);
MapManager.init(this);
MapManager.getInstance().initMap();
JGYUtils.getInstance().hookWebView();
JgyUtils.getInstance().hookWebView();
Aria.init(this);
Aria.get(this).getDownloadConfig().setMaxTaskNum(1);
Aria.get(this).getDownloadConfig().setConvertSpeed(true);

View File

@@ -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.JgyUtils;
import com.tencent.mmkv.MMKV;
public class AoleyunActivityController extends IActivityController.Stub {
@@ -16,12 +16,12 @@ public class AoleyunActivityController extends IActivityController.Stub {
public boolean activityStarting(Intent intent, String pkg) {
Log.e(TAG, "activityStarting: " + pkg + ", intent= " + intent);
// if (JGYUtils.getInstance().isHidedApp(pkg)) {
// if (JgyUtils.getInstance().isHidedApp(pkg)) {
// return false;
// }
//false 则不会启动,直接返回。
if (JGYUtils.getInstance().isCloudLessonMod(pkg)) {
if (JgyUtils.getInstance().isCloudLessonMod(pkg)) {
return true;
} else {
return false;

View File

@@ -3,7 +3,7 @@ package com.aoleyun.sn.manager;
import android.content.Context;
import android.util.Log;
import com.aoleyun.sn.utils.JGYUtils;
import com.aoleyun.sn.utils.JgyUtils;
import java.io.File;
@@ -31,7 +31,7 @@ public class FileManager {
}
private static void initFolder() {
File file = new File(JGYUtils.getInstance().getDownLoadPath());
File file = new File(JgyUtils.getInstance().getDownLoadPath());
if (!file.exists()) {
if (file.mkdirs()) {
Log.e("initFolder", "initFolder: success");

View File

@@ -134,7 +134,7 @@ import com.aoleyun.sn.utils.BitmapUtils;
import com.aoleyun.sn.utils.CacheUtils;
import com.aoleyun.sn.utils.CmdUtil;
import com.aoleyun.sn.utils.ForegroundAppUtil;
import com.aoleyun.sn.utils.JGYUtils;
import com.aoleyun.sn.utils.JgyUtils;
import com.aoleyun.sn.utils.MD5Util;
import com.aoleyun.sn.utils.NetworkUtils;
import com.aoleyun.sn.utils.SPUtils;
@@ -309,7 +309,7 @@ public class NetInterfaceManager {
@Override
public Response intercept(Chain chain) throws IOException {
Request request = chain.request();
if (!JGYUtils.getInstance().isNetworkConnected()) {
if (!JgyUtils.getInstance().isNetworkConnected()) {
int offlineCacheTime = 60;//离线的时候的缓存的过期时间
request = request.newBuilder()
// .cacheControl(new CacheControl
@@ -478,7 +478,7 @@ public class NetInterfaceManager {
Utils.getWifiAlias(mContext),
Utils.getAPPVersionName(PackageNames.BROWSER, mContext),
Utils.getAPPVersionName(PackageNames.NOTIFICATIONS, mContext),
JGYUtils.getInstance().getAppPlatform(),
JgyUtils.getInstance().getAppPlatform(),
mMMKV.decodeString(WHOIS_ADDR, "未知"),
NetworkUtils.getNetworkType(mContext),
NetworkUtils.getOperators(mContext),
@@ -490,7 +490,7 @@ public class NetInterfaceManager {
}
private String getDesktopAPPVersionName() {
if ("Aiud_A8_ag_1095".equals(Build.MODEL)) {
if (JgyUtils.getInstance().isAiuduPlatform()) {
return Utils.getAPPVersionName(PackageNames.AIUDUDESKTOP, mContext);
} else {
return Utils.getAPPVersionName(PackageNames.DESKTOP, mContext);
@@ -904,7 +904,7 @@ public class NetInterfaceManager {
if (appUpdateInfos != null && appUpdateInfos.size() != 0) {
for (AppUpdateInfo info : appUpdateInfos) {
JsonObject jsonObject = parseString(new Gson().toJson(info)).getAsJsonObject();
JGYUtils.getInstance().installAPK(jsonObject);
JgyUtils.getInstance().installAPK(jsonObject);
}
}
callback.onComplete();
@@ -920,25 +920,25 @@ public class NetInterfaceManager {
*/
public void checkAoleyunUpdate(BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
Observable<BaseResponse<AppUpdateInfo>> infoUpdateObservable = NetInterfaceManager.getInstance()
.getUpdateApi().getUpdate(BuildConfig.APPLICATION_ID, JGYUtils.getInstance().checkAppPlatform());
.getUpdateApi().getUpdate(BuildConfig.APPLICATION_ID, JgyUtils.getInstance().checkAppPlatform());
Observable<BaseResponse<AppUpdateInfo>> storeUpdateObservable = NetInterfaceManager.getInstance()
.getUpdateApi().getUpdate(PackageNames.APPSTORE, JGYUtils.getInstance().checkAppPlatform());
.getUpdateApi().getUpdate(PackageNames.APPSTORE, JgyUtils.getInstance().checkAppPlatform());
Observable<BaseResponse<AppUpdateInfo>> desktopUpdateObservable;
if ("Aiud_A8_ag_1095".equals(Build.MODEL)) {
if (JgyUtils.getInstance().isAiuduPlatform()) {
desktopUpdateObservable = NetInterfaceManager.getInstance()
.getUpdateApi().getUpdate(PackageNames.AIUDUDESKTOP, JGYUtils.getInstance().checkAppPlatform());
.getUpdateApi().getUpdate(PackageNames.AIUDUDESKTOP, JgyUtils.getInstance().checkAppPlatform());
} else {
desktopUpdateObservable = NetInterfaceManager.getInstance()
.getUpdateApi().getUpdate(PackageNames.DESKTOP, JGYUtils.getInstance().checkAppPlatform());
.getUpdateApi().getUpdate(PackageNames.DESKTOP, JgyUtils.getInstance().checkAppPlatform());
}
Observable<BaseResponse<AppUpdateInfo>> notifyUpdateObservable = NetInterfaceManager.getInstance()
.getUpdateApi().getUpdate(PackageNames.NOTIFICATIONS, JGYUtils.getInstance().checkAppPlatform());
.getUpdateApi().getUpdate(PackageNames.NOTIFICATIONS, JgyUtils.getInstance().checkAppPlatform());
Observable<BaseResponse<AppUpdateInfo>> browserUpdateObservable = NetInterfaceManager.getInstance()
.getUpdateApi().getUpdate(PackageNames.BROWSER, JGYUtils.getInstance().checkAppPlatform());
.getUpdateApi().getUpdate(PackageNames.BROWSER, JgyUtils.getInstance().checkAppPlatform());
Observable<BaseResponse<AppUpdateInfo>> learningDesktopObservable = NetInterfaceManager.getInstance()
.getUpdateApi().getUpdate(PackageNames.LEARNING_DESKTOP, JGYUtils.getInstance().checkAppPlatform());
.getUpdateApi().getUpdate(PackageNames.LEARNING_DESKTOP, JgyUtils.getInstance().checkAppPlatform());
Observable<BaseResponse<AppUpdateInfo>> ailogUpdateObservable = NetInterfaceManager.getInstance()
.getUpdateApi().getUpdate(PackageNames.AILOG, JGYUtils.getInstance().checkAppPlatform());
.getUpdateApi().getUpdate(PackageNames.AILOG, JgyUtils.getInstance().checkAppPlatform());
Observable.zip(infoUpdateObservable, storeUpdateObservable, desktopUpdateObservable,
notifyUpdateObservable, browserUpdateObservable, ailogUpdateObservable,
@@ -988,7 +988,7 @@ public class NetInterfaceManager {
cacheHelper.put(UrlAddress.CHECK_UPDATE, jsonString);
for (AppUpdateInfo info : appUpdateInfos) {
JsonObject jsonObject = parseString(new Gson().toJson(info)).getAsJsonObject();
JGYUtils.getInstance().installAPK(jsonObject);
JgyUtils.getInstance().installAPK(jsonObject);
}
} else {
cacheHelper.put(UrlAddress.CHECK_UPDATE, "");
@@ -1015,26 +1015,26 @@ public class NetInterfaceManager {
public void checkAoleyunUpdate(BehaviorSubject<ActivityEvent> lifecycle, UpdateCallback callback) {
Observable<BaseResponse<AppUpdateInfo>> infoUpdateObservable = NetInterfaceManager.getInstance()
.getUpdateApi().getUpdate(BuildConfig.APPLICATION_ID, JGYUtils.getInstance().checkAppPlatform());
.getUpdateApi().getUpdate(BuildConfig.APPLICATION_ID, JgyUtils.getInstance().checkAppPlatform());
Observable<BaseResponse<AppUpdateInfo>> storeUpdateObservable = NetInterfaceManager.getInstance()
.getUpdateApi().getUpdate(PackageNames.APPSTORE, JGYUtils.getInstance().checkAppPlatform());
.getUpdateApi().getUpdate(PackageNames.APPSTORE, JgyUtils.getInstance().checkAppPlatform());
Observable<BaseResponse<AppUpdateInfo>> desktopUpdateObservable;
if ("Aiud_A8_ag_1095".equals(Build.MODEL)) {
if (JgyUtils.getInstance().isAiuduPlatform()) {
desktopUpdateObservable = NetInterfaceManager.getInstance()
.getUpdateApi().getUpdate(PackageNames.AIUDUDESKTOP, JGYUtils.getInstance().checkAppPlatform());
.getUpdateApi().getUpdate(PackageNames.AIUDUDESKTOP, JgyUtils.getInstance().checkAppPlatform());
} else {
desktopUpdateObservable = NetInterfaceManager.getInstance()
.getUpdateApi().getUpdate(PackageNames.DESKTOP, JGYUtils.getInstance().checkAppPlatform());
.getUpdateApi().getUpdate(PackageNames.DESKTOP, JgyUtils.getInstance().checkAppPlatform());
}
Observable<BaseResponse<AppUpdateInfo>> notifyUpdateObservable = NetInterfaceManager.getInstance()
.getUpdateApi().getUpdate(PackageNames.NOTIFICATIONS, JGYUtils.getInstance().checkAppPlatform());
.getUpdateApi().getUpdate(PackageNames.NOTIFICATIONS, JgyUtils.getInstance().checkAppPlatform());
Observable<BaseResponse<AppUpdateInfo>> browserUpdateObservable = NetInterfaceManager.getInstance()
.getUpdateApi().getUpdate(PackageNames.BROWSER, JGYUtils.getInstance().checkAppPlatform());
.getUpdateApi().getUpdate(PackageNames.BROWSER, JgyUtils.getInstance().checkAppPlatform());
Observable<BaseResponse<AppUpdateInfo>> ailogUpdateObservable = NetInterfaceManager.getInstance()
.getUpdateApi().getUpdate(PackageNames.AILOG, JGYUtils.getInstance().checkAppPlatform());
.getUpdateApi().getUpdate(PackageNames.AILOG, JgyUtils.getInstance().checkAppPlatform());
String desktop = mMMKV.decodeString(CommonConfig.DEFAULT_DESKTOP_PACKAGE);
Observable<BaseResponse<AppUpdateInfo>> learningDesktopObservable = NetInterfaceManager.getInstance()
.getUpdateApi().getUpdate(desktop, JGYUtils.getInstance().checkAppPlatform());
.getUpdateApi().getUpdate(desktop, JgyUtils.getInstance().checkAppPlatform());
Observable.zip(infoUpdateObservable, storeUpdateObservable, desktopUpdateObservable,
notifyUpdateObservable, browserUpdateObservable, learningDesktopObservable, ailogUpdateObservable,
@@ -1088,7 +1088,7 @@ public class NetInterfaceManager {
cacheHelper.put(UrlAddress.CHECK_UPDATE, jsonString);
for (AppUpdateInfo info : appUpdateInfos) {
JsonObject jsonObject = parseString(new Gson().toJson(info)).getAsJsonObject();
JGYUtils.getInstance().installAPK(jsonObject);
JgyUtils.getInstance().installAPK(jsonObject);
}
} else {
cacheHelper.put(UrlAddress.CHECK_UPDATE, "");
@@ -1118,7 +1118,7 @@ public class NetInterfaceManager {
if (appUpdateInfos == null) return;
for (AppUpdateInfo info : appUpdateInfos) {
JsonObject jsonObject = parseString(new Gson().toJson(info)).getAsJsonObject();
JGYUtils.getInstance().installAPK(jsonObject);
JgyUtils.getInstance().installAPK(jsonObject);
}
}
@@ -1143,7 +1143,7 @@ public class NetInterfaceManager {
}.getType();
List<ForceDownloadData> APPlist = gson.fromJson(jsonString, listType);
if (APPlist != null) {
JGYUtils.getInstance().installTestAPK(APPlist);
JgyUtils.getInstance().installTestAPK(APPlist);
}
callback.onComplete();
}
@@ -1165,7 +1165,7 @@ public class NetInterfaceManager {
if (listBaseResponse.code == OK) {
cacheHelper.put(UrlAddress.GET_SN_APP_TEST, GsonUtils.toJSONString(listBaseResponse.data));
List<ForceDownloadData> APPlist = listBaseResponse.data;
JGYUtils.getInstance().installTestAPK(APPlist);
JgyUtils.getInstance().installTestAPK(APPlist);
} else {
cacheHelper.put(UrlAddress.GET_SN_APP_TEST, "");
Log.e("checkTestUpdate", "onNext: " + listBaseResponse.msg);
@@ -1204,7 +1204,7 @@ public class NetInterfaceManager {
}.getType();
List<ForceDownloadData> forceDownloadDataList = gson.fromJson(jsonString, listType);
if (forceDownloadDataList != null) {
JGYUtils.getInstance().forceDownload(forceDownloadDataList);
JgyUtils.getInstance().forceDownload(forceDownloadDataList);
List<String> forceApp = forceDownloadDataList.stream().map(ForceDownloadData::getApp_package).collect(Collectors.toList());
boolean aole_force_app = Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_FORCE_APP,
String.join(",", forceApp));
@@ -1246,7 +1246,7 @@ public class NetInterfaceManager {
List<ForceDownloadData> forceDownloadData = forceDownloadBean.data;
cacheHelper.put(UrlAddress.GET_FORCE_INSTALL_LIST, GsonUtils.toJSONString(forceDownloadData));
Aria.download(this).resumeAllTask();
JGYUtils.getInstance().forceDownload(forceDownloadData);
JgyUtils.getInstance().forceDownload(forceDownloadData);
List<String> forceApp = forceDownloadData.stream().map(ForceDownloadData::getApp_package).collect(Collectors.toList());
boolean aole_force_app = Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_FORCE_APP,
String.join(",", forceApp));
@@ -1293,7 +1293,7 @@ public class NetInterfaceManager {
if (!TextUtils.isEmpty(jsonString)) {
JsonObject data = GsonUtils.getJsonObject(jsonString);
if (data != null) {
JGYUtils.getInstance().installDesktop(data);
JgyUtils.getInstance().installDesktop(data);
}
}
callback.onComplete();
@@ -1369,7 +1369,7 @@ public class NetInterfaceManager {
String jsonString = GsonUtils.toJSONString(desktopInfo);
JsonObject data = GsonUtils.getJsonObject(jsonString);
cacheHelper.put(UrlAddress.GET_DESKTOP, jsonString);
JGYUtils.getInstance().installDesktop(data);
JgyUtils.getInstance().installDesktop(data);
mMMKV.encode(CommonConfig.DEFAULT_DESKTOP_PACKAGE_NAME, desktopInfo.getApp_package());
setDefaultDesktop(desktopInfo.getApp_package());
} else {
@@ -1382,7 +1382,7 @@ public class NetInterfaceManager {
continue;
}
if ("com.aoleyunos.dop7".equals(s)) {
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.YXPD1Platform) {
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.YXPD1Platform) {
Log.e(TAG, "onNext: YXPD1 no need to uninstall");
continue;
}
@@ -1392,7 +1392,7 @@ public class NetInterfaceManager {
}
Log.e("getDefaultDesktop", "UninstallAPP: " + s);
}
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.AH6016Platform) {
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.AH6016Platform) {
PackageManager pm = mContext.getPackageManager();
try {
pm.setApplicationEnabledSetting("com.aoleyunos.dop3", PackageManager.COMPONENT_ENABLED_STATE_DEFAULT, 0);
@@ -1403,10 +1403,10 @@ public class NetInterfaceManager {
setDefaultDesktop("com.aoleyunos.dop3");
} else if (
// TODO: 2024/5/9 YXPC2的问题默认启动桌面就是他们这个需要修改去根据型号进行判断默认桌面要是易学派
JGYUtils.getInstance().checkAppPlatform() == JGYUtils.C2Platform
JgyUtils.getInstance().checkAppPlatform() == JgyUtils.C2Platform
) {
JGYUtils.getInstance().showApp(PackageNames.YIXUEPAI_DESKTOP);
JGYUtils.getInstance().setYxpDefaultDesktop();
JgyUtils.getInstance().showApp(PackageNames.YIXUEPAI_DESKTOP);
JgyUtils.getInstance().setYxpDefaultDesktop();
}
}
}
@@ -1450,7 +1450,7 @@ public class NetInterfaceManager {
if (TextUtils.isEmpty(file_url)) {
Log.e("setLogoImg", "onNext: file_url is empty");
} else {
JGYUtils.getInstance().checkBootFile(file_url, file_md5);
JgyUtils.getInstance().checkBootFile(file_url, file_md5);
}
callback.onComplete();
}
@@ -1478,11 +1478,11 @@ public class NetInterfaceManager {
if (TextUtils.isEmpty(file_url)) {
Log.e("setLogoImg", "onNext: file_url is empty");
} else {
JGYUtils.getInstance().checkBootFile(file_url, file_md5);
JgyUtils.getInstance().checkBootFile(file_url, file_md5);
}
} else {
Log.e("setLogoImg", "onNext: delete");
JGYUtils.getInstance().removeBootanimation();
JgyUtils.getInstance().removeBootanimation();
}
}
@@ -1518,9 +1518,9 @@ public class NetInterfaceManager {
int is_developer = developerBean.getIs_developer();
Log.e("getDeveloper2", "onNext: " + is_developer);
//后台1是0否 底层0是1否
JGYUtils.getInstance().setDeveloperOptions(is_developer);
JgyUtils.getInstance().setDeveloperOptions(is_developer);
} else {
JGYUtils.getInstance().setDeveloperOptions(0);
JgyUtils.getInstance().setDeveloperOptions(0);
}
}
@@ -1622,12 +1622,12 @@ public class NetInterfaceManager {
try {
// TODO: 2021/5/24 需要后端替换包名,暂时解决方案
if ("com.mediatek.camera".equals(pack)) {
JGYUtils.getInstance().hideApp("com.android.camera2");
JgyUtils.getInstance().hideApp("com.android.camera2");
}
if ("com.android.mms".equals(pack)) {
JGYUtils.getInstance().hideApp("com.android.messaging");
JgyUtils.getInstance().hideApp("com.android.messaging");
}
JGYUtils.getInstance().hideApp(pack);
JgyUtils.getInstance().hideApp(pack);
Log.e("getDesktopIcon", pack);
} catch (Exception e) {
Log.e("getDesktopIcon", "Exception: " + e.getMessage());
@@ -1678,12 +1678,12 @@ public class NetInterfaceManager {
for (String pack : newList) {
try {
if ("com.mediatek.camera".equals(pack)) {
JGYUtils.getInstance().hideApp("com.android.camera2");
JgyUtils.getInstance().hideApp("com.android.camera2");
}
if ("com.android.mms".equals(pack)) {
JGYUtils.getInstance().hideApp("com.android.messaging");
JgyUtils.getInstance().hideApp("com.android.messaging");
}
JGYUtils.getInstance().hideApp(pack);
JgyUtils.getInstance().hideApp(pack);
Log.e("getDesktopIcon", pack);
} catch (Exception e) {
Log.e("getDesktopIcon", "Exception: " + e.getMessage());
@@ -1696,7 +1696,7 @@ public class NetInterfaceManager {
} else {
cacheHelper.put(UrlAddress.GET_HIDE_DESKTOPICON, "");
}
if ("Aiud_A8_ag_1095".equals(Build.MODEL)) {
if (JgyUtils.getInstance().isAiuduPlatform()) {
ApkUtils.HideAiUDuApp();
}
}
@@ -1735,7 +1735,7 @@ public class NetInterfaceManager {
}.getType();
NetAndLaunchBean netAndLaunchBean = gson.fromJson(jsonString, type);
if (netAndLaunchBean != null) {
JGYUtils.getInstance().setNetAndlaunch(netAndLaunchBean);
JgyUtils.getInstance().setNetAndlaunch(netAndLaunchBean);
}
callback.onComplete();
}
@@ -1756,7 +1756,7 @@ public class NetInterfaceManager {
Log.e("getAppAutoStart", "onNext: " + netAndLaunchBean.toString());
if (netAndLaunchBean.getCode() == OK) {
cacheHelper.put(UrlAddress.NET_AND_LAUNCH_API, GsonUtils.toJSONString(netAndLaunchBean));
JGYUtils.getInstance().setNetAndlaunch(netAndLaunchBean);
JgyUtils.getInstance().setNetAndlaunch(netAndLaunchBean);
} else {
cacheHelper.put(UrlAddress.NET_AND_LAUNCH_API, "");
Log.e("getAppAutoStart", "onNext: " + netAndLaunchBean.toString());
@@ -1795,9 +1795,9 @@ public class NetInterfaceManager {
// }.getType();
// AppID appID = gson.fromJson(jsonString, type);
// if (appID == null) {
// JGYUtils.getInstance().writeDeselectIDtoSystem("", "");
// JgyUtils.getInstance().writeDeselectIDtoSystem("", "");
// } else {
// JGYUtils.getInstance().writeDeselectIDtoSystem(appID.getIds(), appID.getPackages());
// JgyUtils.getInstance().writeDeselectIDtoSystem(appID.getIds(), appID.getPackages());
// }
callback.onComplete();
}
@@ -1838,10 +1838,10 @@ public class NetInterfaceManager {
List<AppID> appIDList = baseResponse.data;
cacheHelper.put(UrlAddress.GET_APPID, GsonUtils.toJSONString(appIDList));
// JGYUtils.getInstance().writeDeselectIDtoSystem(appIDList);
// JgyUtils.getInstance().writeDeselectIDtoSystem(appIDList);
} else {
cacheHelper.put(UrlAddress.GET_APPID, "");
// JGYUtils.getInstance().writeDeselectIDtoSystem(null);
// JgyUtils.getInstance().writeDeselectIDtoSystem(null);
}
}
@@ -1916,7 +1916,7 @@ public class NetInterfaceManager {
if (!TextUtils.isEmpty(appString)) {
List<String> pkgs = new ArrayList<>(Arrays.asList(appString.split(",")));
for (String pkg : pkgs) {
JGYUtils.getInstance().showApp(pkg);
JgyUtils.getInstance().showApp(pkg);
}
}
@@ -1926,7 +1926,7 @@ public class NetInterfaceManager {
} else {
for (AppAttr appAttr : appAttrList) {
if (appAttr.getIs_open() == 0) {
JGYUtils.getInstance().hideApp(appAttr.getApp_package());
JgyUtils.getInstance().hideApp(appAttr.getApp_package());
}
}
String disableApp = appAttrList.stream()
@@ -1996,12 +1996,12 @@ public class NetInterfaceManager {
Log.e("setSystemSetting", "onNext: " + data);
cacheHelper.put(UrlAddress.GET_FIRMWARE, data);
//结果保存到本地
JGYUtils.getInstance().SettingSysData(data);
JgyUtils.getInstance().SettingSysData(data);
} else {
//没有数据全部关闭
// SysSettingUtils.setDisableSetting(mContext);
// SPUtils.put(mContext, "SystemSettingData", "");
JGYUtils.getInstance().SettingSysData("");
JgyUtils.getInstance().SettingSysData("");
cacheHelper.put(UrlAddress.GET_FIRMWARE, "");
//获取系统管控先不要关闭开发人员选项
// if (!BuildConfig.DEBUG) {
@@ -2015,7 +2015,7 @@ public class NetInterfaceManager {
Log.e("setSystemSetting", "onError: " + e.getMessage());
String oldData = (String) SPUtils.get(mContext, "SystemSettingData", "");
Log.e("setSystemSetting", "oldData: " + oldData);
JGYUtils.getInstance().SettingSysData(oldData);
JgyUtils.getInstance().SettingSysData(oldData);
onComplete();
}
@@ -2065,14 +2065,14 @@ public class NetInterfaceManager {
Log.e("getEBagCode", "onNext: " + baseResponse);
if (baseResponse.code == OK) {
EBagCode eBagCode = baseResponse.data;
if (JGYUtils.getInstance().checkAppPlatform() != JGYUtils.YXPD1Platform) {
if (JgyUtils.getInstance().checkAppPlatform() != JgyUtils.YXPD1Platform) {
Settings.System.putString(mContext.getContentResolver(), CommonConfig.ACTIVATIONBEAN_CODE_KEY, eBagCode.getEbagCode());
}
cacheHelper.put(UrlAddress.GET_EBAG_CODE, GsonUtils.toJSONString(eBagCode));
String ebagCode = eBagCode.getEbagCode();
SPUtils.put(mContext, "ebagCode", ebagCode);
Settings.Global.putInt(mContext.getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 1);
JGYUtils.getInstance().checkLocalExternalFiles();
JgyUtils.getInstance().checkLocalExternalFiles();
} else {
cacheHelper.put(UrlAddress.GET_EBAG_CODE, "");
Log.e("getEBagCode", "onNext: " + baseResponse.data);
@@ -2171,15 +2171,15 @@ public class NetInterfaceManager {
} else {
Log.e(TAG, "setDefaultApp: default_IME is empty");
}
JGYUtils.getInstance().setDefaultBrowser(default_IME);
JgyUtils.getInstance().setDefaultBrowser(default_IME);
String default_launcher = defaultApp.getDefault_launcher();
if (!TextUtils.isEmpty(default_launcher)) {
Log.e(TAG, "setDefaultApp: default_launcher = " + default_launcher);
mMMKV.encode(CommonConfig.DEFAULT_LAUNCHER_PACKAGE_NAME, default_launcher);
JGYUtils.getInstance().setDefaultDesktop(default_launcher);
JgyUtils.getInstance().setDefaultDesktop(default_launcher);
if (!mMMKV.decodeBool(CommonConfig.OPEN_LAUNCHER_STATUS, false)) {
ComponentName cn = new ComponentName(default_launcher, JGYUtils.getInstance().getStartClassName(default_launcher));
ComponentName cn = new ComponentName(default_launcher, JgyUtils.getInstance().getStartClassName(default_launcher));
Intent intent = new Intent();
intent.setComponent(cn);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
@@ -2197,9 +2197,9 @@ public class NetInterfaceManager {
if (TextUtils.isEmpty(desktop)) {
Log.e(TAG, "setDefaultApp: default_desktop is empty");
mMMKV.encode(CommonConfig.DEFAULT_LAUNCHER_PACKAGE_NAME, "com.aoleyun.os");
JGYUtils.getInstance().setDefaultDesktop("com.aoleyun.os");
JgyUtils.getInstance().setDefaultDesktop("com.aoleyun.os");
} else {
JGYUtils.getInstance().setDefaultDesktop(desktop);
JgyUtils.getInstance().setDefaultDesktop(desktop);
}
}
}
@@ -2223,7 +2223,7 @@ public class NetInterfaceManager {
*/
private void setDefaultDesktop(String defaultApp) {
if (!TextUtils.isEmpty(defaultApp)) {
JGYUtils.getInstance().setDefaultDesktop(defaultApp);
JgyUtils.getInstance().setDefaultDesktop(defaultApp);
// SPUtils.put(mContext, "default_launcher", defaultApp);
} else {
//如果默认桌面不为空则设置为默认桌面
@@ -2231,19 +2231,19 @@ public class NetInterfaceManager {
// String default_launcher = (String) SPUtils.get(mContext, "default_launcher", "");
Log.e("getDefaultApp", "onNext: " + default_launcher);
if (TextUtils.isEmpty(default_launcher)) {
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.YXPD1Platform) {
JGYUtils.getInstance().setDop7DefaultDesktop();
} else if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G11Platform) {
JGYUtils.getInstance().setJXWDefaultDesktop();
// } else if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.ZhanruiPlatform) {
// JGYUtils.getInstance().setJXWDefaultDesktop();
} else if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G11Platform) {
JGYUtils.getInstance().setAiuduDefaultDesktop();
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.YXPD1Platform) {
JgyUtils.getInstance().setDop7DefaultDesktop();
} else if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.G11Platform) {
JgyUtils.getInstance().setJXWDefaultDesktop();
// } else if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.ZhanruiPlatform) {
// JgyUtils.getInstance().setJXWDefaultDesktop();
} else if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.G11Platform) {
JgyUtils.getInstance().setAiuduDefaultDesktop();
} else {
JGYUtils.getInstance().setDefaultDesktop();
JgyUtils.getInstance().setDefaultDesktop();
}
} else {
JGYUtils.getInstance().setDefaultDesktop(default_launcher);
JgyUtils.getInstance().setDefaultDesktop(default_launcher);
}
}
@@ -2365,36 +2365,36 @@ public class NetInterfaceManager {
// Utils.doMasterClear(mContext);
// }
// TODO: 2024/5/9 C2 默认易学派
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.C2Platform
// || JGYUtils.getInstance().checkAppPlatform() == JGYUtils.TeclastP20sPlatform
// || JGYUtils.getInstance().checkAppPlatform() == JGYUtils.YXPD1Platform
// || JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G11Platform
// || JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MT8768Platform
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.C2Platform
// || JgyUtils.getInstance().checkAppPlatform() == JgyUtils.TeclastP20sPlatform
// || JgyUtils.getInstance().checkAppPlatform() == JgyUtils.YXPD1Platform
// || JgyUtils.getInstance().checkAppPlatform() == JgyUtils.G11Platform
// || JgyUtils.getInstance().checkAppPlatform() == JgyUtils.MT8768Platform
) {
JGYUtils.getInstance().showApp(PackageNames.YIXUEPAI_DESKTOP);
JGYUtils.getInstance().setYxpDefaultDesktop();
JgyUtils.getInstance().showApp(PackageNames.YIXUEPAI_DESKTOP);
JgyUtils.getInstance().setYxpDefaultDesktop();
}
Settings.System.putInt(mContext.getContentResolver(), JGYActions.ACTION_QCH_UNLOCK_IPAD, JGYActions.FRAME_CODE_LOCKED);
// Settings.System.putInt(mContext.getContentResolver(), CommonConfig.AOLE_APP_ALLOW_INSTALL, 0);
} else if (locked == JGYActions.NET_CODE_UNLOCKED) {
// SysSettingUtils.setEnableSetting(mContext);
JGYUtils.getInstance().writeAppPackageList();
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.TeclastP20sPlatform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.C2Platform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.YXPD1Platform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G11Platform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MT8768Platform
JgyUtils.getInstance().writeAppPackageList();
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.TeclastP20sPlatform
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.C2Platform
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.YXPD1Platform
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.G11Platform
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.MT8768Platform
) {
JGYUtils.getInstance().hideApp(PackageNames.YIXUEPAI_DESKTOP);
JGYUtils.getInstance().setDefaultDesktop();
JgyUtils.getInstance().hideApp(PackageNames.YIXUEPAI_DESKTOP);
JgyUtils.getInstance().setDefaultDesktop();
StatusBarManager mStatusBarManager = (StatusBarManager) mContext.getSystemService(Context.STATUS_BAR_SERVICE);
mStatusBarManager.disable(StatusBarManager.DISABLE_NONE);
}
Settings.System.putInt(mContext.getContentResolver(), JGYActions.ACTION_QCH_UNLOCK_IPAD, JGYActions.FRAME_CODE_UNLOCKED);
Settings.System.putInt(mContext.getContentResolver(), CommonConfig.AOLE_APP_ALLOW_INSTALL, 1);
Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID, "");
JGYUtils.getInstance().addAppInstallWhiteList(new ArrayList<>());
JGYUtils.getInstance().setAppRestriction(0);
JgyUtils.getInstance().addAppInstallWhiteList(new ArrayList<>());
JgyUtils.getInstance().setAppRestriction(0);
}
} else if (response.code == NOTFOUND) {
Settings.System.putInt(mContext.getContentResolver(), JGYActions.ACTION_QCH_UNLOCK_IPAD, JGYActions.FRAME_CODE_LOCKED);
@@ -2427,7 +2427,7 @@ public class NetInterfaceManager {
*/
public void sendMACAddress(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
macJson = (String) SPUtils.get(mContext, "macJson", "");
String macJsonString = JGYUtils.getInstance().getMacJson(mContext);
String macJsonString = JgyUtils.getInstance().getMacJson(mContext);
ConnectMode connectMode = ConnectMode.ONE_HOUR;
if (refresh) {
@@ -2592,39 +2592,43 @@ public class NetInterfaceManager {
}
public void clearAndAppendTags(Set<String> tagSets) {
JGYUtils.getInstance().getAppPlatform(platform -> {
if (platform == JGYUtils.MTKPlatform) {
tagSets.add(JGYUtils.MTKTag);
JgyUtils.getInstance().getAppPlatform(platform -> {
if (platform == JgyUtils.MTKPlatform) {
tagSets.add(JgyUtils.MTKTag);
}
// else if (platform == JGYUtils.CubePlatform) {
// tagSets.add(JGYUtils.ZhanruiTag);
// else if (platform == JgyUtils.CubePlatform) {
// tagSets.add(JgyUtils.ZhanruiTag);
// }
else if (platform == JGYUtils.ZhanruiPlatform) {
tagSets.add(JGYUtils.ZhanruiTag);
} else if (platform == JGYUtils.MTK11Platform) {
tagSets.add(JGYUtils.MTK11Tag);
} else if (platform == JGYUtils.TeclastP20sPlatform) {
tagSets.add(JGYUtils.TeclastP20sTag);
} else if (platform == JGYUtils.AH6016Platform) {
tagSets.add(JGYUtils.AH6016Tag);
} else if (platform == JGYUtils.ZR6016Platform) {
tagSets.add(JGYUtils.ZR6016Tag);
} else if (platform == JGYUtils.HRAD13Platform) {
tagSets.add(JGYUtils.HRAD13Tag);
} else if (platform == JGYUtils.G10PPlatform) {
tagSets.add(JGYUtils.G10PTag);
} else if (platform == JGYUtils.C2Platform) {
tagSets.add(JGYUtils.C2Tag);
} else if (platform == JGYUtils.YXPD1Platform) {
tagSets.add(JGYUtils.YXPD1TAG);
} else if (platform == JGYUtils.G11Platform) {
tagSets.add(JGYUtils.G11TAG);
} else if (platform == JGYUtils.MT8768Platform) {
tagSets.add(JGYUtils.MT8768Tag);
} else if (platform == JGYUtils.AUDG104Platform) {
tagSets.add(JGYUtils.AUDG104Tag);
} else if (platform == JGYUtils.HL500Platform) {
tagSets.add(JGYUtils.HL500Tag);
else if (platform == JgyUtils.ZhanruiPlatform) {
tagSets.add(JgyUtils.ZhanruiTag);
} else if (platform == JgyUtils.MTK11Platform) {
tagSets.add(JgyUtils.MTK11Tag);
} else if (platform == JgyUtils.TeclastP20sPlatform) {
tagSets.add(JgyUtils.TeclastP20sTag);
} else if (platform == JgyUtils.AH6016Platform) {
tagSets.add(JgyUtils.AH6016Tag);
} else if (platform == JgyUtils.ZR6016Platform) {
tagSets.add(JgyUtils.ZR6016Tag);
} else if (platform == JgyUtils.HRAD13Platform) {
tagSets.add(JgyUtils.HRAD13Tag);
} else if (platform == JgyUtils.G10PPlatform) {
tagSets.add(JgyUtils.G10PTag);
} else if (platform == JgyUtils.C2Platform) {
tagSets.add(JgyUtils.C2Tag);
} else if (platform == JgyUtils.YXPD1Platform) {
tagSets.add(JgyUtils.YXPD1TAG);
} else if (platform == JgyUtils.G11Platform) {
tagSets.add(JgyUtils.G11TAG);
} else if (platform == JgyUtils.MT8768Platform) {
tagSets.add(JgyUtils.MT8768Tag);
} else if (platform == JgyUtils.AUDG104Platform) {
tagSets.add(JgyUtils.AUDG104Tag);
} else if (platform == JgyUtils.HL500Platform) {
tagSets.add(JgyUtils.HL500Tag);
} else if (platform == JgyUtils.G11JPlatform) {
tagSets.add(JgyUtils.G11JTag);
}else if (platform == JgyUtils.P50Platform) {
tagSets.add(JgyUtils.P50Tag);
}
});
Log.e(TAG, "clearAndAppendTags: " + tagSets);
@@ -3070,7 +3074,7 @@ public class NetInterfaceManager {
HashSet<String> labels = new HashSet<>(Arrays.asList(labelpage.split(",")));
// List<String> urlList = new ArrayList<>();
// for (String urls : labels) {
// urlList.add(JGYUtils.getPrefixHttpsURL(urls));
// urlList.add(JgyUtils.getPrefixHttpsURL(urls));
// }
String join = String.join(",", labels);
Log.e("getHomePageBookmarks", "onNext: getHomePageBookmarks: " + join);
@@ -3087,7 +3091,7 @@ public class NetInterfaceManager {
.setPackage("com.android.browser");
}
if (!TextUtils.isEmpty(homepagURL)) {
// String newHomePage = JGYUtils.getPrefixHttpsURL(homepagURL);
// String newHomePage = JgyUtils.getPrefixHttpsURL(homepagURL);
Log.e("getHomePageBookmarks", "onNext: newHomePage: " + homepagURL);
homepag.putExtra("homepage", homepagURL);
} else {
@@ -3167,7 +3171,7 @@ public class NetInterfaceManager {
public void getScreenLockState(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, ScreenLockStateListener listener) {
int locked = Settings.System.getInt(mContext.getContentResolver(), JGYActions.ACTION_QCH_UNLOCK_IPAD, JGYActions.FRAME_CODE_LOCKED);
if (JGYUtils.isOfficialVersion() || locked == JGYActions.FRAME_CODE_UNLOCKED) {
if (JgyUtils.isOfficialVersion() || locked == JGYActions.FRAME_CODE_UNLOCKED) {
listener.setScreenLockState(false, "");
return;
}
@@ -3323,15 +3327,15 @@ public class NetInterfaceManager {
Log.e("getAppLimitList", "onNext: " + strings);
if (strings.size() == 0) {
Settings.System.putString(mContext.getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST, "");
JGYUtils.getInstance().writeAppPackageList();
JgyUtils.getInstance().writeAppPackageList();
cacheHelper.put(UrlAddress.SET_WHITE_PACKAGE_LIST, "");
} else {
String pkgString = String.join(",", strings);
cacheHelper.put(UrlAddress.SET_WHITE_PACKAGE_LIST, GsonUtils.toJSONString(strings));
//开机图标 只记录后台传的包名
Log.e(TAG, "onNext: only_jgy_shortcut_list: " + Settings.System.putString(mContext.getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST, pkgString));
JGYUtils.getInstance().writeAppPackageList(pkgString);
JGYUtils.getInstance().deleteOtherApp();
JgyUtils.getInstance().writeAppPackageList(pkgString);
JgyUtils.getInstance().deleteOtherApp();
}
}
@@ -3366,11 +3370,11 @@ public class NetInterfaceManager {
String result = appLimit.getResult();
//开机图标 只记录后台传的包名
Log.e(TAG, "onNext: only_jgy_shortcut_list: " + Settings.System.putString(mContext.getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST, result));
JGYUtils.getInstance().writeAppPackageList(result);
JGYUtils.getInstance().deleteOtherApp();
JgyUtils.getInstance().writeAppPackageList(result);
JgyUtils.getInstance().deleteOtherApp();
} else {
Settings.System.putString(mContext.getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST, "");
JGYUtils.getInstance().writeAppPackageList();
JgyUtils.getInstance().writeAppPackageList();
cacheHelper.put(UrlAddress.SET_WHITE_PACKAGE_LIST, "");
Log.e("getAppLimit", "onNext: " + baseResponse);
}
@@ -3557,7 +3561,7 @@ public class NetInterfaceManager {
}
public void getAppinsideWeb(GetAppinsideWebCallback callback) {
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MTKPlatform) {
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.MTKPlatform) {
Log.e(TAG, "getAppinsideWeb: " + "setAppinsideWeb");
setAppinsideWeb(callback);
} else {
@@ -3578,7 +3582,7 @@ public class NetInterfaceManager {
@Override
public void onNext(@NonNull BaseResponse<List<Appground>> listBaseResponse) {
Log.e("setAppinsideWeb", "onNext: " + listBaseResponse);
JGYUtils.getInstance().setAppinsideWeb(listBaseResponse);
JgyUtils.getInstance().setAppinsideWeb(listBaseResponse);
}
@Override
@@ -3608,7 +3612,7 @@ public class NetInterfaceManager {
public void onNext(@NonNull BaseResponse listBaseResponse) {
Log.e("getNewAppinsideWeb", "onNext: " + listBaseResponse);
long time1 = System.currentTimeMillis();
JGYUtils.getInstance().setNewAppinsideWeb(listBaseResponse);
JgyUtils.getInstance().setNewAppinsideWeb(listBaseResponse);
Log.e(TAG, "setWhiteApp: time = " + (System.currentTimeMillis() - time1));
}
@@ -3676,7 +3680,7 @@ public class NetInterfaceManager {
ForegroundAppUtil.openTopApp(mContext);
} else {
if ("YX-T01".equalsIgnoreCase(Build.MODEL)) {
JGYUtils.getInstance().setTongyiAppTop();
JgyUtils.getInstance().setTongyiAppTop();
} else {
cacheHelper.put(UrlAddress.GET_TOP_APP_CONTROL, "");
ForegroundAppUtil.setTopAppClass(mContext, "");
@@ -3715,7 +3719,7 @@ public class NetInterfaceManager {
public void onNext(@NonNull NetAndLaunchBean netAndLaunchBean) {
Log.e("getAutoUpdateAndNet", "onNext: " + netAndLaunchBean.toString());
if (netAndLaunchBean.getCode() == 200) {
JGYUtils.getInstance().setNetAndlaunch(netAndLaunchBean, appListInfos);
JgyUtils.getInstance().setNetAndlaunch(netAndLaunchBean, appListInfos);
} else {
Log.e("getAutoUpdateAndNet", "onNext: " + netAndLaunchBean.toString());
}
@@ -3748,7 +3752,7 @@ public class NetInterfaceManager {
public void onNext(@NonNull NetAndLaunchBean netAndLaunchBean) {
Log.e("getNetAndLaunchSetting", "onNext: " + netAndLaunchBean.toString());
if (netAndLaunchBean.getCode() == 200) {
JGYUtils.getInstance().setNetAndlaunch(netAndLaunchBean);
JgyUtils.getInstance().setNetAndlaunch(netAndLaunchBean);
} else {
Log.e("getNetAndLaunchSetting", "onNext: " + netAndLaunchBean.toString());
}
@@ -4342,7 +4346,7 @@ public class NetInterfaceManager {
@Override
public void onComplete() {
Log.e("getCloudLessonSettings", "onComplete: ");
JGYUtils.getInstance().refresh();
JgyUtils.getInstance().refresh();
if (callback != null) {
callback.onComplete();
}
@@ -4530,7 +4534,7 @@ public class NetInterfaceManager {
if (baseResponse.code == 200) {
Wallpaper wallpaper = baseResponse.data;
String url = wallpaper.getFile_url();
JGYUtils.getInstance().setWallpaper(url);
JgyUtils.getInstance().setWallpaper(url);
} else {
mMMKV.encode(CommonConfig.WALLPAPER_URL_KEY, "");
}

View File

@@ -3,7 +3,7 @@ package com.aoleyun.sn.network.interceptor;
import android.text.TextUtils;
import com.aoleyun.sn.disklrucache.DiskLruCacheHelper;
import com.aoleyun.sn.utils.JGYUtils;
import com.aoleyun.sn.utils.JgyUtils;
import com.blankj.utilcode.util.LogUtils;
import java.io.IOException;
@@ -62,7 +62,7 @@ public class PostCacheInterceptor implements Interceptor {
}
//没有网络连接的时候读取缓存
if (!JGYUtils.getInstance().isNetworkConnected()) {
if (!JgyUtils.getInstance().isNetworkConnected()) {
LogUtils.d("no network connected jujge cache available");
if (cacheResponse != null) {
LogUtils.d("no network connected, return cache " + cacheResponse);

View File

@@ -47,7 +47,7 @@ import com.aoleyun.sn.utils.CacheUtils;
import com.aoleyun.sn.utils.Camera2BackgroundUtil;
import com.aoleyun.sn.utils.CmdUtil;
import com.aoleyun.sn.utils.ForegroundAppUtil;
import com.aoleyun.sn.utils.JGYUtils;
import com.aoleyun.sn.utils.JgyUtils;
import com.aoleyun.sn.utils.MySQLData;
import com.aoleyun.sn.utils.SPUtils;
import com.aoleyun.sn.utils.ServiceAliveUtils;
@@ -270,8 +270,8 @@ public class PushManager {
case MSG_SETTING:
Toaster.debugShow("收到管控:系统设置");
if (!TextUtils.isEmpty(extras)) {
JGYUtils.getInstance().SettingSysData(extras);
// JGYUtils.getInstance().removeAllTask();
JgyUtils.getInstance().SettingSysData(extras);
// JgyUtils.getInstance().removeAllTask();
}
break;
case MSG_BROWSER:
@@ -292,12 +292,12 @@ public class PushManager {
break;
case MSG_RESET:
Toaster.debugShow("收到管控:设备重置");
JGYUtils.getInstance().cleanAoleLauncher3Cache();
JgyUtils.getInstance().cleanAoleLauncher3Cache();
Utils.doMasterClear(mContext);
Aria.download(this).removeAllTask(true);
mMMKV.clearAll();
JGYUtils.getInstance().cleanAoleAppCache();
JGYUtils.getInstance().wakeUpAoleyunAPP();
JgyUtils.getInstance().cleanAoleAppCache();
JgyUtils.getInstance().wakeUpAoleyunAPP();
NetInterfaceManager.getInstance().setPushTags();
sendRefreshBroadcast(mContext);
@@ -336,7 +336,7 @@ public class PushManager {
break;
case GET_FORCEDOWNLOADURL:
Toaster.debugShow("收到管控:应用强制安装");
File file = new File(JGYUtils.getInstance().getDownLoadPath());
File file = new File(JgyUtils.getInstance().getDownLoadPath());
if (!file.exists()) {
file.mkdirs();
}
@@ -507,7 +507,7 @@ public class PushManager {
Toaster.debugShow("收到管控:停止应用");
JsonObject killJSONObject = GsonUtils.getJsonObject(extras);
String packages = killJSONObject.get("package_name").getAsString();
JGYUtils.getInstance().killBackgroundProcesses(packages);
JgyUtils.getInstance().killBackgroundProcesses(packages);
break;
case TIME_CONTROL:
Toaster.debugShow("收到管控:使用时间管控");
@@ -545,7 +545,7 @@ public class PushManager {
case EBAG_CODE:
Toaster.debugShow("收到管控:电子书包激活码");
setEbagCode(extras);
JGYUtils.getInstance().killBackgroundProcesses("com.jxw.launcher");
JgyUtils.getInstance().killBackgroundProcesses("com.jxw.launcher");
break;
case UPDATE_WHITELIST:
Toaster.debugShow("收到管控:更新白名单");
@@ -555,7 +555,7 @@ public class PushManager {
Toaster.debugShow("收到管控:更换批次不恢复出厂设置");
NetInterfaceManager.getInstance().setPushTags();
Aria.download(this).removeAllTask(true);
JGYUtils.getInstance().cleanAoleAppCache();
JgyUtils.getInstance().cleanAoleAppCache();
try {
new CacheUtils().cleanApplicationUserData(mContext, "com.android.browser");
} catch (Exception e) {
@@ -568,7 +568,7 @@ public class PushManager {
NetInterfaceManager.getInstance().getWiFiPasswd();
break;
case DEVICES_SHUTDOWN_NOW:
JGYUtils.getInstance().shutdown();
JgyUtils.getInstance().shutdown();
break;
case DEVICES_POWEROFF:
NetInterfaceManager.getInstance().getPoweroffTime();
@@ -580,7 +580,7 @@ public class PushManager {
customOrder(extras);
break;
case CLEAN_MEMORY:
JGYUtils.getInstance().cleanBackgroundMemory();
JgyUtils.getInstance().cleanBackgroundMemory();
break;
case SN_LOG_SETTING:
senSNLogFile(extras);
@@ -689,7 +689,7 @@ public class PushManager {
// intent.setComponent(componentName);
// intent.setAction(CommonConfig.FOCUS_MODE_REFRESH_KEY);
// mContext.sendBroadcast(intent);
JGYUtils.getInstance().gotoLauncher();
JgyUtils.getInstance().gotoLauncher();
NetInterfaceManager.getInstance().getCloudLessonSettings();
}
@@ -730,7 +730,7 @@ public class PushManager {
String packages = jsonObject.get("package").getAsString();
int is_open = jsonObject.get("is_open").getAsInt();
if (is_open == 0) {
JGYUtils.getInstance().killBackgroundProcesses(packages);
JgyUtils.getInstance().killBackgroundProcesses(packages);
}
} catch (Exception e) {
Log.e(TAG, "disableApp: " + e.getMessage());
@@ -757,7 +757,7 @@ public class PushManager {
}
private void doDownloadAndInstall(String jsonString) {
File file = new File(JGYUtils.getInstance().getDownLoadPath());
File file = new File(JgyUtils.getInstance().getDownLoadPath());
if (!file.exists()) {
file.mkdirs();
}
@@ -907,7 +907,7 @@ public class PushManager {
String allow = jSONObject.get("not").getAsString();
HashSet<String> disallowApp = new HashSet<>(Arrays.asList(disallow.split(",")));
HashSet<String> allowApp = new HashSet<>(Arrays.asList(allow.split(",")));
JGYUtils.getInstance().setAppNetwork(disallowApp, allowApp);
JgyUtils.getInstance().setAppNetwork(disallowApp, allowApp);
}
private void settingPowerOn(String s) {
@@ -974,8 +974,8 @@ public class PushManager {
// JsonObject jSONObject = GsonUtils.getJsonObject(s);
// long createTime = jSONObject.getLong("createTime");
long createTime = System.currentTimeMillis() / 1000;
PowerManager.WakeLock mWakeLock = JGYUtils.acquireWakeLock(mContext, 60 * 1000);
JGYUtils.release(mWakeLock);
PowerManager.WakeLock mWakeLock = JgyUtils.acquireWakeLock(mContext, 60 * 1000);
JgyUtils.release(mWakeLock);
if (createTime != 0) {
Log.e("createTime", String.valueOf(createTime));
Handler.getMain().postDelayed(new Runnable() {
@@ -1115,27 +1115,27 @@ public class PushManager {
if (type == 1) {
String file_url = jsonObject.get("file_url").getAsString();
String file_md5 = jsonObject.get("file_md5").getAsString();
JGYUtils.getInstance().checkBootFile(file_url, file_md5);
JgyUtils.getInstance().checkBootFile(file_url, file_md5);
} else {
JGYUtils.getInstance().removeBootanimation();
JgyUtils.getInstance().removeBootanimation();
}
}
private void setDefalutApp(String extras) {
if (TextUtils.isEmpty(extras)) {
JGYUtils.getInstance().setDefaultDesktop("");
JGYUtils.getInstance().openLauncher3();
JgyUtils.getInstance().setDefaultDesktop("");
JgyUtils.getInstance().openLauncher3();
} else {
JsonObject jsonObject = GsonUtils.getJsonObject(extras);
JsonElement launcherElement = jsonObject.get("default_launcher");
if (launcherElement.isJsonNull() || TextUtils.isEmpty(launcherElement.getAsString())) {
JGYUtils.getInstance().setDefaultDesktop("");
JgyUtils.getInstance().setDefaultDesktop("");
mMMKV.encode(CommonConfig.DEFAULT_LAUNCHER_PACKAGE_NAME, "");
JGYUtils.getInstance().openLauncher3();
JgyUtils.getInstance().openLauncher3();
} else {
String default_launcher = launcherElement.getAsString();
JGYUtils.getInstance().setDefaultDesktop(default_launcher);
ComponentName cn = new ComponentName(default_launcher, JGYUtils.getInstance().getStartClassName(default_launcher));
JgyUtils.getInstance().setDefaultDesktop(default_launcher);
ComponentName cn = new ComponentName(default_launcher, JgyUtils.getInstance().getStartClassName(default_launcher));
Intent intent = new Intent();
intent.setComponent(cn);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
@@ -1240,7 +1240,7 @@ public class PushManager {
int is_developer = jsonObject.get("is_developer").getAsInt();
Log.e(TAG + ":" + "getDeveloper", "onNext: " + is_developer);
Log.e(TAG, "setDeveloperoptions: " + is_developer);
JGYUtils.getInstance().setDeveloperOptions(is_developer);
JgyUtils.getInstance().setDeveloperOptions(is_developer);
}
private void GlobalUpdate(String jsonString) {
@@ -1249,7 +1249,7 @@ public class PushManager {
}
JsonObject jsonObject = GsonUtils.getJsonObject(jsonString);
String platform = jsonObject.get("platform").getAsString();
if (JGYUtils.getInstance().isSamePlatform(platform)) {
if (JgyUtils.getInstance().isSamePlatform(platform)) {
checkAPPInstall(jsonObject);
} else {
Log.e(TAG, "GlobalUpdate: " + "应用与app平台不符合");
@@ -1285,13 +1285,13 @@ public class PushManager {
if (TextUtils.isEmpty(ebagCode)) {
Log.e(TAG, "setEbagCode: " + "ebagCode is empty");
SPUtils.put(mContext, "ebagCode", "");
if (JGYUtils.getInstance().checkAppPlatform() != JGYUtils.YXPD1Platform) {
if (JgyUtils.getInstance().checkAppPlatform() != JgyUtils.YXPD1Platform) {
Settings.System.putString(mContext.getContentResolver(), CommonConfig.ACTIVATIONBEAN_CODE_KEY, "");
Settings.Global.putInt(mContext.getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 0);
}
} else {
SPUtils.put(mContext, "ebagCode", ebagCode);
if (JGYUtils.getInstance().checkAppPlatform() != JGYUtils.YXPD1Platform) {
if (JgyUtils.getInstance().checkAppPlatform() != JgyUtils.YXPD1Platform) {
Settings.System.putString(mContext.getContentResolver(), CommonConfig.ACTIVATIONBEAN_CODE_KEY, ebagCode);
Settings.Global.putInt(mContext.getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 1);
}
@@ -1357,7 +1357,7 @@ public class PushManager {
Log.e(TAG, "orderDeleteApp: pkgs = " + pkgs);
mMMKV.encode(DEBUG_APP_LIST, pkgs);
if (ApkUtils.isSystemApp(mContext, pkg)) {
JGYUtils.getInstance().hideApp(pkg);
JgyUtils.getInstance().hideApp(pkg);
} else {
ApkUtils.UninstallAPP(mContext, pkg);
}
@@ -1529,4 +1529,5 @@ public class PushManager {
String app_package = jsonObject.get("app_package").getAsString();
ApkUtils.openPackage(mContext, app_package);
}
}

View File

@@ -9,7 +9,7 @@ import com.aoleyun.sn.comm.CommonConfig;
import com.aoleyun.sn.manager.ConnectManager;
import com.aoleyun.sn.rlog.LogDBManager;
import com.aoleyun.sn.utils.BootManager;
import com.aoleyun.sn.utils.JGYUtils;
import com.aoleyun.sn.utils.JgyUtils;
import com.aoleyun.sn.utils.SPUtils;
import com.aoleyun.sn.utils.TimeUtils;
import com.tencent.mmkv.MMKV;
@@ -84,8 +84,8 @@ public class BootReceiver extends BroadcastReceiver {
// checkNetintent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// context.startActivity(checkNetintent);
}
JGYUtils.startServices(context);
JGYUtils.getInstance().onBootOpenApp();
JgyUtils.startServices(context);
JgyUtils.getInstance().onBootOpenApp();
new BootManager(context).start();
break;
case BOOT_COMPLETED:
@@ -112,7 +112,7 @@ public class BootReceiver extends BroadcastReceiver {
// case "android.intent.action.MEDIA_REMOVED":
// case "android.intent.action.MEDIA_BAD_REMOVAL":
//除了USER_PRESENT应该都收不到
JGYUtils.startServices(context);
JgyUtils.startServices(context);
break;
}
}

View File

@@ -11,8 +11,7 @@ import android.util.Log;
import com.aoleyun.sn.comm.PackageNames;
import com.aoleyun.sn.network.NetInterfaceManager;
import com.aoleyun.sn.utils.ApkUtils;
import com.aoleyun.sn.utils.JGYUtils;
import com.aoleyun.sn.utils.SPUtils;
import com.aoleyun.sn.utils.JgyUtils;
import java.util.concurrent.TimeUnit;
@@ -40,7 +39,7 @@ public class NewAppReceiver extends BroadcastReceiver {
public void onReceive(Context context, Intent intent) {
mContext = context;
String action = intent.getAction();
JGYUtils.getInstance().cleanLauncherCache();
JgyUtils.getInstance().cleanLauncherCache();
Log.e(TAG, "onReceive: " + "action = " + action);
String state;
if (TextUtils.isEmpty(action)) {
@@ -54,7 +53,7 @@ public class NewAppReceiver extends BroadcastReceiver {
checkDefaultDesktop(packageName);
break;
case Intent.ACTION_PACKAGE_REPLACED:
// JGYUtils.getInstance().cleanLauncher3Cache();
// JgyUtils.getInstance().cleanLauncher3Cache();
state = "重装了:";
break;
case Intent.ACTION_PACKAGE_REMOVED:
@@ -71,7 +70,7 @@ public class NewAppReceiver extends BroadcastReceiver {
ApkUtils.addShortcut(context);
ApkUtils.RemoveTask(context, packageName);
}
JGYUtils.getInstance().wakeUpAoleyunAPP();
JgyUtils.getInstance().wakeUpAoleyunAPP();
//启动教官壹
}
newAppListener.setNewAppListener(packageName);
@@ -103,7 +102,7 @@ public class NewAppReceiver extends BroadcastReceiver {
@Override
public void onNext(@NonNull String s) {
Log.e("sendAppInfo", "onNext: " + s);
// JGYUtils.getInstance().checkForceDownload();
// JgyUtils.getInstance().checkForceDownload();
NetInterfaceManager.getInstance().getForceDownload();
NetInterfaceManager.getInstance().getAppLimit();
NetInterfaceManager.getInstance().getDefaultDesktop();
@@ -146,15 +145,15 @@ public class NewAppReceiver extends BroadcastReceiver {
@Override
public void onNext(@NonNull String pkg) {
Log.e("setLauncher", "onNext: " + pkg);
JGYUtils.getInstance().setAllowPermissionsPackage();
JGYUtils.getInstance().checkDefaultDesktop(pkg);
String oldDesktop = JGYUtils.getInstance().getDefaultDesktop();
JgyUtils.getInstance().setAllowPermissionsPackage();
JgyUtils.getInstance().checkDefaultDesktop(pkg);
String oldDesktop = JgyUtils.getInstance().getDefaultDesktop();
// String oldDesktop = (String) SPUtils.get(mContext, "default_launcher", "");
Log.e("setLauncher", "onNext: oldDesktop = " + oldDesktop);
if (pkg.equals(oldDesktop)) {
ApkUtils.openPackage(mContext, pkg);
}
JGYUtils.getInstance().updateNetworkWhiteList();
JgyUtils.getInstance().updateNetworkWhiteList();
}
@Override

View File

@@ -14,7 +14,6 @@ import android.os.IBinder;
import android.os.SystemClock;
import android.provider.Settings;
import android.text.TextUtils;
import android.text.format.Formatter;
import android.util.Log;
import androidx.annotation.Nullable;
@@ -25,18 +24,16 @@ import com.aoleyun.sn.R;
import com.aoleyun.sn.bean.BaseResponse;
import com.aoleyun.sn.bean.DownloadTaskInfo;
import com.aoleyun.sn.comm.CommonConfig;
import com.aoleyun.sn.comm.PackageNames;
import com.aoleyun.sn.gson.GsonUtils;
import com.aoleyun.sn.manager.MapManager;
import com.aoleyun.sn.network.NetInterfaceManager;
import com.aoleyun.sn.network.api.post.SendScreenStatusApi;
import com.aoleyun.sn.receiver.BootReceiver;
import com.aoleyun.sn.receiver.NewAppReceiver;
import com.aoleyun.sn.rlog.LogDBManager;
import com.aoleyun.sn.service.main.MainService;
import com.aoleyun.sn.utils.ApkUtils;
import com.aoleyun.sn.utils.CmdUtil;
import com.aoleyun.sn.utils.JGYUtils;
import com.aoleyun.sn.utils.JgyUtils;
import com.aoleyun.sn.utils.SPUtils;
import com.aoleyun.sn.utils.ServiceAliveUtils;
import com.aoleyun.sn.utils.TimeUtils;
@@ -214,7 +211,7 @@ public class GuardService extends Service {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
// 8.0之后需要在
registmNewAppReceiver();
JGYUtils.startServices(GuardService.this);
JgyUtils.startServices(GuardService.this);
}
registerPresentReceiver();
registerBatteryReceiver();
@@ -304,8 +301,8 @@ public class GuardService extends Service {
// // 启动发送广播
// sendBroadcast(intent1);
JGYUtils.startServices(GuardService.this);
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.ZhanruiPlatform) {
JgyUtils.startServices(GuardService.this);
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.ZhanruiPlatform) {
int setting_statusbar = Settings.System.getInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR, 0);
String statusbarStatus = "";
if (setting_statusbar == 0) {
@@ -331,8 +328,8 @@ public class GuardService extends Service {
long time = System.currentTimeMillis();
getLockState("1", String.valueOf(time));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
// JGYUtils.getInstance().wakeUpAoleyunAPP();
JGYUtils.getInstance().deleteScreenshots();
// JgyUtils.getInstance().wakeUpAoleyunAPP();
JgyUtils.getInstance().deleteScreenshots();
}
// sendScreenStatus(2);
}
@@ -420,7 +417,7 @@ public class GuardService extends Service {
* @param time 和锁屏状态无关,记录设备使用时长的
*/
private void getLockState(String status, String time) {
if (JGYUtils.isOfficialVersion() || JGYUtils.getInstance().tagEmpty()) {
if (JgyUtils.isOfficialVersion() || JgyUtils.getInstance().tagEmpty()) {
return;
}
NetInterfaceManager.getInstance()
@@ -494,21 +491,21 @@ public class GuardService extends Service {
} else {
if (Intent.ACTION_POWER_CONNECTED.equals(action)) {
LogDBManager.getInstance().creatOtherLog(LogDBManager.LOG_EVENT_BATTERY,
"开始充电", "electricity: " + JGYUtils.getInstance().getBatteryLevel() + "%");
"开始充电", "electricity: " + JgyUtils.getInstance().getBatteryLevel() + "%");
}
if (Intent.ACTION_POWER_DISCONNECTED.equals(action)) {
LogDBManager.getInstance().creatOtherLog(LogDBManager.LOG_EVENT_BATTERY,
"停止充电", "electricity: " + JGYUtils.getInstance().getBatteryLevel() + "%");
"停止充电", "electricity: " + JgyUtils.getInstance().getBatteryLevel() + "%");
}
if (Intent.ACTION_BATTERY_LOW.equals(action)) {
LogDBManager.getInstance().creatOtherLog(LogDBManager.LOG_EVENT_BATTERY,
"电量偏低", "electricity: " + JGYUtils.getInstance().getBatteryLevel() + "%");
"电量偏低", "electricity: " + JgyUtils.getInstance().getBatteryLevel() + "%");
}
if (Intent.ACTION_BATTERY_OKAY.equals(action)) {
LogDBManager.getInstance().creatOtherLog(LogDBManager.LOG_EVENT_BATTERY,
"电量充足", "electricity: " + JGYUtils.getInstance().getBatteryLevel() + "%");
"电量充足", "electricity: " + JgyUtils.getInstance().getBatteryLevel() + "%");
}
recordBattery("电量充足\t" + "electricity: " + JGYUtils.getInstance().getBatteryLevel() + "%");
recordBattery("电量充足\t" + "electricity: " + JgyUtils.getInstance().getBatteryLevel() + "%");
setDefaultUSBStatus();
Log.e(TAG, action);
start.onstar(SystemClock.elapsedRealtime());
@@ -841,7 +838,7 @@ public class GuardService extends Service {
}
}
Intent usbIntent = new Intent(usbStatus);
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.TeclastP20sPlatform) {
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.TeclastP20sPlatform) {
usbIntent.setPackage("com.android.settings");
}
sendBroadcast(usbIntent);
@@ -891,7 +888,7 @@ public class GuardService extends Service {
}
} else if (filepath.endsWith(".zip")) {
Log.e("taskComplete", "开机动画下载完成:" + task.getPercent() + ":" + task.getExtendField());
JGYUtils.getInstance().setBootanimationG10J(task.getFilePath());
JgyUtils.getInstance().setBootanimationG10J(task.getFilePath());
}
}

View File

@@ -13,8 +13,7 @@ import com.aoleyun.sn.comm.CommonConfig;
import com.aoleyun.sn.comm.PackageNames;
import com.aoleyun.sn.utils.CacheUtils;
import com.aoleyun.sn.utils.ForegroundAppUtil;
import com.aoleyun.sn.utils.JGYUtils;
import com.aoleyun.sn.utils.SPUtils;
import com.aoleyun.sn.utils.JgyUtils;
import com.aoleyun.sn.utils.Utils;
import com.tencent.mmkv.MMKV;
@@ -54,13 +53,13 @@ public class RemoteService extends Service {
@Override
public List<String> getHideIcon() throws RemoteException {
List<String> hide = JGYUtils.getInstance().getHidePackage();
List<String> hide = JgyUtils.getInstance().getHidePackage();
return hide;
}
@Override
public List<String> getDisableIcon() throws RemoteException {
List<String> disable = JGYUtils.getInstance().getDisablePackage();
List<String> disable = JgyUtils.getInstance().getDisablePackage();
return disable;
}
@@ -82,9 +81,9 @@ public class RemoteService extends Service {
Log.e(TAG, "setDefaultDesktop: " + "pkg = " + pkg);
// SPUtils.put(RemoteService.this, "default_launcher", pkg);
mMMKV.encode(CommonConfig.DEFAULT_LAUNCHER_PACKAGE_NAME, pkg);
JGYUtils.getInstance().setDefaultDesktop(pkg);
JgyUtils.getInstance().setDefaultDesktop(pkg);
if (PackageNames.DESKTOP.equals(pkg)) {
// JGYUtils.getInstance().killPackage(PackageNames.DESKTOP);
// JgyUtils.getInstance().killPackage(PackageNames.DESKTOP);
try {
new CacheUtils().cleanApplicationUserData(RemoteService.this, PackageNames.DESKTOP);
new CacheUtils().cleanApplicationUserData(RemoteService.this, PackageNames.APPSTORE);
@@ -93,7 +92,7 @@ public class RemoteService extends Service {
Log.e(TAG, "onReceive: " + e.getMessage());
e.printStackTrace();
}
JGYUtils.getInstance().killPackage("com.aoleyunos.dop2");
JgyUtils.getInstance().killPackage("com.aoleyunos.dop2");
}
}

View File

@@ -17,7 +17,7 @@ import android.util.Log;
import androidx.annotation.Nullable;
import com.aoleyun.sn.BuildConfig;
import com.aoleyun.sn.utils.JGYUtils;
import com.aoleyun.sn.utils.JgyUtils;
import com.blankj.utilcode.util.NetworkUtils;
import com.aoleyun.sn.KeepAliveConnection;
import com.aoleyun.sn.utils.ServiceAliveUtils;
@@ -187,7 +187,7 @@ public class StepService extends Service implements NetworkUtils.OnNetworkStatus
Log.i("JWebSocketClientService", "websocket连接关闭");
// client.close();
// initSocketClient();
if (JGYUtils.getInstance().isScreenOn()) {
if (JgyUtils.getInstance().isScreenOn()) {
mHandler.postDelayed(heartBeatRunnable, HEART_BEAT_RATE);//开启心跳检测
}
}
@@ -198,7 +198,7 @@ public class StepService extends Service implements NetworkUtils.OnNetworkStatus
Log.i("JWebSocketClientService", "websocket连接错误:" + ex.getMessage());
// client.close();
// initSocketClient();
if (JGYUtils.getInstance().isScreenOn()) {
if (JgyUtils.getInstance().isScreenOn()) {
mHandler.postDelayed(heartBeatRunnable, HEART_BEAT_RATE);//开启心跳检测
} else {
Log.i("JWebSocketClientService", "postDelayed off");
@@ -290,7 +290,7 @@ public class StepService extends Service implements NetworkUtils.OnNetworkStatus
sendMsg();
} else if (client.isClosed()) {
Log.i("JWebSocketClientService", "websocket重连中");
if (JGYUtils.getInstance().isScreenOn()) {
if (JgyUtils.getInstance().isScreenOn()) {
reconnectWs();
} else {
Log.i("JWebSocketClientService", "reconnectWs off");
@@ -302,7 +302,7 @@ public class StepService extends Service implements NetworkUtils.OnNetworkStatus
initSocketClient();
}
//每隔一定的时间,对长连接进行一次心跳检测
if (JGYUtils.getInstance().isScreenOn()) {
if (JgyUtils.getInstance().isScreenOn()) {
mHandler.postDelayed(this, HEART_BEAT_RATE);
} else {
Log.i("JWebSocketClientService", "websocket息屏不重连");

View File

@@ -17,7 +17,7 @@ import com.aoleyun.sn.comm.JGYActions;
import com.aoleyun.sn.disklrucache.CacheHelper;
import com.aoleyun.sn.network.NetInterfaceManager;
import com.aoleyun.sn.network.UrlAddress;
import com.aoleyun.sn.utils.JGYUtils;
import com.aoleyun.sn.utils.JgyUtils;
import com.aoleyun.sn.utils.SPUtils;
import com.aoleyun.sn.utils.URLUtils;
import com.aoleyun.sn.utils.Utils;
@@ -86,7 +86,7 @@ public class MainSPresenter implements MainSContact.Presenter {
@Override
public void getLockedState() {
Log.e(TAG, "getLockedState: ");
if (JGYUtils.getInstance().isAihuaFramwwork()) {
if (JgyUtils.getInstance().isAihuaFramwwork()) {
int aihuaUnlock = Settings.System.getInt(mContext.getContentResolver(), CommonConfig.AIHUA_UNLOCK, 0);
if (aihuaUnlock == 1) {
return;
@@ -100,7 +100,7 @@ public class MainSPresenter implements MainSContact.Presenter {
int locked = Settings.System.getInt(crv, JGYActions.ACTION_QCH_UNLOCK_IPAD, JGYActions.FRAME_CODE_LOCKED);
Log.e("getLockedState", "locked: " + locked);
if (locked == 0) {
JGYUtils.getInstance().deleteOtherApp();
JgyUtils.getInstance().deleteOtherApp();
}
mView.setLockedState(locked == JGYActions.FRAME_CODE_LOCKED);
}
@@ -193,7 +193,7 @@ public class MainSPresenter implements MainSContact.Presenter {
public void onNext(@NonNull BaseResponse baseResponse) {
Log.e("sendNetwork", "onNext: " + baseResponse);
if (baseResponse.code == 200) {
JGYUtils.getInstance().removeNetworkConnectedTime(time);
JgyUtils.getInstance().removeNetworkConnectedTime(time);
} else {
}
@@ -229,10 +229,10 @@ public class MainSPresenter implements MainSContact.Presenter {
@Override
public void updateDeviceInfo() {
if (JGYUtils.isOfficialVersion()) {
if (JgyUtils.isOfficialVersion()) {
mView.updateDeviceInfoFinish();
}
if (!JGYUtils.getInstance().tagEmpty()) {
if (!JgyUtils.getInstance().tagEmpty()) {
NetInterfaceManager.getInstance().updateDeviceInfo(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
@Override
public void onComplete() {
@@ -247,7 +247,7 @@ public class MainSPresenter implements MainSContact.Presenter {
*/
@Override
public void sendInstalled() {
if (!JGYUtils.getInstance().tagEmpty()) {
if (!JgyUtils.getInstance().tagEmpty()) {
NetInterfaceManager.getInstance().sendInstalledAppInfo(new NetInterfaceManager.onCompleteCallback() {
@Override
public void onComplete() {
@@ -275,7 +275,7 @@ public class MainSPresenter implements MainSContact.Presenter {
@Override
public void checkTestUpdate() {
if (!JGYUtils.getInstance().tagEmpty()) {
if (!JgyUtils.getInstance().tagEmpty()) {
NetInterfaceManager.getInstance()
.checkTestUpdate(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
@Override
@@ -327,7 +327,7 @@ public class MainSPresenter implements MainSContact.Presenter {
@Override
public void getSystemSettingBegin() {
//重置设备
JGYUtils.getInstance().resetDevice();
JgyUtils.getInstance().resetDevice();
Toaster.debugShow("开始获取管控");
mView.setSystemSetting();
}
@@ -357,12 +357,12 @@ public class MainSPresenter implements MainSContact.Presenter {
@Override
public void getDefaultDesktop() {
Log.e(TAG, "getDefaultDesktop: ");
if (JGYUtils.isOfficialVersion() || !JGYUtils.getInstance().getDeviceIsLocked()) {
if (JgyUtils.isOfficialVersion() || !JgyUtils.getInstance().getDeviceIsLocked()) {
Log.e(TAG, "getDefaultDesktop: " + "Device unLocked");
mView.getDefaultDesktopFinish();
} else {
int aihuaUnlock = Settings.System.getInt(mContext.getContentResolver(), CommonConfig.AIHUA_UNLOCK, 0);
if (JGYUtils.getInstance().isAihuaFramwwork() && aihuaUnlock == 1) {
if (JgyUtils.getInstance().isAihuaFramwwork() && aihuaUnlock == 1) {
Log.e(TAG, "getDefaultDesktop: " + "Device aihua");
mView.getDefaultDesktopFinish();
} else {
@@ -379,7 +379,7 @@ public class MainSPresenter implements MainSContact.Presenter {
@Override
public void setLogoImg() {
if (JGYUtils.isOfficialVersion()) {
if (JgyUtils.isOfficialVersion()) {
mView.setLogoImgFinish();
} else {
NetInterfaceManager.getInstance()
@@ -437,7 +437,7 @@ public class MainSPresenter implements MainSContact.Presenter {
@Override
public void onComplete() {
Log.e("getDesktopIcon", "onComplete: ");
// JGYUtils.getInstance().hideSystemAPP();
// JgyUtils.getInstance().hideSystemAPP();
mView.getDesktopIconFinish();
}
});
@@ -513,7 +513,7 @@ public class MainSPresenter implements MainSContact.Presenter {
@Override
public void setTopApp() {
if (JGYUtils.isOfficialVersion()) {
if (JgyUtils.isOfficialVersion()) {
mView.setTopAppFinish();
return;
}
@@ -539,7 +539,7 @@ public class MainSPresenter implements MainSContact.Presenter {
@Override
public void getSnTimeControl() {
if (JGYUtils.isOfficialVersion()) {
if (JgyUtils.isOfficialVersion()) {
mView.getSnTimeControlFinish();
} else {
NetInterfaceManager.getInstance()
@@ -602,7 +602,7 @@ public class MainSPresenter implements MainSContact.Presenter {
Log.e("getExclusiveAdminApp", "onNext: " + listBaseResponse);
if (listBaseResponse.code == 200) {
List<AdminAppInfo> adminAppInfos = listBaseResponse.data;
JGYUtils.getInstance().installAdminApp(adminAppInfos);
JgyUtils.getInstance().installAdminApp(adminAppInfos);
}
}

View File

@@ -54,7 +54,7 @@ import com.aoleyun.sn.rlog.LogDBManager;
import com.aoleyun.sn.utils.ApkUtils;
import com.aoleyun.sn.utils.CacheUtils;
import com.aoleyun.sn.utils.ForegroundAppUtil;
import com.aoleyun.sn.utils.JGYUtils;
import com.aoleyun.sn.utils.JgyUtils;
import com.aoleyun.sn.utils.SPUtils;
import com.aoleyun.sn.utils.SysSettingUtils;
import com.aoleyun.sn.utils.TimeUtils;
@@ -107,14 +107,14 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
Aria.download(this).resumeAllTask();
String WiFiAlias = Utils.getWifiAlias(this);
Log.e("OnNetworkStatusChanged", "onConnected: " + WiFiAlias);
JGYUtils.getInstance().addNetworkConnectedTime(System.currentTimeMillis() / 1000);
if (JGYUtils.getInstance().isScreenOn()) {
JgyUtils.getInstance().addNetworkConnectedTime(System.currentTimeMillis() / 1000);
if (JgyUtils.getInstance().isScreenOn()) {
TimeTask task = new TimeTask();
task.execute("ntp.aliyun.com");
if (!checkAoleyunApp()) {
mPresenter.checkAoleyunUpdate();
}
mPresenter.sendNetwork(JGYUtils.getInstance().getNetworkConnectedTime());
mPresenter.sendNetwork(JgyUtils.getInstance().getNetworkConnectedTime());
mPresenter.getLockedState();
}
}
@@ -213,9 +213,9 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
@Override
public void onNext(String action) {
Log.e("killObserver", "onNext: " + action);
JGYUtils.getInstance().killPackage(PackageNames.APPSTORE);
JGYUtils.getInstance().killPackage(PackageNames.NOTIFICATIONS);
JGYUtils.getInstance().killPackage(PackageNames.AILOG);
JgyUtils.getInstance().killPackage(PackageNames.APPSTORE);
JgyUtils.getInstance().killPackage(PackageNames.NOTIFICATIONS);
JgyUtils.getInstance().killPackage(PackageNames.AILOG);
}
@Override
@@ -421,14 +421,14 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
mPresenter.attachView(this);
mPresenter.setLifecycle(lifecycleSubject);
if ("YX-T01".equalsIgnoreCase(Build.MODEL)) {
JGYUtils.getInstance().setTongyiAppTop();
JgyUtils.getInstance().setTongyiAppTop();
}
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.YXPD1Platform) {
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.YXPD1Platform) {
Settings.System.putString(getContentResolver(), CommonConfig.ACTIVATIONBEAN_CODE_KEY, Utils.getSerial(this));
if (ApkUtils.isAvailable(this, JGYUtils.JXW_LAUNCHER_PACKAGE_NAME)) {
if (ApkUtils.isAvailable(this, JgyUtils.JXW_LAUNCHER_PACKAGE_NAME)) {
Intent intent2 = new Intent(Intent.ACTION_VIEW);
intent2.setPackage(JGYUtils.JXW_LAUNCHER_PACKAGE_NAME);
intent2.setClassName(JGYUtils.JXW_LAUNCHER_PACKAGE_NAME, JGYUtils.JXW_LAUNCHER_CLASS_NAME);
intent2.setPackage(JgyUtils.JXW_LAUNCHER_PACKAGE_NAME);
intent2.setClassName(JgyUtils.JXW_LAUNCHER_PACKAGE_NAME, JgyUtils.JXW_LAUNCHER_CLASS_NAME);
try {
startService(intent2);//或者bindService(intent, mConnection, Context.BIND_AUTO_CREATE); 都能启动
} catch (Exception e) {
@@ -437,9 +437,9 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
}
}
String launcherPkg = JGYUtils.getInstance().getDefaultDesktop();
String launcherPkg = JgyUtils.getInstance().getDefaultDesktop();
Log.e(TAG, "onCreate: " + launcherPkg);
JGYUtils.getInstance().checkDefaultDesktop(launcherPkg);
JgyUtils.getInstance().checkDefaultDesktop(launcherPkg);
TimeTask task = new TimeTask();
task.execute("ntp.aliyun.com");
@@ -466,7 +466,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
}
}
if ("Aiud_A8_ag_1095".equals(Build.MODEL)) {
if (JgyUtils.getInstance().isAiuduPlatform()) {
// if (mMMKV.decodeInt(CommonConfig.DEVICES_FRIST_START, 0) == 0) {
// ApkUtils.openPackage(MainService.this, "com.books.wisdom");
// }
@@ -487,19 +487,19 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
// }
// }, UserHandle.ALL);
//根据要求卸载这两个应用
if (JGYUtils.getInstance().getDeviceIsLocked()) {
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);
// JgyUtils.getInstance().setJxwLauncher(JXW_LAUNCHER);
// }
// }
try {
JGYUtils.getInstance().hideApp("com.android.email");
JgyUtils.getInstance().hideApp("com.android.email");
} catch (Exception e) {
Log.e(TAG, "onCreate: " + e.getMessage());
}
@@ -520,7 +520,9 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
if (oldVersionCode < BuildConfig.VERSION_CODE) {
Log.e(TAG, "onCreate: " + "upgrade successful");
try {
new CacheUtils().cleanApplicationUserData(this, "com.aoleyun.os");
// new CacheUtils().cleanApplicationUserData(this, "com.aoleyun.os");
new CacheUtils().cleanApplicationUserData(this, "com.aoleyun.audos");
} catch (Exception e) {
Log.e(TAG, "onReceive: " + e.getMessage());
e.printStackTrace();
@@ -530,13 +532,14 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
}
SPUtils.put(this, CommonConfig.SN_VERSIONCODE, BuildConfig.VERSION_CODE);
registerReceivers();
NetworkUtils.registerNetworkStatusChangedListener(this);
addShortcut();
timeChangedStart.onstar(System.currentTimeMillis());
setStatusbar();
setFloatingWindow();
JGYUtils.getInstance().writeAppPackageList();
JgyUtils.getInstance().writeAppPackageList();
// notificationManager = NotificationManagerCompat.from(this);
// createNotificationChannel();
// aliyunPushInit();
@@ -559,7 +562,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
Log.e(TAG, "onStartCommand: ");
JGYUtils.getInstance().wakeUpAoleyunAPP();
JgyUtils.getInstance().wakeUpAoleyunAPP();
if (mMMKV.decodeInt(CommonConfig.DEVICES_FRIST_START, 0) == 0) {
if (!checkAoleyunApp()) {
Log.e(TAG, "onStartCommand: " + "checkAoleyunApp");
@@ -888,7 +891,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
}
}
if (inTime) {
JGYUtils.getInstance().shutdown();
JgyUtils.getInstance().shutdown();
Log.e(TAG, "checkShutdownTime: " + "设备关机");
} else {
Log.e(TAG, "checkShutdownTime: " + "没有关机事件");
@@ -1105,7 +1108,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
} else {
Toaster.debugShow("设备已解锁");
// notificationManager.cancel(NotificationID);
JGYUtils.getInstance().writeAppPackageList();
JgyUtils.getInstance().writeAppPackageList();
SysSettingUtils.setEnableSetting(this);
}
@@ -1142,7 +1145,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
Log.e(TAG, "setDisableSetting: ");
//设置系统管控
SysSettingUtils.setDisableSetting(this);
JGYUtils.getInstance().writeAppPackageList();
JgyUtils.getInstance().writeAppPackageList();
}
mPresenter.getSystemSettingBegin();
}

View File

@@ -18,7 +18,6 @@ import android.os.Binder;
import android.os.Build;
import android.provider.Settings;
import android.text.TextUtils;
import android.util.ArraySet;
import android.util.Log;
import androidx.annotation.RequiresApi;
@@ -555,7 +554,7 @@ public class ApkUtils {
if (pkgs.contains(s)) {
continue;
}
JGYUtils.getInstance().hideApp(s);
JgyUtils.getInstance().hideApp(s);
}
}
@@ -1220,7 +1219,7 @@ public class ApkUtils {
Log.e(TAG, "showAllApp: continue: " + pkg);
continue;
}
if ("Aiud_A8_ag_1095".equals(Build.MODEL)) {
if (JgyUtils.getInstance().isAiuduPlatform()) {
if (AiudHideApp.contains(pkg)) {
continue;
}

View File

@@ -19,9 +19,9 @@ public class BootManager {
public void start() {
sendLauncherIcon();
timeControlUpdate();
JGYUtils.getInstance().updateNetworkWhiteList();
JGYUtils.getInstance().onBootSendNetwork();
JGYUtils.getInstance().onBootSetAppInsideWeb();
JgyUtils.getInstance().updateNetworkWhiteList();
JgyUtils.getInstance().onBootSendNetwork();
JgyUtils.getInstance().onBootSetAppInsideWeb();
}
private void sendLauncherIcon() {

View File

@@ -53,7 +53,7 @@ public class ForegroundAppUtil {
Log.e(TAG, "setTopAppClass: always_top_packagename = " + always_top_packagename);
Log.e(TAG, "setTopAppClass: always_top_classname = " + always_top_classname);
} else {
String ClassName = JGYUtils.getInstance().getStartClassName(pkg);
String ClassName = JgyUtils.getInstance().getStartClassName(pkg);
setTopAppClass(context, pkg, ClassName);
}
}

View File

@@ -19,8 +19,6 @@ import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.pm.UserInfo;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.Drawable;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
@@ -119,8 +117,8 @@ import io.reactivex.rxjava3.disposables.Disposable;
import static android.app.ActivityManager.RECENT_IGNORE_UNAVAILABLE;
public class JGYUtils {
private static final String TAG = "JGYUtils";
public class JgyUtils {
private static final String TAG = "JgyUtils";
/*九学王*/
public static final String JXW_LAUNCHER_PACKAGE_NAME = "com.jxw.launcher";
@@ -130,7 +128,7 @@ public class JGYUtils {
public static final String JXW_LAUNCHER_UPDATE_CLASS_NAME = "com.jxw.engine.platsign.UpdateActivity";
@SuppressLint("StaticFieldLeak")
private static JGYUtils sInstance;
private static JgyUtils sInstance;
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
private Context mContext;
private ContentResolver crv;
@@ -155,6 +153,8 @@ public class JGYUtils {
public static final int MT8768Platform = 17;
public static final int AUDG104Platform = 18;
public static final int HL500Platform = 20;
public static final int G11JPlatform = 21;
public static final int P50Platform = 23;
public static final String Other = "其他";
@@ -174,6 +174,8 @@ public class JGYUtils {
public static final String MT8768Tag = "MT8768";
public static final String AUDG104Tag = "AUDG104";
public static final String HL500Tag = "HL500";
public static final String G11JTag = "aud8786";
public static final String P50Tag = "P50TD";
private CacheHelper cacheHelper;
@@ -182,7 +184,7 @@ public class JGYUtils {
System.loadLibrary("jgy");
}
private JGYUtils(Context context) {
private JgyUtils(Context context) {
if (context == null) {
throw new RuntimeException("Context is NULL");
}
@@ -191,7 +193,7 @@ public class JGYUtils {
this.cacheHelper = new CacheHelper(context);
initConnectedTimeCache();
if (C2Tag.equals(BuildConfig.platform)) {
Log.e(TAG, "JGYUtils: c2");
Log.e(TAG, "JgyUtils: c2");
mServiceConnection = new ServiceConnection() {
@Override
public void onServiceConnected(ComponentName componentName, IBinder iBinder) {
@@ -218,13 +220,13 @@ public class JGYUtils {
public static void init(Context context) {
if (sInstance == null) {
Log.e(TAG, "init: ");
sInstance = new JGYUtils(context);
sInstance = new JgyUtils(context);
}
}
public static JGYUtils getInstance() {
public static JgyUtils getInstance() {
if (sInstance == null) {
throw new IllegalStateException("You must be init JGYUtils first");
throw new IllegalStateException("You must be init JgyUtils first");
}
return sInstance;
}
@@ -307,6 +309,12 @@ public class JGYUtils {
} else if (HL500Tag.equalsIgnoreCase(platform)) {
Log.i(TAG, "checkAppPlatform: " + "HL500");
return HL500Platform;
} else if (G11JTag.equalsIgnoreCase(platform)) {
Log.i(TAG, "checkAppPlatform: " + "G11J");
return G11JPlatform;
} else if (P50Tag.equalsIgnoreCase(platform)) {
Log.i(TAG, "checkAppPlatform: " + "P50TD");
return P50Platform;
} else {
Log.i(TAG, "checkAppPlatform: " + "没有数据");
return UnknowPlatform;
@@ -361,7 +369,11 @@ public class JGYUtils {
getAppPlatformCallback.AppPlatform(AUDG104Platform);
} else if (HL500Tag.equalsIgnoreCase(platform)) {
getAppPlatformCallback.AppPlatform(HL500Platform);
} else {
} else if (G11JTag.equalsIgnoreCase(platform)) {
getAppPlatformCallback.AppPlatform(G11JPlatform);
} else if (P50Tag.equalsIgnoreCase(platform)) {
getAppPlatformCallback.AppPlatform(P50Platform);
}else {
getAppPlatformCallback.AppPlatform(UnknowPlatform);
}
}
@@ -400,28 +412,28 @@ public class JGYUtils {
}
public static boolean isOfficialVersion() {
String channelValue = JGYUtils.getInstance().getStringMetaData();
String channelValue = JgyUtils.getInstance().getStringMetaData();
return "official".equals(channelValue);
}
public static boolean isOfficialVersion(Context context) {
Log.e(TAG, "isOfficialVersion: " + ProcessUtil.getCurrentProcessName(context));
String channelValue = JGYUtils.getInstance().getStringMetaData();
String channelValue = JgyUtils.getInstance().getStringMetaData();
return "official".equals(channelValue);
}
public static boolean isNewlyVersion() {
String channelValue = JGYUtils.getInstance().getStringMetaData();
String channelValue = JgyUtils.getInstance().getStringMetaData();
return "beta".equals(channelValue);
}
public static boolean isBetaVersion() {
String channelValue = JGYUtils.getInstance().getStringMetaData();
String channelValue = JgyUtils.getInstance().getStringMetaData();
return "beta".equals(channelValue);
}
public static String getCHANNEL_VALUE() {
return JGYUtils.getInstance().getStringMetaData();
return JgyUtils.getInstance().getStringMetaData();
}
public void resetDevice() {
@@ -819,7 +831,7 @@ public class JGYUtils {
}
}
if (!MTK11Tag.equals(JGYUtils.getInstance().getAppPlatform())) {
if (!MTK11Tag.equals(JgyUtils.getInstance().getAppPlatform())) {
if (blackList == null || blackList.size() == 0) {
Settings.System.putString(crv, CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, null);
} else {
@@ -925,7 +937,7 @@ public class JGYUtils {
}
public void onBootSendNetwork() {
if (!MTK11Tag.equals(JGYUtils.getInstance().getAppPlatform())) {
if (!MTK11Tag.equals(JgyUtils.getInstance().getAppPlatform())) {
String oldBlackListString = (String) SPUtils.get(mContext, CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, "");
HashSet<String> oldBlackListSet = new HashSet<>(Arrays.asList(oldBlackListString.split(",")));
Log.e(TAG, "setAppNetwork: oldBlackListSet: " + oldBlackListSet);
@@ -1402,16 +1414,16 @@ public class JGYUtils {
if ("G23".equals(Build.MODEL)) {
pkgSet.addAll(ApkUtils.zhengwu);
}
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G11Platform) {
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.G11Platform) {
pkgSet.addAll(ApkUtils.G11Pkgs);
}
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.YXPD1Platform) {
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.YXPD1Platform) {
pkgSet.add("com.tencent.wemeet.app");
}
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G10PPlatform) {
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.G10PPlatform) {
pkgSet.add("com.gaomuxuexi34");
}
if (JGYUtils.C2Tag.equalsIgnoreCase(JGYUtils.getInstance().getAppPlatform())) {
if (JgyUtils.C2Tag.equalsIgnoreCase(JgyUtils.getInstance().getAppPlatform())) {
pkgSet.remove("com.tencent.mm");
}
return pkgSet;
@@ -1462,7 +1474,7 @@ public class JGYUtils {
// }.getType();
// List<ForceDownloadData> forceDownloadData = gson.fromJson(jsonString, listType);
// if (forceDownloadData != null) {
// JGYUtils.getInstance().forceDownload(forceDownloadData);
// JgyUtils.getInstance().forceDownload(forceDownloadData);
// }
// }
NetInterfaceManager.getInstance().getForceDownload();
@@ -1864,7 +1876,7 @@ public class JGYUtils {
public void checkBootFile(String url, String MD5) {
String urlFileName = Utils.getFileNamefromURL(url);
File bootFile = new File(JGYUtils.getInstance().getDownLoadPath() + urlFileName);
File bootFile = new File(JgyUtils.getInstance().getDownLoadPath() + urlFileName);
Log.e(TAG, "checkBootFile: bootFile file path=" + bootFile.getAbsolutePath());
Log.e(TAG, "checkBootFile: bootFile exists=" + bootFile.exists() + " isFile=" + bootFile.isFile());
if (bootFile.exists() && bootFile.isFile()) {
@@ -1975,7 +1987,7 @@ public class JGYUtils {
public void removeBootanimation() {
File systemFile;
// if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MT8768Platform) {
// if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.MT8768Platform) {
systemFile = new File(BOOTANIMATION_PATH_G10J);
// } else {
// systemFile = new File(BOOTANIMATION_PATH);
@@ -1987,7 +1999,7 @@ public class JGYUtils {
Log.e(TAG, "removeBootanimation: delete: " + "false");
}
}
// if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MT8768Platform) {
// if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.MT8768Platform) {
Intent intent = new Intent("com.hra.setBootanimation");
mContext.sendBroadcast(intent);
// }
@@ -2149,15 +2161,15 @@ public class JGYUtils {
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
/*知道要跳转应用的包命与目标Activity*/
switch (JGYUtils.getInstance().checkAppPlatform()) {
switch (JgyUtils.getInstance().checkAppPlatform()) {
default:
case JGYUtils.YXPD1Platform:
case JgyUtils.YXPD1Platform:
intent.setComponent(new ComponentName("com.adups.fota", "com.adups.fota.GoogleOtaClient"));
break;
case JGYUtils.C2Platform:
case JgyUtils.C2Platform:
intent.setComponent(new ComponentName("com.jintaiyi.update", "com.jintaiyi.update.activity.NoVersionActivity"));
break;
case JGYUtils.ZhanruiPlatform:
case JgyUtils.ZhanruiPlatform:
intent.setComponent(new ComponentName("com.cube.update", "com.cube.update.GoogleOtaClient"));
break;
}
@@ -2492,7 +2504,7 @@ public class JGYUtils {
UserHandle user = Process.myUserHandle();
Log.i("settingssssssstemf", (add ? "Adding" : "Removing") + " package as role holder, role: "
+ roleName + ", package: " + packageName);
if (JGYUtils.getInstance().checkAppPlatform() != JGYUtils.MTKPlatform) {
if (JgyUtils.getInstance().checkAppPlatform() != JgyUtils.MTKPlatform) {
RoleManager roleManager = context.getSystemService(RoleManager.class);
Executor executor = context.getMainExecutor();
Consumer<Boolean> callback = successful -> {
@@ -2517,14 +2529,16 @@ public class JGYUtils {
Log.e(TAG, "checkDefaultDesktop: pkg = " + pkg);
Log.e(TAG, "checkDefaultDesktop: desktopPkg = " + desktopPkg);
if (TextUtils.isEmpty(pkg)) {
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.YXPD1Platform) {
JGYUtils.getInstance().setDop7DefaultDesktop();
} else if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G11Platform) {
JGYUtils.getInstance().setJXWDefaultDesktop();
// } else if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.ZhanruiPlatform) {
// JGYUtils.getInstance().setJXWDefaultDesktop();
} else if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.AUDG104Platform) {
JGYUtils.getInstance().setAiuduDefaultDesktop();
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.YXPD1Platform) {
JgyUtils.getInstance().setDop7DefaultDesktop();
} else if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.G11Platform) {
JgyUtils.getInstance().setJXWDefaultDesktop();
// } else if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.ZhanruiPlatform) {
// JgyUtils.getInstance().setJXWDefaultDesktop();
} else if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.AUDG104Platform
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.G11JPlatform
) {
JgyUtils.getInstance().setAiuduDefaultDesktop();
}
} else {
if (pkg.equalsIgnoreCase(desktopPkg)) {
@@ -2619,7 +2633,7 @@ public class JGYUtils {
if (ApkUtils.isAvailable(mContext, AoleyunOs)
|| "C2".equals(Build.MODEL)) {
setDefaultDesktop(AoleyunOs, AoleyunOsClass);
} else if ("Aiud_A8_ag_1095".equals(Build.MODEL)) {
} else if (JgyUtils.getInstance().isAiuduPlatform()) {
setDefaultDesktop(AiUDuOs, AiUDuOsClass);
} else {
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.Q) {
@@ -2634,7 +2648,7 @@ public class JGYUtils {
if (ApkUtils.isAvailable(mContext, AoleyunOs)
|| "C2".equals(Build.MODEL)) {
ApkUtils.openPackage(mContext, AoleyunOs, AoleyunOsClass);
} else if ("Aiud_A8_ag_1095".equals(Build.MODEL)) {
} else if (JgyUtils.getInstance().isAiuduPlatform()) {
setDefaultDesktop(AiUDuOs, AiUDuOsClass);
} else {
ApkUtils.openPackage(mContext, Launcher3, Launcher3Class);
@@ -2694,7 +2708,7 @@ public class JGYUtils {
Intent intent = new Intent("setDefaultLauncher");
intent.putExtra("package", pkg);
intent.putExtra("className", className);
// if (JGYUtils.getInstance().checkAppPlatform() == MTKPlatform) {
// if (JgyUtils.getInstance().checkAppPlatform() == MTKPlatform) {
// Log.e(TAG, "setDefaultDesktop: MTK");
// //爱华定制
// intent.setComponent(new ComponentName("com.android.settings", "com.android.settings.AoleReceiver"));
@@ -2760,7 +2774,7 @@ public class JGYUtils {
jsonObject.addProperty("LAN_ip", Utils.getIPAddress(mContext));
jsonObject.addProperty("bluetooth", Utils.getBluetoothList());
jsonObject.addProperty("wifi_name", Utils.getWifiAlias(mContext));
jsonObject.addProperty("platform", JGYUtils.getInstance().getAppPlatform());
jsonObject.addProperty("platform", JgyUtils.getInstance().getAppPlatform());
return jsonObject.toString();
}
@@ -3399,7 +3413,7 @@ public class JGYUtils {
* @return true为能打开
*/
public boolean isCloudLessonMod(String pkg) {
if (JGYUtils.getInstance().isForbid(pkg)) {
if (JgyUtils.getInstance().isForbid(pkg)) {
return false;
}
if (ApkUtils.isSystemApp(mContext, pkg)) {
@@ -3460,8 +3474,8 @@ public class JGYUtils {
public void setWallpaper(String url) {
String oldUrl = mMMKV.decodeString(CommonConfig.WALLPAPER_URL_KEY, "");
if (oldUrl.equals(url)){
Log.e(TAG, "setWallpaper: Already set" );
if (oldUrl.equals(url)) {
Log.e(TAG, "setWallpaper: Already set");
return;
}
@@ -3492,4 +3506,11 @@ public class JGYUtils {
});
}
public boolean isAiuduPlatform() {
return checkAppPlatform() == G11JPlatform
|| "Aiud_A8_ag_1095".equals(Build.MODEL)
|| "G11J".equals(Build.MODEL);
}
}

View File

@@ -82,8 +82,8 @@ public class SysSettingUtils {
Log.e("setDisableSetting", "Close all settings: ");
setPhoneList(context, 1);
setUSBstate(context, 1);
if (JGYUtils.getInstance().getAppPlatform().equals(JGYUtils.YXPD1TAG)
|| JGYUtils.getInstance().getAppPlatform().equals(JGYUtils.C2Tag)
if (JgyUtils.getInstance().getAppPlatform().equals(JgyUtils.YXPD1TAG)
|| JgyUtils.getInstance().getAppPlatform().equals(JgyUtils.C2Tag)
) {
setBluetooth(context, 0);
} else {
@@ -99,7 +99,7 @@ public class SysSettingUtils {
setAutoTime(context, 1);
setBrowserInput(context, 1);
if (!BuildConfig.DEBUG) {
// JGYUtils.getInstance().setDeveloperOptions(0);
// JgyUtils.getInstance().setDeveloperOptions(0);
}
setStatusBar(context, 1);
setAdminApp(context, 1);
@@ -113,7 +113,7 @@ public class SysSettingUtils {
public static void setEnableSetting(Context context) {
Toaster.debugShow("打开所有功能");
setPhoneList(context, 0);
if (JGYUtils.C2Tag.equalsIgnoreCase(JGYUtils.getInstance().getAppPlatform())) {
if (JgyUtils.C2Tag.equalsIgnoreCase(JgyUtils.getInstance().getAppPlatform())) {
openMtp(context);
}
// setUSBstate(context, 0);
@@ -127,7 +127,7 @@ public class SysSettingUtils {
setCanReset(context, 0);
setAutoTime(context, 0);
setBrowserInput(context, 0);
// JGYUtils.getInstance().setDeveloperOptions(1);
// JgyUtils.getInstance().setDeveloperOptions(1);
setStatusBar(context, 0);
setAdminApp(context, 0);
setSystemAppDisable(context, 0);
@@ -184,7 +184,7 @@ public class SysSettingUtils {
}
//存储卡
int setting_memory = changeNum(jsonObject.get("setting_memory").getAsInt());
JGYUtils.getInstance().setSDOTGEnable(setting_memory == 0);
JgyUtils.getInstance().setSDOTGEnable(setting_memory == 0);
boolean aole_sdcard_forbid_on = Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_SDCARD_FORBID_ON, setting_memory);
Log.e(TAG, "aole_sdcard_forbid_on:" + aole_sdcard_forbid_on);
} catch (Exception e) {
@@ -207,12 +207,12 @@ public class SysSettingUtils {
boolean aole_usb_choose = Settings.System.putString(context.getContentResolver(), "aole_usb_choose", "usb_charge");
Log.e(TAG, "aole_usb_choose:" + aole_usb_choose);
String usbStatus = CommonConfig.AOLE_ACTION_USB_USB_CHARGE;
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.AH6016Platform) {
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.AH6016Platform) {
usbStatus = CommonConfig.AOLE_ACTION_USB_USB_MTP;
}
Intent usbIntent = new Intent(usbStatus);
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.TeclastP20sPlatform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.AH6016Platform
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.TeclastP20sPlatform
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.AH6016Platform
) {
usbIntent.setPackage("com.android.settings");
}
@@ -238,7 +238,7 @@ public class SysSettingUtils {
return;
}
if (!BuildConfig.DEBUG) {
if (JGYUtils.isCubeDevice()) {
if (JgyUtils.isCubeDevice()) {
SuperPower mService = (SuperPower) context.getSystemService("mdm");
switch (setting_usb) {
case "usb_charge":
@@ -257,20 +257,20 @@ public class SysSettingUtils {
default:
case "usb_charge":
usbStatus = CommonConfig.AOLE_ACTION_USB_USB_CHARGE;
JGYUtils.getInstance().setMtpEnable(false);
JgyUtils.getInstance().setMtpEnable(false);
break;
case "usb_mtp":
usbStatus = CommonConfig.AOLE_ACTION_USB_USB_MTP;
JGYUtils.getInstance().setMtpEnable(true);
JgyUtils.getInstance().setMtpEnable(true);
break;
case "usb_midi":
usbStatus = CommonConfig.AOLE_ACTION_USB_USB_MIDI;
JGYUtils.getInstance().setMtpEnable(false);
JgyUtils.getInstance().setMtpEnable(false);
break;
}
Intent usbIntent = new Intent(usbStatus);
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.TeclastP20sPlatform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.AH6016Platform
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.TeclastP20sPlatform
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.AH6016Platform
) {
usbIntent.setPackage("com.android.settings");
}
@@ -331,7 +331,7 @@ public class SysSettingUtils {
Log.e(TAG, "setBluetooth: setting_bhtvideo no changed");
}
JGYUtils.getInstance().setBluetoothEnable(state == 0);
JgyUtils.getInstance().setBluetoothEnable(state == 0);
}
/**
@@ -434,7 +434,7 @@ public class SysSettingUtils {
Log.e(TAG, "setBluetooth: setting_bhtvideo no changed");
}
JGYUtils.getInstance().setBluetoothEnable(setting_bht == 0);
JgyUtils.getInstance().setBluetoothEnable(setting_bht == 0);
}
private static void setHotspot(Context context, int state) {
@@ -601,7 +601,7 @@ public class SysSettingUtils {
}
Intent cameraIntent = new Intent(cameraStatus).setPackage("com.android.settings");
context.sendBroadcast(cameraIntent);
JGYUtils.getInstance().setCameraEnable(setting_camera == 1);
JgyUtils.getInstance().setCameraEnable(setting_camera == 1);
} catch (Exception e) {
Log.e(TAG, "setCamera: " + e.getMessage());
}
@@ -642,7 +642,7 @@ public class SysSettingUtils {
private static void setTF(Context context, JsonObject jsonObject) {
try {
int setting_tfmedia = jsonObject.get("setting_tfmedia").getAsInt();
// if (JGYUtils.isOfficialVersion() ) {
// if (JgyUtils.isOfficialVersion() ) {
// setting_tfmedia = changeNum(setting_tfmedia);
// }
boolean qch_tfmedia_forbid = Settings.System.putInt(context.getContentResolver(),
@@ -996,7 +996,7 @@ public class SysSettingUtils {
int is_bluetooth_file = snSetting.getIs_bluetooth_file();
setBluetoothTransmission(context, changeNum(is_bluetooth_file));
int is_developer = snSetting.getIs_developer();
JGYUtils.getInstance().setDeveloperOptions(is_developer);
JgyUtils.getInstance().setDeveloperOptions(is_developer);
int is_restore = snSetting.getIs_restore();
setCanReset(context, changeNum(is_restore));
int is_topbar = snSetting.getIs_topbar();
@@ -1015,7 +1015,7 @@ public class SysSettingUtils {
// Settings.Global.putInt(context.getContentResolver(), CommonConfig.AOLEYUN_APPSTORE_INSTALL, 1);
// setUsb(context, 0);
// setBluetoothTransmission(context, 0);
//// JGYUtils.getInstance().setDeveloperOptions(0);
//// JgyUtils.getInstance().setDeveloperOptions(0);
// setCanReset(context, 0);
// setActionBar(context, 0);
// setNavigationBar(context, 0);
@@ -1080,7 +1080,7 @@ public class SysSettingUtils {
//仅充电usb_charge
//MTP模式usb_mtp
//Midi模式usb_midi
if (JGYUtils.isCubeDevice()) {
if (JgyUtils.isCubeDevice()) {
SuperPower mService = (SuperPower) context.getSystemService("mdm");
switch (status) {
case 0:
@@ -1097,20 +1097,20 @@ public class SysSettingUtils {
default:
case 0:
usbStatus = CommonConfig.AOLE_ACTION_USB_USB_CHARGE;
JGYUtils.getInstance().setMtpEnable(false);
JgyUtils.getInstance().setMtpEnable(false);
break;
case 1:
usbStatus = CommonConfig.AOLE_ACTION_USB_USB_MTP;
JGYUtils.getInstance().setMtpEnable(true);
JgyUtils.getInstance().setMtpEnable(true);
break;
case 2:
usbStatus = CommonConfig.AOLE_ACTION_USB_USB_MIDI;
JGYUtils.getInstance().setMtpEnable(false);
JgyUtils.getInstance().setMtpEnable(false);
break;
}
Intent usbIntent = new Intent(usbStatus);
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.TeclastP20sPlatform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.AH6016Platform
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.TeclastP20sPlatform
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.AH6016Platform
) {
usbIntent.setPackage("com.android.settings");
}

View File

@@ -1204,8 +1204,8 @@ public class Utils {
}
}
Log.e("ariaDownload", "urlMD5=" + urlMD5);
String p = JGYUtils.getInstance().getDownLoadPath();
File file = new File(JGYUtils.getInstance().getDownLoadPath() + fileName);
String p = JgyUtils.getInstance().getDownLoadPath();
File file = new File(JgyUtils.getInstance().getDownLoadPath() + fileName);
if (file.exists() && !file.isDirectory()) {
String filenameMD5 = getMD5fromFileName(url);
String fileMD5 = FileUtils.getFileMD5ToString(file);
@@ -1217,7 +1217,7 @@ public class Utils {
} else {
Aria.download(context)
.load(url) //读取下载地址
.setFilePath(JGYUtils.getInstance().getDownLoadPath() + fileName)
.setFilePath(JgyUtils.getInstance().getDownLoadPath() + fileName)
.ignoreFilePathOccupy()
.setExtendField(jsonObject.toString())
.create(); //启动下载}
@@ -1226,7 +1226,7 @@ public class Utils {
Aria.download(context)
.load(url) //读取下载地址
.setFilePath(JGYUtils.getInstance().getDownLoadPath() + fileName)
.setFilePath(JgyUtils.getInstance().getDownLoadPath() + fileName)
.ignoreFilePathOccupy()
.setExtendField(jsonObject.toString())
.create(); //启动下载}
@@ -1801,21 +1801,23 @@ public class Utils {
* @return
*/
public static String getCustomVersion() {
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.ZhanruiPlatform
// || JGYUtils.getInstance().checkAppPlatform() == JGYUtils.CubePlatform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MTKPlatform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MTK11Platform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.TeclastP20sPlatform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.AH6016Platform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.ZR6016Platform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.HRAD13Platform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G10PPlatform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.C2Platform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.YXPD1Platform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G11Platform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MT8768Platform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.AUDG104Platform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.HL500Platform
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.ZhanruiPlatform
// || JgyUtils.getInstance().checkAppPlatform() == JgyUtils.CubePlatform
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.MTKPlatform
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.MTK11Platform
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.TeclastP20sPlatform
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.AH6016Platform
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.ZR6016Platform
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.HRAD13Platform
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.G10PPlatform
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.C2Platform
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.YXPD1Platform
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.G11Platform
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.MT8768Platform
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.AUDG104Platform
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.HL500Platform
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.G11JPlatform
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.P50Platform
) {
return Utils.getProperty("ro.build.display.id", "获取失败");
} else {
@@ -1829,13 +1831,13 @@ public class Utils {
* @return
*/
public static String getRomVersion() {
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.ZhanruiPlatform) {
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.ZhanruiPlatform) {
return getProperty("ro.build.id", "获取失败");
}
// else if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.CubePlatform) {
// else if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.CubePlatform) {
// return Utils.getProperty("ro.build.id", "获取失败");
// }
else if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MTKPlatform) {
else if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.MTKPlatform) {
return Utils.getProperty("ro.build.id", "获取失败");
} else {
return getProperty("ro.build.display.id", "获取失败");

View File

@@ -9,7 +9,7 @@
extern "C"
JNIEXPORT jstring JNICALL
Java_com_aoleyun_sn_utils_JGYUtils_getAuthorization(JNIEnv *env, jclass clazz) {
Java_com_aoleyun_sn_utils_JgyUtils_getAuthorization(JNIEnv *env, jclass clazz) {
// TODO: implement getAuthorization()
std::string hello;