Auto update apps on Android 12+ without Privileged Extension
Android 12 provides a new method setRequireUserAction for the class PackageInstaller.SessionParams that can be used to update apps without user interaction if they meet certain criteria:
For installers that have been granted the REQUEST_INSTALL_PACKAGES permission, user action will not be required when all of the following conditions are met:
- requireUserAction is set to USER_ACTION_NOT_REQUIRED.
- The app being installed targets API 29 or higher.
- The installer is the installer of record of an existing version of the app (in other words, this install session is an app update) or the installer is updating itself.
- The installer declares the UPDATE_PACKAGES_WITHOUT_USER_ACTION permission.
AuroraStore and Droid-ify / Neo-Store already implemented this.