I fixed this problem as soon as finished writing this post. However, I still decide to post it to help others.
I am using MIUI with Android 13. I installed F-Droid Privileged Extension 0.2.13 with the unofficial Magisk module.
The Privileged Extension is listed as installed apps, and F-Droid shows the Privileged Extension option, and I enabled it. So far, so good.
However, when I try to update or install some apps, F-Droid prompts the error
Error -115: null
I used adb logcat
to capture logs while installing, and here are relevant lines:
D PrivilegedExtension: Checking if package is allowed to access privileged extension: org.fdroid.fdroid
D PrivilegedExtension: Allowed cert hash: 43238d512c1e5eb2d6569f4a3afbf5523418b82e0a3ed1552770abb9a9c9ccab
D PrivilegedExtension: Package cert hash: 43238d512c1e5eb2d6569f4a3afbf5523418b82e0a3ed1552770abb9a9c9ccab
D PrivilegedExtension: Package is allowed to access the privileged extension!
I InstallationTiming: beginInstall_sessionId: 203975128
W RuleEvaluation: Integrity rule files are not available.
D MiBarrage: The sbn packageName is :org.fdroid.fdroid
I PackageManager: Integrity check passed for file:///data/app/vmdl203975128.tmp
D PKMSImpl: Package verify start
I VerificationReceiver: start verify install path: /data/app/vmdl203975128.tmp sessionId: 203975128
I VerificationReceiver: verify package /data/app/vmdl203975128.tmp, finish: true
E PKMSImpl: MIUILOG- assertCallerAndPackage: uid=10224, installerPkg=org.fdroid.fdroid.privileged, msg=Permission denied
D PackageInstallerSession: Marking session 203975128 as failed: INSTALL_FAILED_ABORTED: Permission denied
E AppDetailsActivity: install aborted with errorMessage: Error -115: null
After some search, I found MIUI 破坏了全部 PackageInstaller API 的功能 · Issue #28 · android-in-china/Compatibility · GitHub.
MIUI optimization has to be turned off for F-Droid privileged install.