From 7b4b728523c282ec3469f155f442a9856085dcc6 Mon Sep 17 00:00:00 2001 From: Fankesyooni Date: Fri, 18 Feb 2022 04:04:04 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E4=B8=8D=E5=BF=85=E8=A6=81?= =?UTF-8?q?=E7=9A=84=20Hook=EF=BC=8C=E4=BF=AE=E5=A4=8D=20MIUI=2012=20?= =?UTF-8?q?=E4=B8=8B=E4=BE=9D=E7=84=B6=E5=8D=A1=E9=A1=BF=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fankes/miui/notify/hook/HookEntry.kt | 30 ------------------- 1 file changed, 30 deletions(-) diff --git a/app/src/main/java/com/fankes/miui/notify/hook/HookEntry.kt b/app/src/main/java/com/fankes/miui/notify/hook/HookEntry.kt index f5e960e..6c0df03 100644 --- a/app/src/main/java/com/fankes/miui/notify/hook/HookEntry.kt +++ b/app/src/main/java/com/fankes/miui/notify/hook/HookEntry.kt @@ -76,9 +76,6 @@ class HookEntry : YukiHookXposedInitProxy { private const val NotificationViewWrapperClass = "$SYSTEMUI_PACKAGE_NAME.statusbar.notification.NotificationViewWrapper" - /** 原生存在的类 */ - private const val StatusBarIconViewClass = "$SYSTEMUI_PACKAGE_NAME.statusbar.StatusBarIconView" - /** 原生存在的类 */ private const val ContrastColorUtilClass = "com.android.internal.util.ContrastColorUtil" @@ -478,33 +475,6 @@ class HookEntry : YukiHookXposedInitProxy { } } } - StatusBarIconViewClass.hook { - /** 修复通知图标为彩色 - MIPUSH 修复 */ - injectMember { - method { name = "updateIconColor" } - afterHook { - /** 获取自身 */ - val iconImageView = instance() ?: return@afterHook - - /** 获取通知实例 */ - val expandedNf = field { name = "mNotification" }.of(instance) - - /** 对于之前没有通知图标色彩判断功能的版本判断是 MIUI 样式就停止 Hook */ - if (!hasIgnoreStatusBarIconColor() && isShowMiuiStyle()) return@afterHook - - /** - * 强制重新进行设置图标 - * 防止 MIPUSH 不生效 - */ - if (expandedNf?.isXmsf == true) - hookSmallIconOnSet( - context = iconImageView.context, - expandedNf, - expandedNf.notification?.smallIcon?.loadDrawable(iconImageView.context), - ) { icon -> iconImageView.setImageBitmap(icon) } - } - } - } if (NotificationHeaderViewWrapperInjectorClass.hasClass) NotificationHeaderViewWrapperInjectorClass.hook { /** 修复下拉通知图标自动设置回 APP 图标的方法 */