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
}
}
}
}

View File

@@ -233,4 +233,6 @@
<string name="make_millet_more_aggressive_summary">允许 Millet 在后台应用有通知、有服务运行、有进程运行的情况下冻结应用。\n不希望被冻结的应用可将省电策略设置为无限制\n启用前请先卸载墓碑和 NoANR 相关模块。</string>
<string name="make_millet_ignore_active">允许 Millet 冻结活跃的应用</string>
<string name="make_millet_ignore_active_summary">非常激进,可能会影响应用运行</string>
<string name="pkg_installer">应用包管理组件</string>
<string name="pkg_installer_summary">禁用频繁安装应用检查</string>
</resources>

View File

@@ -156,4 +156,6 @@
<string name="hide_zen_icon">隱藏 勿擾 圖標</string>
<string name="hide_icon">隱藏圖標</string>
<string name="double_tap_to_sleep">雙擊鎖定螢幕</string>
<string name="pkg_installer">應用包管理組件</string>
<string name="pkg_installer_summary">禁用頻繁安裝應用檢查</string>
</resources>

View File

@@ -224,4 +224,6 @@
<string name="off">關閉</string>
<string name="center">置中</string>
<string name="left_or_right">左右</string>
<string name="pkg_installer">應用包管理組件</string>
<string name="pkg_installer_summary">禁用頻繁安裝應用檢查</string>
</resources>

View File

@@ -13,5 +13,6 @@
<item>com.miui.screenshot</item>
<item>com.milink.service</item>
<item>com.xiaomi.misubscreenui</item>
<item>com.miui.packageinstaller</item>
</string-array>
</resources>

View File

@@ -237,4 +237,6 @@
<string name="make_millet_more_aggressive_summary">Allows Millet to freeze apps while background apps have notifications, services running, and processes running.\nApps that don\'t want to be frozen can set Battery saver to No restriction\nPlease uninstall tombstone and NoANR related modules before enabling.</string>
<string name="make_millet_ignore_active">Allow Millet to freeze active apps</string>
<string name="make_millet_ignore_active_summary">Very aggressive and may affect application running</string>
<string name="pkg_installer">Package Installer</string>
<string name="pkg_installer_summary">Disable the app installation\'s count checking</string>
</resources>