Disable installation's count checking (#216)

Disable installation's count checking
This commit is contained in:
QQ little ice
2023-02-12 20:34:38 +08:00
committed by GitHub
parent 2830c8f48a
commit 40c24cbb40
10 changed files with 47 additions and 0 deletions

View File

@@ -47,6 +47,7 @@ class MenuPage : BasePage() {
"killall com.miui.screenshot",
"killall com.milink.service",
"killall com.xiaomi.misubscreenui",
"killall com.miui.packageinstaller"
)
ShellUtils.execCommand(command, true)
dismiss()

View File

@@ -172,6 +172,12 @@ class OtherPageForS : BasePage() {
TextSummaryV(textId = R.string.remove_thememanager_ads),
SwitchV("remove_thememanager_ads")
)
Line()
TitleText(textId = R.string.pkg_installer)
TextSummaryWithSwitch(
TextSummaryV(textId = R.string.pkg_installer_summary),
SwitchV("pkg_installer_count_checking")
)
}
}

View File

@@ -172,6 +172,12 @@ class OtherPageForT : BasePage() {
TextSummaryV(textId = R.string.remove_thememanager_ads),
SwitchV("remove_thememanager_ads")
)
Line()
TitleText(textId = R.string.pkg_installer)
TextSummaryWithSwitch(
TextSummaryV(textId = R.string.pkg_installer_summary),
SwitchV("pkg_installer_count_checking")
)
}
}

View File

@@ -25,6 +25,7 @@ class MainHook : EasyXposedInit() {
ScreenShot, // 截屏
Cast, //投屏
RearDisplay, //背屏
PackageInstaller, // 应用包管理组件
)
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam?) {

View File

@@ -0,0 +1,24 @@
package com.lt2333.simplicitytools.hooks.apps
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.lt2333.simplicitytools.utils.hasEnable
import com.lt2333.simplicitytools.utils.xposed.base.AppRegister
import de.robv.android.xposed.XposedBridge
import de.robv.android.xposed.callbacks.XC_LoadPackage
object PackageInstaller: AppRegister() {
override val packageName: String = "com.miui.packageinstaller"
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
hasEnable("pkg_installer_count_checking") {
findMethod("com.miui.packageInstaller.model.RiskControlRules") {
name == "getCurrentLevel"
}.hookBefore { param ->
XposedBridge.log("Hooked getCurrentLevel, param result = ${param.result}")
param.result = 0
}
}
}
}