Skip to content

Commit

Permalink
[try fix] 应用包管理组件-禁用风险检测
Browse files Browse the repository at this point in the history
  • Loading branch information
lingqiqi5211 committed Dec 2, 2023
1 parent e27700e commit 058450e
Showing 1 changed file with 5 additions and 32 deletions.
Original file line number Diff line number Diff line change
@@ -1,55 +1,28 @@
package com.sevtinge.hyperceiler.module.hook.packageinstaller

import android.annotation.SuppressLint
import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createHook
import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createHooks
import com.sevtinge.hyperceiler.module.base.BaseHook
import com.sevtinge.hyperceiler.utils.DexKit.addUsingStringsEquals
import com.sevtinge.hyperceiler.utils.DexKit.dexKitBridge

@SuppressLint("StaticFieldLeak")
object InstallRiskDisable : BaseHook() {
override fun init() {
/*val result = Objects.requireNonNull(
mPackageInstallerResultMethodsMap!!["SecureVerifyEnable"]
)
for (descriptor in result) {
val mSecureVerifyEnable = descriptor.getMethodInstance(lpparam.classLoader)
mSecureVerifyEnable.createHook {
returnConstant(false)
}
}
val result2 = Objects.requireNonNull(
mPackageInstallerResultMethodsMap!!["isInstallRiskEnabled"]
)
for (descriptor2 in result2) {
val isInstallRiskEnabled = descriptor2.getMethodInstance(lpparam.classLoader)
isInstallRiskEnabled.createHook {
returnConstant(false)
}
}
val result3 = Objects.requireNonNull(
mPackageInstallerResultMethodsMap!!["DisableSafeModelTip"]
)
for (descriptor in result3) {
val mDisableSafeModelTip = descriptor.getMethodInstance(lpparam.classLoader)
mDisableSafeModelTip.createHook {
returnConstant(false)
}
}*/

dexKitBridge.findMethod {
matcher {
addUsingStringsEquals("secure_verify_enable")
}
}.firstOrNull()?.getMethodInstance(lpparam.classLoader)?.createHook {
}.map { it.getMethodInstance(lpparam.classLoader) }.toList().createHooks {
returnConstant(false)
}

dexKitBridge.findMethod {
matcher {
addUsingStringsEquals("installerOpenSafetyModel")
}
}.firstOrNull()?.getMethodInstance(lpparam.classLoader)?.createHook {
}.map { it.getMethodInstance(lpparam.classLoader) }.toList().createHooks {
returnConstant(false)
}

Expand Down

0 comments on commit 058450e

Please sign in to comment.