Skip to content

Add Install API to install apps via PackageInstaller session#886

Open
shrx wants to merge 1 commit into
termux:masterfrom
shrx:feat/install-api
Open

Add Install API to install apps via PackageInstaller session#886
shrx wants to merge 1 commit into
termux:masterfrom
shrx:feat/install-api

Conversation

@shrx

@shrx shrx commented Jun 16, 2026

Copy link
Copy Markdown

Adds an Install API method that installs an application using the PackageInstaller session API. It works with the REQUEST_INSTALL_PACKAGES permission the app already holds and shows the system confirmation dialog, so it can install multi-part packages (a base APK plus its split APKs, e.g. Android App Bundles distributed as .apkm/.apks/.xapk) that the single-file install intent cannot handle. Package signatures are preserved.

This implements the README's "Ideas" item: "Add extra permissions to the app to (un)install apps".

The file extra may point to a single .apk, a directory of split APKs, or a zip-based bundle whose .apk entries are extracted and installed together as one session. A nested InstallStatusReceiver launches the confirmation intent on STATUS_PENDING_USER_ACTION and reports the final result.

Client script (termux-install) added in a related PR to termux-api-package.

…on, supporting split APK bundles

Add an Install API method that installs an application using the
PackageInstaller session API. This works with the REQUEST_INSTALL_PACKAGES
permission already held by the app and shows the system confirmation
dialog, so it can install multi part packages (a base APK plus its split
APKs, e.g. Android App Bundles distributed as .apkm/.apks/.xapk) which the
single file install intent cannot handle. Package signatures are preserved.

The "file" extra may point to a single .apk, a directory of split APKs, or
a zip based bundle whose .apk entries are extracted and installed together
as one session. A nested InstallStatusReceiver launches the confirmation
intent on STATUS_PENDING_USER_ACTION and reports the final result.
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.

1 participant