From ff09f77b43a43c2c585187804be534e25b2d3702 Mon Sep 17 00:00:00 2001 From: xiao_wine <68009112+xiaowine@users.noreply.github.com> Date: Sun, 2 Oct 2022 16:34:29 +0800 Subject: [PATCH] Merge pull request #192 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 同步blockmiui上游 * 同步blockmiui上游 * Merge branch 'Simplicity-Team:main' into main * 删除一个log * 添加 隐藏新HD图标(随缘多语言文件) * Merge remote-tracking branch 'origin/main' * 添加 开机免输密码 * strings.xml --- .../activity/SettingsActivity.kt | 4 +++- .../simplicitytools/hook/app/SystemUI.kt | 1 + .../hook/app/systemui/HideHDIcon.kt | 13 +++++++++--- .../hook/app/systemui/NoPasswordHook.kt | 21 +++++++++++++++++++ app/src/main/res/values-es/strings.xml | 1 + app/src/main/res/values-zh-rCN/strings.xml | 3 +++ app/src/main/res/values-zh-rHK/strings.xml | 4 ++++ app/src/main/res/values-zh-rTW/strings.xml | 3 +++ app/src/main/res/values/strings.xml | 3 +++ blockmiui | 2 +- 10 files changed, 50 insertions(+), 5 deletions(-) create mode 100644 app/src/main/java/com/lt2333/simplicitytools/hook/app/systemui/NoPasswordHook.kt diff --git a/app/src/main/java/com/lt2333/simplicitytools/activity/SettingsActivity.kt b/app/src/main/java/com/lt2333/simplicitytools/activity/SettingsActivity.kt index 62a0a4bd..42353191 100644 --- a/app/src/main/java/com/lt2333/simplicitytools/activity/SettingsActivity.kt +++ b/app/src/main/java/com/lt2333/simplicitytools/activity/SettingsActivity.kt @@ -30,7 +30,7 @@ class SettingsActivity : MIUIActivity() { override fun onCreate(savedInstanceState: Bundle?) { if (!checkLSPosed()) isLoad = false super.onCreate(savedInstanceState) - if (isLoad && BuildConfig.BUILD_TYPE != "debug") { + if (isLoad && !BuildConfig.DEBUG) { AppCenter.start(application, "ae2037d3-9914-4e0c-b02b-f9b2bb2574e5", Analytics::class.java, Crashes::class.java) } } @@ -438,6 +438,7 @@ class SettingsActivity : MIUIActivity() { TextSummaryWithSwitch(TextSummaryV(textId = R.string.enable_wave_charge_animation), SwitchV("enable_wave_charge_animation")) TextSummaryWithSwitch(TextSummaryV(textId = R.string.lock_screen_charging_current, tipsId = R.string.only_official_default_themes_are_supported), SwitchV("lock_screen_charging_current")) TextSummaryWithSwitch(TextSummaryV(textId = R.string.double_tap_to_sleep, tipsId = R.string.home_double_tap_to_sleep_summary), SwitchV("lock_screen_double_tap_to_sleep")) + TextSummaryWithSwitch(TextSummaryV(textId = R.string.no_need_to_enter_password_when_power_on, tipsId = R.string.no_need_to_enter_password_when_power_on_summary), SwitchV("no_need_to_enter_password_when_power_on")) Line() TitleText(textId = R.string.old_quick_settings_panel) val oldQSCustomSwitchBinding = GetDataBinding({ safeSP.getBoolean("old_qs_custom_switch", false) }) { view, flags, data -> @@ -565,6 +566,7 @@ class SettingsActivity : MIUIActivity() { TextWithSwitch(TextV(textId = R.string.hide_bluetooth_battery_icon), SwitchV("hide_bluetooth_battery_icon")) TextWithSwitch(TextV(textId = R.string.hide_small_hd_icon), SwitchV("hide_small_hd_icon")) TextWithSwitch(TextV(textId = R.string.hide_big_hd_icon), SwitchV("hide_big_hd_icon")) + TextWithSwitch(TextV(textId = R.string.hide_new_hd_icon), SwitchV("hide_new_hd_icon")) TextWithSwitch(TextV(textId = R.string.hide_hd_no_service_icon), SwitchV("hide_hd_no_service_icon")) TextWithSwitch(TextV(textId = R.string.hide_no_sim_icon), SwitchV("hide_no_sim_icon")) TextWithSwitch(TextV(textId = R.string.hide_sim_one_icon), SwitchV("hide_sim_one_icon")) diff --git a/app/src/main/java/com/lt2333/simplicitytools/hook/app/SystemUI.kt b/app/src/main/java/com/lt2333/simplicitytools/hook/app/SystemUI.kt index bcb4add9..fc1cd30a 100644 --- a/app/src/main/java/com/lt2333/simplicitytools/hook/app/SystemUI.kt +++ b/app/src/main/java/com/lt2333/simplicitytools/hook/app/SystemUI.kt @@ -41,6 +41,7 @@ object SystemUI: AppRegister() { CanNotificationSlide, //允许下滑通知打开小窗 LockScreenClockDisplaySeconds, // 锁屏时钟显示秒 ShowWifiStandard, // 显示 WIFI 角标 + NoPasswordHook, // 显示 WIFI 角标 ) } } \ No newline at end of file diff --git a/app/src/main/java/com/lt2333/simplicitytools/hook/app/systemui/HideHDIcon.kt b/app/src/main/java/com/lt2333/simplicitytools/hook/app/systemui/HideHDIcon.kt index 7d921bd3..ff119161 100644 --- a/app/src/main/java/com/lt2333/simplicitytools/hook/app/systemui/HideHDIcon.kt +++ b/app/src/main/java/com/lt2333/simplicitytools/hook/app/systemui/HideHDIcon.kt @@ -2,9 +2,9 @@ package com.lt2333.simplicitytools.hook.app.systemui import android.view.View import android.widget.ImageView -import com.github.kyuubiran.ezxhelper.utils.findMethod -import com.github.kyuubiran.ezxhelper.utils.getObjectAs -import com.github.kyuubiran.ezxhelper.utils.hookAfter +import android.util.Log +import com.github.kyuubiran.ezxhelper.utils.* +import com.lt2333.simplicitytools.util.XSPUtils import com.lt2333.simplicitytools.util.hasEnable import com.lt2333.simplicitytools.util.xposed.base.HookRegister import de.robv.android.xposed.XC_MethodHook @@ -12,6 +12,8 @@ import de.robv.android.xposed.XC_MethodHook object HideHDIcon : HookRegister() { override fun init() { + + findMethod("com.android.systemui.statusbar.StatusBarMobileView") { name == "initViewState" && parameterCount == 1 }.hookAfter { @@ -23,6 +25,11 @@ object HideHDIcon : HookRegister() { }.hookAfter { hide(it) } + hasEnable("hide_new_hd_icon") { + findMethod("com.android.systemui.statusbar.policy.HDController") { name == "update" }.hookBefore { + it.result = null + } + } } private fun hide(it: XC_MethodHook.MethodHookParam) { diff --git a/app/src/main/java/com/lt2333/simplicitytools/hook/app/systemui/NoPasswordHook.kt b/app/src/main/java/com/lt2333/simplicitytools/hook/app/systemui/NoPasswordHook.kt new file mode 100644 index 00000000..c391a5a6 --- /dev/null +++ b/app/src/main/java/com/lt2333/simplicitytools/hook/app/systemui/NoPasswordHook.kt @@ -0,0 +1,21 @@ +package com.lt2333.simplicitytools.hook.app.systemui + +import com.github.kyuubiran.ezxhelper.utils.findMethod +import com.github.kyuubiran.ezxhelper.utils.hookBefore +import com.lt2333.simplicitytools.util.hasEnable +import com.lt2333.simplicitytools.util.xposed.base.HookRegister + +object NoPasswordHook : HookRegister() { + + override fun init() { + hasEnable("no_need_to_enter_password_when_power_on") { + findMethod("com.android.internal.widget.LockPatternUtils\$StrongAuthTracker") { name == "isBiometricAllowedForUser" }.hookBefore { + it.result = true + } + findMethod("com.android.internal.widget.LockPatternUtils") { name == "isBiometricAllowedForUser" }.hookBefore { + it.result = true + } + } + + } +} \ No newline at end of file diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 659cef36..45e690d5 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -29,6 +29,7 @@ Ocultar icono de NFC Ocultar icono grande HD Ocultar icono pequeño HD + Ocultar icono new HD Ocultar icono sin servicio HD Acerca de Acerca del Módulo diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 390342e5..6ba08140 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -29,6 +29,7 @@ 隐藏 NFC 图标 隐藏 大HD 图标 隐藏 小HD 图标 + 隐藏 新HD 图标 隐藏 HD无服务 图标 关于 关于模块 @@ -161,6 +162,8 @@ 隐藏 勿扰 图标 隐藏图标 双击锁定屏幕 + 开机免输密码 + 手机没启用加密才会生效 双击空白位置锁屏 旧版快速设置面板 自定义行列数 diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index f6440a9e..2414bbcc 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -27,6 +27,7 @@ 隱藏 藍牙電量 圖標 隱藏 大HD 圖標 隱藏 小HD 圖標 + 隱藏 新HD 圖標 隱藏 HD無服務 圖標 關於 關於模塊 @@ -156,4 +157,7 @@ 隱藏 勿擾 圖標 隱藏圖標 雙擊鎖定螢幕 + + 開機免輸密碼 + 手機沒啟用加密才會生效 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 179bfd30..cd341f82 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -29,6 +29,7 @@ 隱藏 NFC 圖示 隱藏 大HD 圖示 隱藏 小HD 圖示 + 隱藏 新HD 圖標 隱藏 HD無服務 圖示 關於 關於模組 @@ -161,6 +162,8 @@ 隱藏 勿擾 圖示 隱藏圖示 雙擊鎖定螢幕 + 開機免輸密碼 + 手機沒加啟用密才會生效 雙擊空白位置鎖定螢幕 舊快速設定面板 自定義行與列 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 24a3cfd0..e6c145fc 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -31,6 +31,7 @@ Hide NFC icon Hide big HD icon Hide small HD icon + Hide new HD icon Hide HD No Service icon About @@ -165,6 +166,8 @@ Hide ZEN icon Hide Icon Double tap to sleep + No need to enter password when power on + The phone is not encrypted to take effect Double-tap the blank space to sleep Old quick settings panel Custom rows and columns diff --git a/blockmiui b/blockmiui index 63e7817f..20c45e6f 160000 --- a/blockmiui +++ b/blockmiui @@ -1 +1 @@ -Subproject commit 63e7817f3f3fa73a4049f2cf227943d2454e7e5e +Subproject commit 20c45e6f26c422df848688f43f639a80c43c39f4