mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-12 19:31:17 +08:00
细分 隐藏HD图标
This commit is contained in:
@@ -10,8 +10,8 @@ android {
|
|||||||
applicationId "com.lt2333.simplicitytools"
|
applicationId "com.lt2333.simplicitytools"
|
||||||
minSdk 30
|
minSdk 30
|
||||||
targetSdk 32
|
targetSdk 32
|
||||||
versionCode 8
|
versionCode 9
|
||||||
versionName '1.0.7'
|
versionName '1.0.8'
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -290,34 +290,67 @@ class SystemUI : IXposedHookLoadPackage {
|
|||||||
)
|
)
|
||||||
XposedHelpers.findAndHookMethod(
|
XposedHelpers.findAndHookMethod(
|
||||||
classIfExists,
|
classIfExists,
|
||||||
"initViewState","com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$MobileIconState",
|
"initViewState",
|
||||||
|
"com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$MobileIconState",
|
||||||
object : XC_MethodHook() {
|
object : XC_MethodHook() {
|
||||||
override fun afterHookedMethod(param: MethodHookParam) {
|
override fun afterHookedMethod(param: MethodHookParam) {
|
||||||
if (prefs.hasFileChanged()) {
|
if (prefs.hasFileChanged()) {
|
||||||
prefs.reload()
|
prefs.reload()
|
||||||
}
|
}
|
||||||
if (prefs.getBoolean("hide_hd_icon", false)) {
|
if (prefs.getBoolean("hide_big_hd_icon", false)) {
|
||||||
val smallHd = XposedHelpers.getObjectField(param.thisObject, "mSmallHd") as ImageView
|
val bigHd = XposedHelpers.getObjectField(
|
||||||
val bigHd = XposedHelpers.getObjectField(param.thisObject, "mVolte") as ImageView
|
param.thisObject,
|
||||||
smallHd.visibility = View.GONE
|
"mVolte"
|
||||||
|
) as ImageView
|
||||||
bigHd.visibility = View.GONE
|
bigHd.visibility = View.GONE
|
||||||
}
|
}
|
||||||
|
if (prefs.getBoolean("hide_small_hd_icon", false)) {
|
||||||
|
val smallHd = XposedHelpers.getObjectField(
|
||||||
|
param.thisObject,
|
||||||
|
"mSmallHd"
|
||||||
|
) as ImageView
|
||||||
|
smallHd.visibility = View.GONE
|
||||||
|
}
|
||||||
|
if (prefs.getBoolean("hide_hd_no_service_icon", false)) {
|
||||||
|
val volteNoService = XposedHelpers.getObjectField(
|
||||||
|
param.thisObject,
|
||||||
|
"mVolteNoService"
|
||||||
|
) as ImageView
|
||||||
|
volteNoService.visibility = View.GONE
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
XposedHelpers.findAndHookMethod(
|
XposedHelpers.findAndHookMethod(
|
||||||
classIfExists,
|
classIfExists,
|
||||||
"updateState","com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$MobileIconState",
|
"updateState",
|
||||||
|
"com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$MobileIconState",
|
||||||
object : XC_MethodHook() {
|
object : XC_MethodHook() {
|
||||||
override fun afterHookedMethod(param: MethodHookParam) {
|
override fun afterHookedMethod(param: MethodHookParam) {
|
||||||
if (prefs.hasFileChanged()) {
|
if (prefs.hasFileChanged()) {
|
||||||
prefs.reload()
|
prefs.reload()
|
||||||
}
|
}
|
||||||
if (prefs.getBoolean("hide_hd_icon", false)) {
|
if (prefs.getBoolean("hide_big_hd_icon", false)) {
|
||||||
val smallHd = XposedHelpers.getObjectField(param.thisObject, "mSmallHd") as ImageView
|
val bigHd = XposedHelpers.getObjectField(
|
||||||
val bigHd = XposedHelpers.getObjectField(param.thisObject, "mVolte") as ImageView
|
param.thisObject,
|
||||||
smallHd.visibility = View.GONE
|
"mVolte"
|
||||||
|
) as ImageView
|
||||||
bigHd.visibility = View.GONE
|
bigHd.visibility = View.GONE
|
||||||
}
|
}
|
||||||
|
if (prefs.getBoolean("hide_small_hd_icon", false)) {
|
||||||
|
val smallHd = XposedHelpers.getObjectField(
|
||||||
|
param.thisObject,
|
||||||
|
"mSmallHd"
|
||||||
|
) as ImageView
|
||||||
|
|
||||||
|
smallHd.visibility = View.GONE
|
||||||
|
}
|
||||||
|
if (prefs.getBoolean("hide_hd_no_service_icon", false)) {
|
||||||
|
val volteNoService = XposedHelpers.getObjectField(
|
||||||
|
param.thisObject,
|
||||||
|
"mVolteNoService"
|
||||||
|
) as ImageView
|
||||||
|
volteNoService.visibility = View.GONE
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
|
|||||||
Reference in New Issue
Block a user