mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-12 19:31:17 +08:00
Compare commits
1 Commits
main
...
revert-233
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
519ded1f75 |
@@ -2,24 +2,22 @@ package com.lt2333.simplicitytools.hooks.rules.t.systemui
|
||||
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||
import com.github.kyuubiran.ezxhelper.utils.putObject
|
||||
import com.lt2333.simplicitytools.utils.getObjectField
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
|
||||
object HideSimIconForT : HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
findMethod("com.android.systemui.statusbar.StatusBarMobileView") {
|
||||
name == "applyMobileState"
|
||||
findMethod("com.android.systemui.statusbar.phone.StatusBarSignalPolicy") {
|
||||
name == "hasCorrectSubs" && parameterTypes[0] == MutableList::class.java
|
||||
}.hookBefore {
|
||||
val mobileIconState = it.args[0]
|
||||
val subId = mobileIconState.getObjectField("subId") as Int
|
||||
hasEnable("hide_sim_one_icon", extraCondition = { subId == 1 }) {
|
||||
mobileIconState.putObject("visible", false)
|
||||
val list = it.args[0] as MutableList<*>
|
||||
val size = list.size
|
||||
hasEnable("hide_sim_two_icon", extraCondition = { size == 2 }) {
|
||||
list.removeAt(1)
|
||||
}
|
||||
hasEnable("hide_sim_two_icon", extraCondition = { subId == 2 }) {
|
||||
mobileIconState.putObject("visible", false)
|
||||
hasEnable("hide_sim_one_icon", extraCondition = { size >= 1 }) {
|
||||
list.removeAt(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user