Skip to content

Commit

Permalink
fix boom 2
Browse files Browse the repository at this point in the history
  • Loading branch information
lingqiqi5211 committed May 25, 2024
1 parent de80461 commit f1d4110
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.*
Expand All @@ -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
Expand All @@ -35,7 +34,7 @@ object BatteryHealth : BaseHook() {
}
}
}
}.first().getInstance(EzXHelper.safeClassLoader)
}
}
}

Expand All @@ -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() {
Expand Down

0 comments on commit f1d4110

Please sign in to comment.