File tree Expand file tree Collapse file tree 1 file changed +17
-7
lines changed
library/hook/src/main/java/com/sevtinge/hyperceiler/hook/module/hook/mtb Expand file tree Collapse file tree 1 file changed +17
-7
lines changed Original file line number Diff line number Diff line change 1919package com.sevtinge.hyperceiler.hook.module.hook.mtb
2020
2121import com.sevtinge.hyperceiler.hook.module.base.BaseHook
22+ import com.sevtinge.hyperceiler.hook.utils.devicesdk.isMoreHyperOSVersion
2223import io.github.kyuubiran.ezxhelper.core.finder.MethodFinder.`-Static`.methodFinder
2324import io.github.kyuubiran.ezxhelper.core.util.ClassUtil.loadClass
2425import io.github.kyuubiran.ezxhelper.xposed.dsl.HookFactory.`-Static`.createAfterHook
2526
2627object BypassAuthentication : BaseHook() {
2728 override fun init () {
28- // 在 HyperOS2 上
29- runCatching {
30- loadClass(" com.xiaomi.mtb.MtbApp" ).methodFinder()
31- .filterByName(" getMiServerPermissionClass" )
32- .single().createAfterHook {
33- it.result = 0L
34- }
29+ if (isMoreHyperOSVersion(3f )) {
30+ runCatching {
31+ loadClass(" com.xiaomi.mtb.MtbAppBase" ).methodFinder()
32+ .filterByName(" getMiServerPermissionClass" )
33+ .single().createAfterHook {
34+ it.result = 0L
35+ }
36+ }
37+ } else {
38+ runCatching {
39+ loadClass(" com.xiaomi.mtb.MtbApp" ).methodFinder()
40+ .filterByName(" getMiServerPermissionClass" )
41+ .single().createAfterHook {
42+ it.result = 0L
43+ }
44+ }
3545 }
3646 }
3747}
You can’t perform that action at this time.
0 commit comments