From f1d4110bea108dea3b3876feb031e025fbe995ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=96=B5=E6=9F=92=E6=9F=92=F0=9F=8D=80?= Date: Sat, 25 May 2024 13:40:35 +0800 Subject: [PATCH] fix boom 2 --- .../module/hook/securitycenter/battery/BatteryHealth.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/securitycenter/battery/BatteryHealth.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/securitycenter/battery/BatteryHealth.kt index 02f907f8b5..645379ac7d 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/securitycenter/battery/BatteryHealth.kt +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/securitycenter/battery/BatteryHealth.kt @@ -5,7 +5,6 @@ import com.github.kyuubiran.ezxhelper.* import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createAfterHook import com.sevtinge.hyperceiler.module.base.* import com.sevtinge.hyperceiler.module.base.dexkit.* -import com.sevtinge.hyperceiler.module.base.dexkit.DexKitTool.toClass import com.sevtinge.hyperceiler.module.base.dexkit.DexKitTool.toMethod import com.sevtinge.hyperceiler.utils.* import de.robv.android.xposed.* @@ -24,7 +23,7 @@ object BatteryHealth : BaseHook() { } private val cc by lazy { - DexKit.getDexKitBridge("getSecurityBatteryHealthClass") { + DexKit.useDexKitIfNoCache(arrayOf("getSecurityBatteryHealthClass")) { it.findClass { searchPackages("com.miui.powercenter.nightcharge") findFirst = true @@ -35,7 +34,7 @@ object BatteryHealth : BaseHook() { } } } - }.first().getInstance(EzXHelper.safeClassLoader) + } } } @@ -60,8 +59,9 @@ object BatteryHealth : BaseHook() { } ) + val nameClass = DexKit.createCache("getSecurityBatteryHealthClass", cc, lpparam.classLoader).toMethodList().first().name findAndHookMethod( - cc.toClass(), + nameClass, "handleMessage", Message::class.java, object : XC_MethodHook() {