diff --git a/app/src/main/java/name/mikanoshi/customiuizer/MainModule.java b/app/src/main/java/name/mikanoshi/customiuizer/MainModule.java index 35d43464..de46d231 100644 --- a/app/src/main/java/name/mikanoshi/customiuizer/MainModule.java +++ b/app/src/main/java/name/mikanoshi/customiuizer/MainModule.java @@ -170,6 +170,7 @@ public void handleLoadPackage(final LoadPackageParam lpparam) { if (mPrefs.getBoolean("controls_fingerprintscreen")) Controls.FingerprintScreenOnHook(lpparam); if (mPrefs.getBoolean("controls_fingerprintwake")) Controls.NoFingerprintWakeHook(lpparam); if (mPrefs.getBoolean("various_disableapp")) Various.AppsDisableServiceHook(lpparam); + if (mPrefs.getBoolean("various_anyinstaller")) Various.AnyPackageInstallerHook(lpparam); if (mPrefs.getStringAsInt("system_allrotations2", 1) > 1) System.AllRotationsHook(lpparam); if (mPrefs.getStringAsInt("system_nolightuponcharges", 1) > 1) System.NoLightUpOnChargeHook(lpparam); if (mPrefs.getStringAsInt("system_autogroupnotif", 1) > 1) System.AutoGroupNotificationsHook(lpparam); diff --git a/app/src/main/java/name/mikanoshi/customiuizer/mods/Various.java b/app/src/main/java/name/mikanoshi/customiuizer/mods/Various.java index 565e4e00..646f1c79 100644 --- a/app/src/main/java/name/mikanoshi/customiuizer/mods/Various.java +++ b/app/src/main/java/name/mikanoshi/customiuizer/mods/Various.java @@ -15,6 +15,7 @@ import android.content.pm.ApplicationInfo; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; +import android.content.pm.ResolveInfo; import android.content.res.Resources; import android.content.res.TypedArray; import android.database.ContentObserver; @@ -1038,6 +1039,15 @@ protected void before(MethodHookParam param) throws Throwable { }); } + public static void AnyPackageInstallerHook(LoadPackageParam lpparam) { + Helpers.findAndHookMethod("com.android.server.pm.PackageManagerServiceImpl", lpparam.classLoader, "hookChooseBestActivity", Intent.class, String.class, long.class, List.class, int.class, ResolveInfo.class, new MethodHook() { + @Override + protected void before(final MethodHookParam param) throws Throwable { + param.setResult(param.args[5]); + } + }); + } + public static void GboardPaddingHook() { Helpers.findAndHookMethod(findClass("android.os.SystemProperties", null), "get", String.class, new MethodHook() { @Override diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index c32b5337..53d63617 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -1137,4 +1137,6 @@ 开启控制中心样式切换 禁用蓝牙临时关闭态 单击开关后自动收起 + 允许使用非MIUI的软件包安装器 + 去除软件包安装intent中的安装器包名过滤条件。 \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c4866bb2..82eebc7b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1177,4 +1177,6 @@ Enable CC style switch Disable disconnect bluetooth until tomorrow Collapse after touch + Allow non-MIUI package installers + Remove the filter about package installer name on such intents. \ No newline at end of file diff --git a/app/src/main/res/xml/prefs_various.xml b/app/src/main/res/xml/prefs_various.xml index fae8105d..2171e376 100644 --- a/app/src/main/res/xml/prefs_various.xml +++ b/app/src/main/res/xml/prefs_various.xml @@ -26,6 +26,12 @@ android:summary="@string/various_installappinfo_summ" android:defaultValue="false" /> + +