From 60e6316149e93b3f2fdeefe9381f727a072ea108 Mon Sep 17 00:00:00 2001 From: Fanhuitong <981964879@qq.com> Date: Mon, 30 Oct 2023 16:23:32 +0800 Subject: [PATCH] =?UTF-8?q?1.0.9=20=E4=BC=98=E5=8C=96=E7=AE=A1=E6=8E=A7,?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=8A=B6=E6=80=81=E6=A0=8F=E7=AE=A1=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 20 +++++- app/keystore/U807userdebug.keystore | Bin 0 -> 2554 bytes .../com/uiuipad/find/util/ControlUtils.java | 68 ++++++++++++------ niceimageview/build.gradle | 1 + verification-view/build.gradle | 1 + 5 files changed, 68 insertions(+), 22 deletions(-) create mode 100644 app/keystore/U807userdebug.keystore diff --git a/app/build.gradle b/app/build.gradle index d13150e..ed2e5f8 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -16,8 +16,8 @@ android { applicationId "com.uiuipad.find" minSdkVersion 24 targetSdkVersion 29 - versionCode 8 - versionName "1.0.7" + versionCode 10 + versionName "1.0.9" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -73,9 +73,25 @@ android { keyPassword "123456" v2SigningEnabled false } + + U807UserDebug { + storeFile file("keystore/U807userdebug.keystore") + storePassword "123456" + keyAlias "u807userdebug" + keyPassword "123456" + v2SigningEnabled false + } } buildTypes { + U807UserDebug.initWith(release) + U807UserDebug { + buildConfigField "String", "platform", '"U807"' +// versionNameSuffix "-debug" +// debuggable true + signingConfig signingConfigs.U807UserDebug + } + U807Debug.initWith(debug) U807Debug { buildConfigField "String", "platform", '"U807"' diff --git a/app/keystore/U807userdebug.keystore b/app/keystore/U807userdebug.keystore new file mode 100644 index 0000000000000000000000000000000000000000..af7ecd863040d4d219e4112d99cded931a679424 GIT binary patch literal 2554 zcmd6o`9IYA9>-@TGQ^03Fc@6>ckFA4lBp!SBugRdVC*;B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z`dJ=~|HqIA7-S`G((+1E*l(W0%ivM;%%l%DNJ=|4j}|%=+^q9>h%cfta8*R!lG^7u z(xWh?G;jKx^=&No@Byoq4Zpqt+=%!{kk}xDGJF=>_yQ~SA!>(xj%!NJ!Z}=YY3&BA zA2W%3k)ckBBcdY;MZ`VwVOyiT=`FCOoluh~YYKWfAMllv*e*0+_Q zKKyC!0G`G>g1&3J+km)5+?BMOQpegftt1Pihy>bV1@QZ>ZzE@Ct-ByO%Axla~a^arpRI|Tp$ literal 0 HcmV?d00001 diff --git a/app/src/main/java/com/uiuipad/find/util/ControlUtils.java b/app/src/main/java/com/uiuipad/find/util/ControlUtils.java index d9b9953..97ad205 100644 --- a/app/src/main/java/com/uiuipad/find/util/ControlUtils.java +++ b/app/src/main/java/com/uiuipad/find/util/ControlUtils.java @@ -1,14 +1,18 @@ package com.uiuipad.find.util; +import android.annotation.SuppressLint; import android.app.ActivityManager; +import android.app.StatusBarManager; import android.content.Context; import android.content.Intent; +import android.os.Build; import android.os.PowerManager; import android.provider.Settings; import android.util.Log; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; import com.uiuipad.find.BuildConfig; import com.uiuipad.find.bean.kuxin.SnSetting; @@ -140,8 +144,9 @@ public class ControlUtils { setBluetooth(context, 0); setDeveloperOptions(context, 0); setCanReset(context, 0); - setActionBar(context, 0); - setNavigationBar(context, 0); + setActionBar(context, 1); +// setNavigationBar(context, 0); + setStatusBar(context); setTF(context, 0); } else { int is_storeinstall = snSetting.getIs_storeinstall(); @@ -168,7 +173,8 @@ public class ControlUtils { setDeveloperOptions(context, 0); setCanReset(context, 0); setActionBar(context, 0); - setNavigationBar(context, 0); +// setNavigationBar(context, 0); + setStatusBar(context); setTF(context, 0); } @@ -193,7 +199,8 @@ public class ControlUtils { } private static void setBluetooth(Context context, int status) { - boolean aole_bht_forbid_on = Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_BHT_FORBID_ON, status); + int code = status == 1 ? 0 : 1; + boolean aole_bht_forbid_on = Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_BHT_FORBID_ON, code); } @@ -224,9 +231,9 @@ public class ControlUtils { private static void setCanReset(Context context, int status) { if (status == 1) { - Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_RESTORE_FORBID_ON, 0); + Settings.Global.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_RESTORE_FORBID_ON, 0); } else { - Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_RESTORE_FORBID_ON, 1); + Settings.Global.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_RESTORE_FORBID_ON, 1); } Log.e(TAG, "aole_restore_forbid_on:" + status); } @@ -236,20 +243,41 @@ public class ControlUtils { * @param status 系统导航条显示开关 */ private static void setNavigationBar(Context context, int status) { - boolean aole_hide_NavigationBar = Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_HIDE_NAVIGATION_BAR, status); - Log.e("SystemSetting", "aole_hide_NavigationBar:" + aole_hide_NavigationBar); - String navigationStatus = ""; - switch (status) { - case 0: - navigationStatus = CommonConfig.AOLE_ACTION_SHOW_NAVIGATION_BAR; - break; - case 1: - navigationStatus = CommonConfig.AOLE_ACTION_HIDE_NAVIGATION_BAR; - break; - default: +// boolean aole_hide_NavigationBar = Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_HIDE_NAVIGATION_BAR, status); +// Log.e("SystemSetting", "aole_hide_NavigationBar:" + aole_hide_NavigationBar); +// String navigationStatus = ""; +// switch (status) { +// case 0: +// navigationStatus = CommonConfig.AOLE_ACTION_SHOW_NAVIGATION_BAR; +// break; +// case 1: +// navigationStatus = CommonConfig.AOLE_ACTION_HIDE_NAVIGATION_BAR; +// break; +// default: +// } +// Intent navIntent = new Intent(navigationStatus).setPackage("com.android.systemui"); +// context.sendBroadcast(navIntent); + + if (status == 0) { + hideHomeRecent(context); + } else { + setStatusBar(context); } - Intent navIntent = new Intent(navigationStatus).setPackage("com.android.systemui"); - context.sendBroadcast(navIntent); + } + + @RequiresApi(api = Build.VERSION_CODES.Q) + private static void hideHomeRecent(Context context) { + StatusBarManager statusBarManager = (StatusBarManager) context.getSystemService(Context.STATUS_BAR_SERVICE); + int what = StatusBarManager.DISABLE_HOME | StatusBarManager.DISABLE_RECENT; + statusBarManager.disable(what); + } + + @SuppressLint("NewApi") + private static void setStatusBar(Context context) { + Log.e(TAG, "setStatusBar: " + "default"); + StatusBarManager mStatusBarManager = (StatusBarManager) context.getSystemService(Context.STATUS_BAR_SERVICE); + mStatusBarManager.disable(StatusBarManager.DISABLE_BACK | StatusBarManager.DISABLE_RECENT | StatusBarManager.DISABLE_HOME); + mStatusBarManager.disable(StatusBarManager.DISABLE_NONE);//显示隐藏的虚拟按键 } /** @@ -258,7 +286,7 @@ public class ControlUtils { */ private static void setActionBar(Context context, int status) { Log.e(TAG, "setActionBar: " + status); - Settings.Global.putInt(context.getContentResolver(), "PULLDOWN_MENU_ENABLED", status); + Settings.Global.putInt(context.getContentResolver(), "pulldown_menu_enabled", status); // int oldNum = Settings.System.getInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR, 0); // if (oldNum != status) { // boolean aole_hide_statusBar = Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR, status); diff --git a/niceimageview/build.gradle b/niceimageview/build.gradle index 3801991..28f7369 100644 --- a/niceimageview/build.gradle +++ b/niceimageview/build.gradle @@ -11,6 +11,7 @@ android { } buildTypes { + U807UserDebug {} U807Debug {} U807Release {} iPlay50SEDebug {} diff --git a/verification-view/build.gradle b/verification-view/build.gradle index c77df94..ce2ee75 100644 --- a/verification-view/build.gradle +++ b/verification-view/build.gradle @@ -13,6 +13,7 @@ android { } buildTypes { + U807UserDebug {} U807Debug {} U807Release {} iPlay50SEDebug {}