From ee948f5327418bf2c654a0fced709cea5a998261 Mon Sep 17 00:00:00 2001 From: fankesyooni Date: Tue, 7 Feb 2023 00:50:55 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20"onDarkChanged"=20method=20params=20not?= =?UTF-8?q?=20correct=20on=20MIUI=2012=E3=80=8112.5=E3=80=8113=20based=20o?= =?UTF-8?q?n=20Android=2011=20in=20SystemUIHooker?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fankes/miui/notify/hook/entity/SystemUIHooker.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/fankes/miui/notify/hook/entity/SystemUIHooker.kt b/app/src/main/java/com/fankes/miui/notify/hook/entity/SystemUIHooker.kt index d437525..2eaceeb 100644 --- a/app/src/main/java/com/fankes/miui/notify/hook/entity/SystemUIHooker.kt +++ b/app/src/main/java/com/fankes/miui/notify/hook/entity/SystemUIHooker.kt @@ -63,9 +63,7 @@ import com.highcapable.yukihookapi.hook.factory.* import com.highcapable.yukihookapi.hook.log.loggerD import com.highcapable.yukihookapi.hook.log.loggerW 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.FloatType import com.highcapable.yukihookapi.hook.type.java.IntType import top.defaults.drawabletoolbox.DrawableBuilder @@ -779,7 +777,7 @@ object SystemUIHooker : YukiBaseHooker() { injectMember { method { name = "onDarkChanged" - param(VagueType, FloatType, IntType) + paramCount { it > 0 } } afterHook { field { name = "mNotificationIcons" }.get(instance).cast()?.also { @@ -794,7 +792,7 @@ object SystemUIHooker : YukiBaseHooker() { isDarkIconMode = false updateStatusBarIconColor(it, isDarkIconMode = false) } - else -> updateStatusBarIconColor(it, isDarkIconMode = false, args().last().int()) + else -> updateStatusBarIconColor(it, isDarkIconMode = false, args(index = 2).int()) } } }