Skip to content

Commit b339eac

Browse files
committed
optimization: dexkit BypassSimLockMiAccountAuth
Signed-off-by: Neko Qiqi <lingqiqi233@gmail.com>
1 parent bed39b5 commit b339eac

1 file changed

Lines changed: 21 additions & 8 deletions

File tree

app/src/main/java/com/sevtinge/hyperceiler/module/hook/securitycenter/other/BypassSimLockMiAccountAuth.kt

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,32 @@
1818
*/
1919
package com.sevtinge.hyperceiler.module.hook.securitycenter.other
2020

21-
import com.github.kyuubiran.ezxhelper.*
2221
import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createHook
23-
import com.github.kyuubiran.ezxhelper.finders.MethodFinder.`-Static`.methodFinder
2422
import com.sevtinge.hyperceiler.module.base.*
23+
import com.sevtinge.hyperceiler.module.base.dexkit.DexKit.dexKitBridge
24+
import org.luckypray.dexkit.query.enums.*
2525

2626
object BypassSimLockMiAccountAuth : BaseHook() {
27-
override fun init() {
28-
runCatching {
29-
ClassUtils.loadClass("com.miui.simlock.b").methodFinder()
30-
.filterByName("m")
31-
.single().createHook {
32-
returnConstant(true)
27+
private val findMethod by lazy {
28+
dexKitBridge.findMethod {
29+
matcher {
30+
declaredClass {
31+
addUsingString("SimLockUtils", StringMatchType.Contains)
32+
}
33+
addCall {
34+
addUsingString("SimLockStartFragment::simLockSetUpFlow::step =", StringMatchType.Contains)
3335
}
36+
paramCount = 1
37+
paramTypes("android.content.Context")
38+
returnType = "boolean"
39+
}
40+
}.map { it.getMethodInstance(lpparam.classLoader) }.toSet()
41+
}
42+
43+
override fun init() {
44+
logD(TAG, lpparam.packageName, "BypassSimLockMiAccountAuth find method is ${findMethod.last()}")
45+
findMethod.last().createHook {
46+
returnConstant(true)
3447
}
3548
}
3649
}

0 commit comments

Comments
 (0)