Repository navigation
Conversation
| // Without this flag, EMUI intercepts each PackageInstaller session and shows a | ||
| // mandatory user-confirmation dialog — including for Dynamic Feature Module installs. | ||
| // USER_ACTION_NOT_REQUIRED requires API 31 (Android 12 / S). | ||
| if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { |
There was a problem hiding this comment.
Please use import android.os.Build.VERSION.SDK_INT and directly refer to SDK_INT (to not confuse with the Build from device profiles.
Also please use direct SDK level code (31) instead of named version codes.
There was a problem hiding this comment.
Done, updated in the latest commit.
- Add USER_ACTION_NOT_REQUIRED to SessionParams in installPackagesInternal() for API 31+ (Android 12+) to prevent Huawei EMUI InstallDistActivity from intercepting every PackageInstaller session commit with a confirmation dialog. - Implement splitDeferred() in SplitInstallService to route deferred DFM install requests through splitInstallFlow() instead of being a no-op stub. Previously, apps like Facebook would fall back to startInstall() for each deferred module, triggering additional PackageInstaller sessions and additional InstallDistActivity dialogs on EMUI. Fixes: microg#3541
f79cbba to
fa111c0
Compare
|
@mar-v-in I've updated the SDK_INT import and switched to the direct API level (31) as requested. Ready for another look whenever you have time, please let me know if anything else needs changing. |
Split installs are handled by PR 3903. Also correct the comment on USER_ACTION_NOT_REQUIRED: it does not skip the EMUI install dialog.
15a22f5 to
0c5cce6
Compare
|
Closing this, since #3903 handles split installs much better, including deferred ones, and already requests The only part not covered there is setting |
Related to #3541
When an app is updated through the microG installer (for example Aurora Store's "Update all"), Android 12+ shows its install confirmation for every app, even when Companion is the installer of record. Play Store updates such apps without asking.
Changes
Install.kt: setUSER_ACTION_NOT_REQUIREDon the session forSDK_INT >= 31.AndroidManifest.xml: requestUPDATE_PACKAGES_WITHOUT_USER_ACTION(normal permission, API 31+). Without it, Android ignoresUSER_ACTION_NOT_REQUIRED(PackageInstallerSession.computeUserActionRequirement).The flag is set in
installPackagesInternal(), so it applies to every install that Companion makes: the installer proxy (AppInstallActivity, used by Aurora's microG installer), split installs, and work profile installs (InstallService). I only tested the installer proxy.With both, Android 12+ skips the confirmation when Companion is the installer of record (update owner on Android 14+) and the app meets the platform's target SDK requirement. Otherwise it still asks, as before. New installs still need the user.
The
splitDeferredchange that was here before is dropped: #3903 handles split installs, including deferred ones, much better.Security considerations
com.android.vendingas installer of record, so they are covered too.Testing
Android 12 emulator (AOSP image), Aurora Store 4.8.4 with the microG installer, "Update all" (2 apps, Companion as installer of record)
bb9a37d):PackageInstallerActivityfor both apps; they installed only after confirming.d0999c6): no confirmation, both apps updated.Emulator logs
Without the permission (
bb9a37d):With the permission (
d0999c6):Huawei (HarmonyOS 4.3 / EMUI 15, Android 12)
This does not remove the Huawei install dialog. After Android's own check passes, EMUI asks its
SilentUpdatePolicy, an allowlist of installer packages fetched from Huawei's server, and it answersallowed: falseforcom.android.vending: