Skip to content

Vending: Allow installer-of-record updates without user action - #3543

Closed
grenadin wants to merge 9 commits into
microg:masterfrom
grenadin:fix/emui-install-dist-dialog-user-action-required
Closed

grenadin wants to merge 9 commits into
microg:masterfrom
grenadin:fix/emui-install-dist-dialog-user-action-required

Conversation

@grenadin

@grenadin grenadin commented Jun 8, 2026 •

Copy link
Copy Markdown
Contributor

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: set USER_ACTION_NOT_REQUIRED on the session for SDK_INT >= 31.
  • AndroidManifest.xml: request UPDATE_PACKAGES_WITHOUT_USER_ACTION (normal permission, API 31+). Without it, Android ignores USER_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 splitDeferred change that was here before is dropped: #3903 handles split installs, including deferred ones, much better.

Security considerations

  • For the installer proxy, the caller still has to be allowed in microG's installer settings (package name and signing certificate), so that is the only prompt for these updates. Split installs only accept the calling app's own package, and work profile installs are started by the user in Companion. Apps installed by Google Play before switching to microG also have com.android.vending as installer of record, so they are covered too.
  • Android still enforces the usual rules: only updates of apps where Companion is the installer of record, same signing certificate, no downgrade.
  • Aurora Store's session installer uses the same flag and permission.

Testing

Android 12 emulator (AOSP image), Aurora Store 4.8.4 with the microG installer, "Update all" (2 apps, Companion as installer of record)

  • Without the permission (bb9a37d): PackageInstallerActivity for both apps; they installed only after confirming.
  • With the permission (d0999c6): no confirmation, both apps updated.
Emulator logs

Without the permission (bb9a37d):

23:41:45.150 V/GmsPackageInstaller: installPackages start com.androidfung.drminfo
23:41:45.543 D/GmsPackageInstaller: installPackages session commit
23:41:45.713 I/ActivityTaskManager: START u0 {act=android.content.pm.action.CONFIRM_INSTALL ... cmp=com.android.packageinstaller/.PackageInstallerActivity (has extras)}
23:41:54.600 D/AppInstall: handleInstallRequest: installPackages<com.androidfung.drminfo> isSuccess: true
23:41:55.626 V/GmsPackageInstaller: installPackages start com.ytheekshana.deviceinfo
23:41:55.769 D/GmsPackageInstaller: installPackages session commit
23:41:55.833 I/ActivityTaskManager: START u0 {act=android.content.pm.action.CONFIRM_INSTALL ... cmp=com.android.packageinstaller/.PackageInstallerActivity (has extras)}
23:42:00.062 D/AppInstall: handleInstallRequest: installPackages<com.ytheekshana.deviceinfo> isSuccess: true

With the permission (d0999c6):

23:50:27.541 V/GmsPackageInstaller: installPackages start com.androidfung.drminfo
23:50:28.111 D/GmsPackageInstaller: installPackages session commit
23:50:29.519 V/GmsPackageInstaller: installPackages start com.ytheekshana.deviceinfo
23:50:30.144 D/GmsPackageInstaller: installPackages session commit
23:50:30.608 D/AppInstall: handleInstallRequest: installPackages<com.androidfung.drminfo> isSuccess: true
23:50:32.260 D/AppInstall: handleInstallRequest: installPackages<com.ytheekshana.deviceinfo> isSuccess: true

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 answers allowed: false for com.android.vending:

D SilentUpdatePolicy: installer: com.android.vending/10267, target: com.facebook.katana/10268, allowed: false

// 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) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@grenadin

grenadin commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor Author

@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.

@grenadin
grenadin requested a review from mar-v-in September 23, 2026 15:12
@mar-v-in mar-v-in added this to the 0.3.18 milestone Sep 28, 2026
@grenadin grenadin changed the title Vending: Fix repeated EMUI install dialog and implement splitDeferred Vending: Allow installer-of-record updates without user action Oct 21, 2026
Split installs are handled by PR 3903. Also correct the comment on
USER_ACTION_NOT_REQUIRED: it does not skip the EMUI install dialog.
@grenadin
grenadin force-pushed the fix/emui-install-dist-dialog-user-action-required branch from 15a22f5 to 0c5cce6 Compare October 22, 2026 02:50
@grenadin

Copy link
Copy Markdown
Contributor Author

Closing this, since #3903 handles split installs much better, including deferred ones, and already requests UPDATE_PACKAGES_WITHOUT_USER_ACTION.

The only part not covered there is setting USER_ACTION_NOT_REQUIRED for non-split installs (for example Aurora's "Update all" through the installer proxy on stock Android 12+). I asked in #3903 whether it could be included there. If not, I'll reopen this or send a small separate PR after #3903 is merged.

@grenadin grenadin closed this Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants