diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index bd2148c..ed11d50 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -5,7 +5,9 @@ private final android.content.SharedPreferences$OnSharedPreferenceChangeListener listener; } --keep class me.gm.cleaner.plugin.xposed.XposedInit +-keep class me.gm.cleaner.plugin.xposed.XposedInit { + *; +} -assumenosideeffects class kotlin.jvm.internal.Intrinsics { public static void check*(...); diff --git a/app/src/main/java/me/gm/cleaner/plugin/xposed/XposedInit.kt b/app/src/main/java/me/gm/cleaner/plugin/xposed/XposedInit.kt index e1b4f5f..7739383 100644 --- a/app/src/main/java/me/gm/cleaner/plugin/xposed/XposedInit.kt +++ b/app/src/main/java/me/gm/cleaner/plugin/xposed/XposedInit.kt @@ -62,12 +62,14 @@ class XposedInit : ManagerService(), IXposedHookLoadPackage, IXposedHookZygoteIn XposedHelpers.findAndHookMethod(File::class.java, "mkdirs", FileHooker()) } + lateinit var methodHook: XC_MethodHook.Unhook + @Throws(Throwable::class) override fun handleLoadPackage(lpparam: LoadPackageParam) { if (lpparam.appInfo.flags and ApplicationInfo.FLAG_SYSTEM == 0) { return } - XposedHelpers.findAndHookMethod( + methodHook = XposedHelpers.findAndHookMethod( ContentProvider::class.java, "attachInfo", Context::class.java, ProviderInfo::class.java, Boolean::class.java, object : XC_MethodHook() { @@ -80,6 +82,7 @@ class XposedInit : ManagerService(), IXposedHookLoadPackage, IXposedHookZygoteIn MediaStore.AUTHORITY -> onMediaProviderLoaded(lpparam, context) Downloads_Impl_AUTHORITY -> onDownloadManagerLoaded(lpparam, context) } + methodHook.unhook() } } )