mirror of
https://github.com/fankes/MIUINativeNotifyIcon.git
synced 2025-09-06 02:35:32 +08:00
Fix "onDarkChanged" method params not correct on MIUI 12、12.5、13 based on Android 11 in SystemUIHooker
This commit is contained in:
@@ -63,9 +63,7 @@ import com.highcapable.yukihookapi.hook.factory.*
|
|||||||
import com.highcapable.yukihookapi.hook.log.loggerD
|
import com.highcapable.yukihookapi.hook.log.loggerD
|
||||||
import com.highcapable.yukihookapi.hook.log.loggerW
|
import com.highcapable.yukihookapi.hook.log.loggerW
|
||||||
import com.highcapable.yukihookapi.hook.type.android.*
|
import com.highcapable.yukihookapi.hook.type.android.*
|
||||||
import com.highcapable.yukihookapi.hook.type.defined.VagueType
|
|
||||||
import com.highcapable.yukihookapi.hook.type.java.BooleanType
|
import com.highcapable.yukihookapi.hook.type.java.BooleanType
|
||||||
import com.highcapable.yukihookapi.hook.type.java.FloatType
|
|
||||||
import com.highcapable.yukihookapi.hook.type.java.IntType
|
import com.highcapable.yukihookapi.hook.type.java.IntType
|
||||||
import top.defaults.drawabletoolbox.DrawableBuilder
|
import top.defaults.drawabletoolbox.DrawableBuilder
|
||||||
|
|
||||||
@@ -779,7 +777,7 @@ object SystemUIHooker : YukiBaseHooker() {
|
|||||||
injectMember {
|
injectMember {
|
||||||
method {
|
method {
|
||||||
name = "onDarkChanged"
|
name = "onDarkChanged"
|
||||||
param(VagueType, FloatType, IntType)
|
paramCount { it > 0 }
|
||||||
}
|
}
|
||||||
afterHook {
|
afterHook {
|
||||||
field { name = "mNotificationIcons" }.get(instance).cast<ViewGroup>()?.also {
|
field { name = "mNotificationIcons" }.get(instance).cast<ViewGroup>()?.also {
|
||||||
@@ -794,7 +792,7 @@ object SystemUIHooker : YukiBaseHooker() {
|
|||||||
isDarkIconMode = false
|
isDarkIconMode = false
|
||||||
updateStatusBarIconColor(it, isDarkIconMode = false)
|
updateStatusBarIconColor(it, isDarkIconMode = false)
|
||||||
}
|
}
|
||||||
else -> updateStatusBarIconColor(it, isDarkIconMode = false, args().last().int())
|
else -> updateStatusBarIconColor(it, isDarkIconMode = false, args(index = 2).int())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user