diff --git a/app/build.gradle b/app/build.gradle index 607d62a..cf6f88d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -29,8 +29,8 @@ android { defaultConfig { applicationId "com.aoleyun.sn" - versionCode 105 - versionName "1.4.0117" + versionCode 107 + versionName "1.4.0202" //There are no CERT files because If the mini sdk version is 23+, the AGP will ignore the V1 scheme signature. minSdkVersion 24 @@ -183,6 +183,20 @@ android { } buildTypes { + YXPD1Debug.initWith(debug) + YXPD1Debug { + versionNameSuffix "-debug" + debuggable true + signingConfig signingConfigs.G10P + buildConfigField "String", "platform", '"YXPD1"' + } + + YXPD1Release.initWith(release) + YXPD1Release { + signingConfig signingConfigs.G10P + buildConfigField "String", "platform", '"YXPD1"' + } + c2Debug.initWith(debug) c2Debug { versionNameSuffix "-debug" diff --git a/app/src/main/java/com/aoleyun/sn/activity/SplashActivity.java b/app/src/main/java/com/aoleyun/sn/activity/SplashActivity.java index 8fe564a..002c298 100644 --- a/app/src/main/java/com/aoleyun/sn/activity/SplashActivity.java +++ b/app/src/main/java/com/aoleyun/sn/activity/SplashActivity.java @@ -67,10 +67,18 @@ public class SplashActivity extends AppCompatActivity { new Handler().postDelayed(() -> { startActivity(new Intent(SplashActivity.this, MainActivity.class)); finish(); +// sendBroadcastStatus("0"); // startActivity(new Intent(SplashActivity.this, CheckNetActivity.class)); }, 2000); } + public void sendBroadcastStatus(String status) { + Intent intent = new Intent("receiver"); + intent.setPackage("com.aoleyunos.dop7"); + intent.putExtra("login_status", status); + sendBroadcast(intent); + } + private void setBar() { UltimateBarX.statusBar(this) .transparent() @@ -145,11 +153,11 @@ public class SplashActivity extends AppCompatActivity { Log.i(TAG, "DebugTest: aole_hide_NavigationBar: " + Settings.System.getString(getContentResolver(), CommonConfig.AOLE_ACTION_HIDE_NAVIGATION_BAR)); String only_jgy_shortcut_list = Settings.System.getString(getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST); Log.i(TAG, "debugTest: only_jgy_shortcut_list:" + only_jgy_shortcut_list); - String aole_app_forbid = Settings.System.getString(getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID); - if (!TextUtils.isEmpty(aole_app_forbid)) { - 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); +// String aole_app_forbid = Settings.System.getString(getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID); +// if (!TextUtils.isEmpty(aole_app_forbid)) { +// 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: getPackage = " + Utils.getPackage()); Log.i(TAG, "debugTest: getMacAddress = " + Utils.getAndroid10MAC(this)); diff --git a/app/src/main/java/com/aoleyun/sn/network/NetInterfaceManager.java b/app/src/main/java/com/aoleyun/sn/network/NetInterfaceManager.java index 2c4633a..02e3c5a 100644 --- a/app/src/main/java/com/aoleyun/sn/network/NetInterfaceManager.java +++ b/app/src/main/java/com/aoleyun/sn/network/NetInterfaceManager.java @@ -1277,7 +1277,7 @@ public class NetInterfaceManager { JGYUtils.getInstance().installDesktop(data); setDefaultDesktop(desktopInfo.getApp_package()); } else { - Log.e("getDefaultDesktop", "onNext: " + "删除定制桌面"); + Log.e("getDefaultDesktop", "onNext: " + "删除定制桌面"); cacheHelper.put(UrlAddress.GET_DESKTOP, ""); // String whiteList = Settings.System.getString(mContext.getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST); for (String s : ApkUtils.desktopAPP) { @@ -2219,7 +2219,10 @@ public class NetInterfaceManager { // Log.e( "getLockedState", "onNext: " + "state changed , reset devices"); // Utils.doMasterClear(mContext); // } - if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.TeclastP20sPlatform) { + if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.TeclastP20sPlatform + || JGYUtils.getInstance().checkAppPlatform() == JGYUtils.C2Platform + || JGYUtils.getInstance().checkAppPlatform() == JGYUtils.YXPD1Platform + ) { JGYUtils.getInstance().showApp(PackageNames.YIXUEPAI_DESKTOP); JGYUtils.getInstance().setYxpDefaultDesktop(); } @@ -2228,7 +2231,10 @@ public class NetInterfaceManager { } else if (locked == JGYActions.NET_CODE_UNLOCKED) { // SysSettingUtils.setEnableSetting(mContext); JGYUtils.getInstance().writeAppPackageList(); - if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.TeclastP20sPlatform) { + if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.TeclastP20sPlatform + || JGYUtils.getInstance().checkAppPlatform() == JGYUtils.C2Platform + || JGYUtils.getInstance().checkAppPlatform() == JGYUtils.YXPD1Platform + ) { JGYUtils.getInstance().hideApp(PackageNames.YIXUEPAI_DESKTOP); JGYUtils.getInstance().setDefaultDesktop(); StatusBarManager mStatusBarManager = (StatusBarManager) mContext.getSystemService(Context.STATUS_BAR_SERVICE); @@ -2236,7 +2242,9 @@ public class NetInterfaceManager { } 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); } } else if (response.code == NOTFOUND) { Settings.System.putInt(mContext.getContentResolver(), JGYActions.ACTION_QCH_UNLOCK_IPAD, JGYActions.FRAME_CODE_LOCKED); @@ -2448,6 +2456,8 @@ public class NetInterfaceManager { tagSets.add(JGYUtils.G10PTag); } else if (platform == JGYUtils.C2Platform) { tagSets.add(JGYUtils.C2Tag); + } else if (platform == JGYUtils.YXPD1Platform) { + tagSets.add(JGYUtils.YXPD1TAG); } }); Log.e(TAG, "clearAndAppendTags: " + tagSets); @@ -3162,7 +3172,7 @@ public class NetInterfaceManager { 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(mContext, pkgString); + JGYUtils.getInstance().writeAppPackageList(pkgString); JGYUtils.getInstance().deleteOtherApp(); } } @@ -3198,7 +3208,7 @@ 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(mContext, result); + JGYUtils.getInstance().writeAppPackageList(result); JGYUtils.getInstance().deleteOtherApp(); } else { Settings.System.putString(mContext.getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST, ""); @@ -3507,7 +3517,7 @@ public class NetInterfaceManager { } else { if ("YX-T01".equalsIgnoreCase(Build.MODEL)) { JGYUtils.getInstance().setTongyiAppTop(); - }else { + } else { cacheHelper.put(UrlAddress.GET_TOP_APP_CONTROL, ""); ForegroundAppUtil.setTopAppClass(mContext, ""); Settings.Global.putString(mContext.getContentResolver(), ForegroundAppUtil.TOPAPP_KEY, ""); 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 9efb52b..2a3e5a3 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 @@ -413,7 +413,7 @@ 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"); } diff --git a/app/src/main/java/com/aoleyun/sn/utils/ApkUtils.java b/app/src/main/java/com/aoleyun/sn/utils/ApkUtils.java index ffe06de..53ce76d 100644 --- a/app/src/main/java/com/aoleyun/sn/utils/ApkUtils.java +++ b/app/src/main/java/com/aoleyun/sn/utils/ApkUtils.java @@ -791,6 +791,7 @@ public class ApkUtils { this.add("com.gl.dwlauncher"); this.add("com.qunyu.dividedroad"); this.add("com.ygyb.yischool"); + this.add("com.yxxmk.uiui"); this.add("com.uiui.floatwindow"); this.add("com.uiuipad.find"); this.add("com.uiuipad.appstore"); 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 3972cd1..ac637ed 100644 --- a/app/src/main/java/com/aoleyun/sn/utils/JGYUtils.java +++ b/app/src/main/java/com/aoleyun/sn/utils/JGYUtils.java @@ -133,6 +133,7 @@ public class JGYUtils { public static final int HRAD13Platform = 11; public static final int G10PPlatform = 12; public static final int C2Platform = 13; + public static final int YXPD1Platform = 15; public static final String Other = "其他"; @@ -146,6 +147,7 @@ public class JGYUtils { public static final String HRAD13Tag = "HRAD13"; public static final String G10PTag = "G10P"; public static final String C2Tag = "MTK8183"; + public static final String YXPD1TAG = "YXPD1"; private CacheHelper cacheHelper; @@ -261,6 +263,9 @@ public class JGYUtils { } else if (C2Tag.equalsIgnoreCase(platform)) { Log.i(TAG, "checkAppPlatform: " + "C2"); return C2Platform; + } else if (YXPD1TAG.equalsIgnoreCase(platform)) { + Log.i(TAG, "checkAppPlatform: " + "YXPD1"); + return YXPD1Platform; } else { Log.i(TAG, "checkAppPlatform: " + "没有数据"); return UnknowPlatform; @@ -303,6 +308,8 @@ public class JGYUtils { getAppPlatformCallback.AppPlatform(G10PPlatform); } else if (C2Tag.equalsIgnoreCase(platform)) { getAppPlatformCallback.AppPlatform(C2Platform); + } else if (YXPD1TAG.equalsIgnoreCase(platform)) { + getAppPlatformCallback.AppPlatform(YXPD1Platform); } else { getAppPlatformCallback.AppPlatform(UnknowPlatform); } @@ -1209,8 +1216,13 @@ public class JGYUtils { }}; @SuppressLint("NewApi") - public void writeAppPackageList(Context context, String packageList) { - ApkUtils.addShortcut(context); + public void writeAppPackageList(String packageList) { + if (isUnlocked(mContext)) { + addAppInstallWhiteList(new ArrayList<>()); + setAppRestriction(0); + return; + } + ApkUtils.addShortcut(mContext); HashSet pkgSet = new HashSet<>(Arrays.asList(packageList.split(","))); pkgSet.addAll(defaultPackages); pkgSet.addAll(ApkUtils.desktopAPP); @@ -1230,6 +1242,11 @@ public class JGYUtils { } public void writeAppPackageList() { + if (isUnlocked(mContext)) { + addAppInstallWhiteList(new ArrayList<>()); + setAppRestriction(0); + return; + } HashSet pkgSet = new HashSet<>(defaultPackages); pkgSet.addAll(ApkUtils.desktopAPP); pkgSet.addAll(ApkUtils.aoleyunAPP); @@ -1453,8 +1470,8 @@ public class JGYUtils { ) { return; } - int locked = Settings.System.getInt(crv, JGYActions.ACTION_QCH_UNLOCK_IPAD, 0); - if (locked == 1) { + + if (isUnlocked(mContext)) { return; } int aihuaUnlock = Settings.System.getInt(mContext.getContentResolver(), CommonConfig.AIHUA_UNLOCK, 0); @@ -1569,6 +1586,7 @@ public class JGYUtils { */ public void hideSystemAPP() { PackageManager pm = mContext.getPackageManager(); + pm.setApplicationEnabledSetting("com.yxxmk.uiui", PackageManager.COMPONENT_ENABLED_STATE_DEFAULT, 0); Intent filterIntent = new Intent(Intent.ACTION_MAIN, null); //Intent.CATEGORY_LAUNCHER主要的过滤条件 filterIntent.addCategory(Intent.CATEGORY_LAUNCHER); @@ -1583,6 +1601,7 @@ public class JGYUtils { } if (!showAppList.contains(pkg) && !ApkUtils.aoleyunAPP.contains(pkg) + && !ApkUtils.desktopAPP.contains(pkg) && !ApkUtils.aihuaApp.contains(pkg) ) { pm.setApplicationEnabledSetting(pkg, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0); @@ -1752,6 +1771,7 @@ public class JGYUtils { || JGYUtils.getInstance().checkAppPlatform() == JGYUtils.HRAD13Platform || JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G10PPlatform || JGYUtils.getInstance().checkAppPlatform() == JGYUtils.C2Platform + || JGYUtils.getInstance().checkAppPlatform() == JGYUtils.YXPD1Platform ) { Settings.Global.putInt(crv, Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, state == 1 ? 0 : 1); Settings.Global.putInt(crv, Settings.Global.ADB_ENABLED, state == 1 ? 0 : 1); @@ -2823,6 +2843,11 @@ public class JGYUtils { }}; + public static boolean isUnlocked(Context context) { + int locked = Settings.System.getInt(context.getContentResolver(), JGYActions.ACTION_QCH_UNLOCK_IPAD, JGYActions.FRAME_CODE_LOCKED); + return locked == JGYActions.FRAME_CODE_UNLOCKED; + } + /** * 启用/禁用MTP数据传输功能 * @@ -2895,7 +2920,7 @@ public class JGYUtils { * * @param pattern 0:普通模式(黑白名单都不生效),1:黑名单模式,2:白名单模式 **/ - void setAppRestriction(int pattern) { + public void setAppRestriction(int pattern) { if (C2Tag.equals(BuildConfig.platform)) { Log.e("ITools", "setAppRestriction: " + pattern); try { @@ -2924,7 +2949,7 @@ public class JGYUtils { * * @param packageNameList 包名列表 **/ - void addAppInstallWhiteList(List packageNameList) { + public void addAppInstallWhiteList(List packageNameList) { if (C2Tag.equals(BuildConfig.platform)) { Log.e("ITools", "addAppInstallWhiteList: " + packageNameList); try { 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 83a6571..c728824 100644 --- a/app/src/main/java/com/aoleyun/sn/utils/Utils.java +++ b/app/src/main/java/com/aoleyun/sn/utils/Utils.java @@ -1772,6 +1772,7 @@ public class Utils { || JGYUtils.getInstance().checkAppPlatform() == JGYUtils.HRAD13Platform || JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G10PPlatform || JGYUtils.getInstance().checkAppPlatform() == JGYUtils.C2Platform + || JGYUtils.getInstance().checkAppPlatform() == JGYUtils.YXPD1Platform ) { return Utils.getProperty("ro.build.display.id", "获取失败"); } else { diff --git a/build.gradle b/build.gradle index 2904269..6dc0260 100644 --- a/build.gradle +++ b/build.gradle @@ -5,9 +5,9 @@ buildscript { google() mavenCentral() maven { url "https://jitpack.io" } - maven {url 'http://developer.huawei.com/repo/'} - maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' } - maven { url 'http://maven.aliyun.com/nexus/content/repositories/releases/' } + maven { url 'https://developer.huawei.com/repo/' } + maven { url 'https://maven.aliyun.com/repository/central/' } + maven { url 'https://maven.aliyun.com/repository/public/' } } dependencies { classpath 'com.android.tools.build:gradle:3.6.4' @@ -22,9 +22,9 @@ allprojects { google() mavenCentral() maven { url "https://jitpack.io" } - maven {url 'http://developer.huawei.com/repo/'} - maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' } - maven { url 'http://maven.aliyun.com/nexus/content/repositories/releases/' } + maven { url 'https://developer.huawei.com/repo/' } + maven { url 'https://maven.aliyun.com/repository/central/' } + maven { url 'https://maven.aliyun.com/repository/public/' } } gradle.projectsEvaluated { tasks.withType(JavaCompile) {