From b986c2df1814a6b3c630cbbf77b6d69dde79b659 Mon Sep 17 00:00:00 2001 From: fankesyooni Date: Thu, 30 Jun 2022 19:41:33 +0800 Subject: [PATCH] Fix MIUI style notification hook failed when SystemUI not Re-optimize --- .../com/fankes/miui/notify/hook/entity/SystemUIHooker.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 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 2395351..4457623 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 @@ -824,10 +824,15 @@ object SystemUIHooker : YukiBaseHooker() { } /** 修改 MIUI 风格通知栏的通知图标 */ MiuiNotificationViewWrapperClass.hook { - /** 替换通知小图标 */ + /** 干掉设置通知小图标 */ injectMember { method { name = "handleAppIcon" } - replaceUnit { + intercept() + } + /** 替换 MIUI 通知小图标 */ + injectMember { + method { name = "onContentUpdated" } + afterHook { field { name = "mAppIcon" }.get(instance).cast()?.clone { compatNotifyIcon( context = context,