From 0ed7c5655b5cbd66bb483771aeae615c8fedde29 Mon Sep 17 00:00:00 2001 From: Fankesyooni Date: Fri, 18 Mar 2022 05:56:40 +0800 Subject: [PATCH] Update YukiHookAPI --- app/build.gradle | 4 ++-- .../com/fankes/coloros/notify/hook/HookEntry.kt | 13 +++---------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index a64d6ec..3fb0c74 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -61,8 +61,8 @@ tasks.whenTaskAdded { dependencies { compileOnly 'de.robv.android.xposed:api:82' - implementation 'com.highcapable.yukihookapi:api:1.0.4' - ksp 'com.highcapable.yukihookapi:ksp-xposed:1.0.4' + implementation 'com.highcapable.yukihookapi:api:1.0.5-fix' + ksp 'com.highcapable.yukihookapi:ksp-xposed:1.0.5-fix' implementation 'com.github.tiann:FreeReflection:3.1.0' implementation "com.github.topjohnwu.libsu:core:3.1.2" implementation 'androidx.annotation:annotation:1.3.0' diff --git a/app/src/main/java/com/fankes/coloros/notify/hook/HookEntry.kt b/app/src/main/java/com/fankes/coloros/notify/hook/HookEntry.kt index 6e1d2da..bc92b4e 100644 --- a/app/src/main/java/com/fankes/coloros/notify/hook/HookEntry.kt +++ b/app/src/main/java/com/fankes/coloros/notify/hook/HookEntry.kt @@ -278,19 +278,12 @@ class HookEntry : YukiHookXposedInitProxy { } } - override fun onHook() { - runConfig() - runHook() - } - - /** 配置 Hook */ - private fun runConfig() = configs { + override fun onInit() = configs { debugTag = "ColorOSNotify" isDebug = false } - /** 开始 Hook */ - private fun runHook() = encase { + override fun onHook() = encase { loadApp(SYSTEMUI_PACKAGE_NAME) { when { /** 不是 ColorOS 系统停止 Hook */ @@ -345,7 +338,7 @@ class HookEntry : YukiHookXposedInitProxy { param(ImageViewClass, OplusContrastColorUtilClass.clazz) } replaceAny { (firstArgs as? ImageView?)?.let { isGrayscaleIcon(it.context, it.drawable) } } - }.ignoredHookingFailure() + }.ignoredNoSuchMemberFailure() } /** 替换状态栏图标 */ IconManagerClass.hook {