新增 隐藏辅助WIFI图标 功能

This commit is contained in:
LittleTurtle2333
2022-02-20 01:20:14 +08:00
parent 7b3047a02a
commit c3dc9be0a4
3 changed files with 29 additions and 0 deletions

View File

@@ -140,6 +140,12 @@ class SettingsActivity : MIUIActivity() {
)
)
add(TextWithSwitchV(TextV(resId = R.string.hide_wifi_icon), SwitchV("hide_wifi_icon")))
add(
TextWithSwitchV(
TextV(resId = R.string.hide_slave_wifi_icon),
SwitchV("hide_slave_wifi_icon")
)
)
add(
TextWithSwitchV(
TextV(resId = R.string.hide_hotspot_icon),

View File

@@ -255,6 +255,28 @@ class SystemUI : IXposedHookLoadPackage {
} catch (e: Exception) {
XposedBridge.log(e)
}
//隐藏 辅助WIFI 图标
try {
val classIfExists = XposedHelpers.findClassIfExists(
"com.android.systemui.statusbar.policy.SlaveWifiSignalController",
lpparam.classLoader
)
XposedHelpers.findAndHookMethod(
classIfExists,
"updateIconState",
object : XC_MethodHook() {
override fun beforeHookedMethod(param: MethodHookParam) {
if (prefs.hasFileChanged()) {
prefs.reload()
}
if (prefs.getBoolean("hide_slave_wifi_icon", false)) {
param.result = null
}
}
})
} catch (e: Exception) {
XposedBridge.log(e)
}
//隐藏卡一卡二
try {
val classIfExists = XposedHelpers.findClassIfExists(