Apply binder scope to PlatformCompatHook

This commit is contained in:
Wang Han 2025-03-09 20:13:18 +08:00
commit 0a82211745

View file

@ -8,6 +8,7 @@ import com.github.kyuubiran.ezxhelper.utils.hookBefore
import de.robv.android.xposed.XC_MethodHook
import icu.nullptr.hidemyapplist.common.CommonUtils
import icu.nullptr.hidemyapplist.xposed.HMAService
import icu.nullptr.hidemyapplist.xposed.Utils
import icu.nullptr.hidemyapplist.xposed.logE
import icu.nullptr.hidemyapplist.xposed.logI
@ -32,7 +33,9 @@ class PlatformCompatHook(private val service: HMAService) : IFrameworkHook {
val changeId = param.args[0] as Long
val appInfo = param.args[1] as ApplicationInfo
if (changeId.toInt() != 143937733) return@hookBefore
val apps = service.pms.getPackagesForUid(appInfo.uid) ?: return@hookBefore
val apps = Utils.binderLocalScope {
service.pms.getPackagesForUid(appInfo.uid)
} ?: return@hookBefore
for (app in apps) {
if (service.isHookEnabled(app)) {
if (sAppDataIsolationEnabled) param.result = true