diff --git a/app/build.gradle b/app/build.gradle index efbac19..ec5f405 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -29,8 +29,8 @@ android { defaultConfig { applicationId "com.aoleyun.sn" - versionCode 200 - versionName "1.5.1216" + versionCode 206 + versionName "1.6.0226" //There are no CERT files because If the mini sdk version is 23+, the AGP will ignore the V1 scheme signature. minSdkVersion 24 @@ -270,9 +270,32 @@ android { v1SigningEnabled true v2SigningEnabled true } + + G128T { + storeFile file("keystore/HuaruianG128T.jks") + storePassword "123456" + keyAlias "g128t" + keyPassword "123456" + v1SigningEnabled true + v2SigningEnabled true + } } buildTypes { + G128TDebug.initWith(debug) + G128TDebug { + buildConfigField "String", "platform", '"G128T"' + versionNameSuffix "-debug" + debuggable true + signingConfig signingConfigs.G128T + } + + G128TRelease.initWith(release) + G128TRelease { + buildConfigField "String", "platform", '"G128T"' + signingConfig signingConfigs.G128T + } + MT6765Debug.initWith(debug) MT6765Debug { buildConfigField "String", "platform", '"MT6765"' diff --git a/app/keystore/HuaruianG128T.jks b/app/keystore/HuaruianG128T.jks new file mode 100644 index 0000000..75558cc Binary files /dev/null and b/app/keystore/HuaruianG128T.jks differ diff --git a/app/src/main/java/com/aoleyun/sn/activity/main/MainActivity.java b/app/src/main/java/com/aoleyun/sn/activity/main/MainActivity.java index 7e409f4..ea3ca93 100644 --- a/app/src/main/java/com/aoleyun/sn/activity/main/MainActivity.java +++ b/app/src/main/java/com/aoleyun/sn/activity/main/MainActivity.java @@ -160,10 +160,10 @@ public class MainActivity extends BaseMvvmActivity(tagSets).toArray(new String[tagSets.size()]); CloudPushService pushService = PushServiceFactory.getCloudPushService(); pushService.bindTag(CloudPushService.DEVICE_TARGET, tag, null, new CommonCallback() { @Override public void onSuccess(String s) { - Log.e("clearAndAppendTags", "bind tag " + Arrays.toString(tag) + " success\n"); + Log.e("AliyunPush", "bind tag " + Arrays.toString(tag) + " success\n"); } @Override public void onFailed(String errorCode, String errorMsg) { - Log.e("clearAndAppendTags", "bind tag " + Arrays.toString(tag) + " failed." + + Log.e("AliyunPush", "bind tag " + Arrays.toString(tag) + " failed." + "errorCode: " + errorCode + ", errorMsg:" + errorMsg + "\n"); BaseApplication.onTagOperatorResult(errorCode); } diff --git a/app/src/main/java/com/aoleyun/sn/service/RemoteService.java b/app/src/main/java/com/aoleyun/sn/service/RemoteService.java index a569588..1292ab7 100644 --- a/app/src/main/java/com/aoleyun/sn/service/RemoteService.java +++ b/app/src/main/java/com/aoleyun/sn/service/RemoteService.java @@ -50,9 +50,13 @@ public class RemoteService extends Service { return locked == JGYActions.FRAME_CODE_LOCKED; } + /** + * @return 是否关闭 + * @throws RemoteException + */ @Override public boolean isBrowserInput() throws RemoteException { - int state = Settings.System.getInt(getContentResolver(), "qch_Browser_input", 1); + int state = Settings.System.getInt(getContentResolver(), "qch_Browser_input", 0); return state == 0; } diff --git a/app/src/main/java/com/aoleyun/sn/service/main/MainService.java b/app/src/main/java/com/aoleyun/sn/service/main/MainService.java index 8003374..68bacb1 100644 --- a/app/src/main/java/com/aoleyun/sn/service/main/MainService.java +++ b/app/src/main/java/com/aoleyun/sn/service/main/MainService.java @@ -23,6 +23,7 @@ import android.os.Binder; import android.os.Build; import android.os.Handler; import android.os.IBinder; +import android.os.Looper; import android.os.RemoteException; import android.provider.Settings; import android.text.TextUtils; @@ -115,8 +116,8 @@ public class MainService extends Service implements MainSContact.MainView, Netwo if (!checkAoleyunApp()) { mPresenter.checkAoleyunUpdate(); } - mInternetConnected.onConnected(WiFiAlias); } + mInternetConnected.onConnected(WiFiAlias); } private class TimeTask extends AsyncTask { @@ -494,7 +495,13 @@ public class MainService extends Service implements MainSContact.MainView, Netwo boolean reboot = mMMKV.decodeBool(CommonConfig.DEVICES_REBOOT, true); if (reboot) { - mPresenter.getLockedState(); + new Handler(Looper.getMainLooper()).postDelayed(new Runnable() { + @Override + public void run() { + mPresenter.getLockedState(); + } + }, 20000); + mMMKV.encode(CommonConfig.DEVICES_REBOOT, false); Log.e(TAG, "onCreate: device rebooted"); } else { @@ -616,7 +623,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo .subscribe(killObserver); Observable.create(networkSubscribe) - .throttleLast(1, TimeUnit.HOURS) + .throttleFirst(1, TimeUnit.HOURS) .subscribe(networkObserver); JgyUtils.getInstance().checkAoleyunApp(); diff --git a/app/src/main/java/com/aoleyun/sn/utils/JgyUtils.java b/app/src/main/java/com/aoleyun/sn/utils/JgyUtils.java index f72665b..844776b 100644 --- a/app/src/main/java/com/aoleyun/sn/utils/JgyUtils.java +++ b/app/src/main/java/com/aoleyun/sn/utils/JgyUtils.java @@ -165,6 +165,7 @@ public class JgyUtils { public static final int seewoPlatform = 25; public static final int U1302Platform = 26; public static final int MT6765Platform = 28; + public static final int G128TPlatform = 29; public static final String Other = "其他"; @@ -189,6 +190,7 @@ public class JgyUtils { public static final String seewoTag = "seewo"; public static final String allwinner_U1302 = "QZA15"; public static final String MT6765_TAG = "MT6765"; + public static final String G128T_TAG = "G128T"; private CacheHelper cacheHelper; @@ -337,6 +339,9 @@ public class JgyUtils { } else if (MT6765_TAG.equalsIgnoreCase(platform)) { Log.i(TAG, "checkAppPlatform: " + "MT6765"); return MT6765Platform; + } else if (G128T_TAG.equalsIgnoreCase(platform)) { + Log.i(TAG, "checkAppPlatform: " + "G128T"); + return G128TPlatform; } else { Log.i(TAG, "checkAppPlatform: " + "没有数据"); return UnknowPlatform; @@ -401,6 +406,8 @@ public class JgyUtils { getAppPlatformCallback.AppPlatform(U1302Platform); } else if (MT6765_TAG.equalsIgnoreCase(platform)) { getAppPlatformCallback.AppPlatform(MT6765Platform); + } else if (G128T_TAG.equalsIgnoreCase(platform)) { + getAppPlatformCallback.AppPlatform(G128TPlatform); } else { getAppPlatformCallback.AppPlatform(UnknowPlatform); } @@ -1015,18 +1022,22 @@ public class JgyUtils { } public void writeDeselectIDtoSystem(List appIDList) { - if (!"Ebox201".equals(Build.MODEL)&&!"Ebox201W".equals(Build.MODEL)){ - Log.e(TAG, "writeDeselectIDtoSystem: not match Ebox201 or Ebox201W" ); + if (!"Ebox201".equals(Build.MODEL) && !"Ebox201W".equals(Build.MODEL)) { + Log.e(TAG, "writeDeselectIDtoSystem: not match Ebox201 or Ebox201W"); return; } if (appIDList == null || appIDList.isEmpty()) { - try { - Settings.System.putString(crv, CommonConfig.APP_VIEW_CLICK_DISABLED, null); - // TODO: 2024/9/11 修复1.4.0907版本数据为空系统报错 - CmdUtil.Result result = CmdUtil.execute(" settings delete system app_view_click_disabled"); - Log.e(TAG, "writeDeselectIDtoSystem: " + result); - } catch (Exception e) { - e.printStackTrace(); + if ("G10".equals(Build.MODEL) || "D1".equals(Build.MODEL)) { + Settings.System.putString(mContext.getContentResolver(), CommonConfig.APP_VIEW_CLICK_DISABLED, "com.arivoc.wordhd:2131624676,2131624689;com.ttstd.utils:12345"); + } else { + try { + Settings.System.putString(crv, CommonConfig.APP_VIEW_CLICK_DISABLED, null); + // TODO: 2024/9/11 修复1.4.0907版本数据为空系统报错 + CmdUtil.Result result = CmdUtil.execute(" settings delete system app_view_click_disabled"); + Log.e(TAG, "writeDeselectIDtoSystem: " + result); + } catch (Exception e) { + e.printStackTrace(); + } } } else { String s = appIDList.stream().map(new Function() { @@ -1468,6 +1479,9 @@ public class JgyUtils { pkgSet.addAll(ApkUtils.desktopAPP); pkgSet.addAll(ApkUtils.aoleyunAPP); pkgSet.addAll(ApkUtils.mJxwApp); + if (G128T_TAG.equals(BuildConfig.platform)) { + pkgSet.add("com.dmjc.xinhuo"); + } if ("K101".equals(Build.MODEL) || "AS001".equals(Build.MODEL)) { pkgSet.addAll(ApkUtils.aihuaApp); pkgSet.addAll(aihuaAppList); @@ -1581,7 +1595,7 @@ public class JgyUtils { jsonObject.addProperty("app_id", app_id); jsonObject.addProperty("MD5", app_md5); long app_version_code = forceDownloadData.getApp_version_code(); - Log.e("fht ", "packageName=" + app_package + ",URL= " + app_url + ",app_version_code=" + app_version_code); + Log.e("forceDownload", "packageName=" + app_package + ",URL= " + app_url + ",app_version_code=" + app_version_code); if (BuildConfig.APPLICATION_ID.equals(data.get(i).getApp_package())) { continue;//为自身的跳过下载 } @@ -2115,7 +2129,9 @@ public class JgyUtils { Log.e(TAG, "setDeveloperOptions: oldStatu = " + oldStatu + " no changed"); } - if (MT8768Tag.equalsIgnoreCase(BuildConfig.platform)) { + if (MT8768Tag.equalsIgnoreCase(BuildConfig.platform) + || G128T_TAG.equalsIgnoreCase(BuildConfig.platform) + ) { Settings.System.putInt(crv, CommonConfig.AOLE_ACTION_DEVELOPER_OPTIONS, state); } else { //这个需要反着来 diff --git a/app/src/main/java/com/aoleyun/sn/utils/SysSettingUtils.java b/app/src/main/java/com/aoleyun/sn/utils/SysSettingUtils.java index 7094ff0..d94dd31 100644 --- a/app/src/main/java/com/aoleyun/sn/utils/SysSettingUtils.java +++ b/app/src/main/java/com/aoleyun/sn/utils/SysSettingUtils.java @@ -73,6 +73,7 @@ public class SysSettingUtils { setNotification(context, jsonObject); setPanelShow(context, jsonObject); setDisAllowCamera(context, jsonObject); + setSettingsMenuShow(context, jsonObject); } @@ -100,7 +101,7 @@ public class SysSettingUtils { setWallpaper(context, 0); setCanReset(context, 0); setAutoTime(context, 1); - setBrowserInput(context, 1); + setBrowserInput(context, 0); if (!BuildConfig.DEBUG) { // JgyUtils.getInstance().setDeveloperOptions(0); } @@ -108,6 +109,8 @@ public class SysSettingUtils { setAdminApp(context, 1); setSystemAppDisable(context, 0); setNotification(context, 0); + setSettingsMenuShow(context); + } /** @@ -130,7 +133,7 @@ public class SysSettingUtils { setWallpaper(context, 0); setCanReset(context, 0); setAutoTime(context, 0); - setBrowserInput(context, 0); + setBrowserInput(context, 1); // JgyUtils.getInstance().setDeveloperOptions(1); setStatusBar(context, 0); setAdminApp(context, 0); @@ -1257,6 +1260,105 @@ public class SysSettingUtils { Log.e("setDisAllowCamera", "setDisAllowCamera: " + camera_ctrl); Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_DISALLOW_CAMERA, changeNum(camera_ctrl)); } + } + /** + * @param context + * @param jsonObject key的定义为:”wlan”:网络和互联网,”connected_devices”:已连接的设备,”apps”:应用,”notifications”:通知,”display”:显示, + * ”sound”:提示音,”storage”:存储,”battery”:电池,”wallpaper”:壁纸,”location”:位置信息,”system”:系统,”about”:关于。 + */ + private static void setSettingsMenuShow(Context context, JsonObject jsonObject) { + List menus = new ArrayList<>(); + // OTA升级管控 (默认允许) + int ota_upgrade_control = jsonObject.get("ota_upgrade_control").getAsInt(); + if (ota_upgrade_control == 0) { + menus.add("system_updates"); + } + // 生物识别和密码 (默认允许) + int biometric_and_password = jsonObject.get("biometric_and_password").getAsInt(); + if (biometric_and_password == 0) { + menus.add("biometrics_password"); + } + // 省电模式 (默认允许) + int power_saving_mode = jsonObject.get("power_saving_mode").getAsInt(); + if (power_saving_mode == 0) { + menus.add("battery"); + } + // 安全 (默认允许) + int security = jsonObject.get("security").getAsInt(); + if (security == 0) { + menus.add("security"); + } + // 大屏特色功能 (默认允许) + int large_screen_features = jsonObject.get("large_screen_features").getAsInt(); + if (large_screen_features == 0) { +// menus.add(""); + } + // 辅助功能 (默认允许) + int accessibility = jsonObject.get("accessibility").getAsInt(); + if (accessibility == 0) { + menus.add("accessibility"); + } + // 隐私 (默认允许) + int privacy = jsonObject.get("privacy").getAsInt(); + if (privacy == 0) { + menus.add("privacy"); + } + // 更多链接 (默认允许) + int more_links = jsonObject.get("more_links").getAsInt(); + if (more_links == 0) { + menus.add("more_connections"); + } + // 通知和状态栏 (默认允许) + int notification_and_status_bar = jsonObject.get("notification_and_status_bar").getAsInt(); + if (notification_and_status_bar == 0) { + menus.add("notifications"); + } + // 应用管理 (默认允许) + int app_management_general = jsonObject.get("app_management_general").getAsInt(); + if (app_management_general == 0) { + menus.add("apps"); + } + // 荣耀账号登录 (默认禁止) + int honor_account_login = jsonObject.get("honor_account_login").getAsInt(); + if (honor_account_login == 0) { + menus.add("honor_id"); + } + // 智慧互联 (默认禁止) + int smart_interconnect = jsonObject.get("smart_interconnect").getAsInt(); + if (smart_interconnect == 0) { + menus.add("super_device"); + } + // VPN管控 (默认禁止) + int vpn_control = jsonObject.get("vpn_control").getAsInt(); + if (vpn_control == 0) { + menus.add("vpn_settings"); + } + // 默认应用 (默认禁止) + int default_applications = jsonObject.get("default_applications").getAsInt(); + if (default_applications == 0) { +// menus.add(""); + } + // 应用分身 (默认禁止) + int app_cloning = jsonObject.get("app_cloning").getAsInt(); + if (app_cloning == 0) { + menus.add("apps_clone"); + } + // 应用启动管理 (默认禁止) + int app_startup_management = jsonObject.get("app_startup_management").getAsInt(); + if (app_startup_management == 0) { + menus.add("apps_startup_management"); + } + // 应用管理 (默认禁止) + int app_management_control = jsonObject.get("app_management_control").getAsInt(); + if (app_management_control == 0) { + menus.add("apps_management"); + menus.add("apps_honor_tips"); + } +// Settings.System.putString(context.getContentResolver(), CommonConfig.AOLE_SETTINGS_DISALLOW, String.join(",", menus)); + } + + private static void setSettingsMenuShow(Context context) { +// Settings.System.putString(context.getContentResolver(), CommonConfig.AOLE_SETTINGS_DISALLOW, ""); } } diff --git a/app/src/main/java/com/aoleyun/sn/utils/Utils.java b/app/src/main/java/com/aoleyun/sn/utils/Utils.java index ccd3a41..678459b 100644 --- a/app/src/main/java/com/aoleyun/sn/utils/Utils.java +++ b/app/src/main/java/com/aoleyun/sn/utils/Utils.java @@ -1833,6 +1833,7 @@ public class Utils { || JgyUtils.getInstance().checkAppPlatform() == JgyUtils.seewoPlatform || JgyUtils.getInstance().checkAppPlatform() == JgyUtils.U1302Platform || JgyUtils.getInstance().checkAppPlatform() == JgyUtils.MT6765Platform + || JgyUtils.getInstance().checkAppPlatform() == JgyUtils.G128TPlatform ) { return Utils.getProperty("ro.build.display.id", "获取失败"); } else {