Skip to content

Hand store installs before falling back to a session - #941

Open
xihale wants to merge 1 commit into
JingMatrix:masterfrom
xihale:store-install-intent-handoff
Open

Hand store installs before falling back to a session#941
xihale wants to merge 1 commit into
JingMatrix:masterfrom
xihale:store-install-intent-handoff

Conversation

@xihale

@xihale xihale commented Aug 26, 2026

Copy link
Copy Markdown

To allow third-party installers (like InstallerX Revived) to handle app installations instead of the system's default UI or shell:
Downloaded APKs are staged in MediaStore.Downloads (marked pending).
After package name verification, the app fires a standard ACTION_VIEW intent rather than a direct PackageInstaller session.
Package events are pre-registered to buffer early verdicts.

Fallbacks & Safeguards:
Timeouts: A 5-minute window is given for the installer to process the staged file.
Validation: Mismatched package names bypass the intent and fall back to the native session route.
Legacy Support: Android versions below Q (API 29) or failed intent resolutions automatically fall back to the standard session mechanism.

…session

A PackageInstaller session committed by the manager never reaches a
third-party installer: parasitically the commit is a silent install by
com.android.shell that nothing observes, and standalone it pins the
platform's own confirmation UI. From API 29 the download is instead
staged into MediaStore.Downloads — pending until complete — checked
against the catalogue entry's package name, and handed over with one
plain ACTION_VIEW intent. Whoever answers is the user's answer: their
chosen default, a resolver pick, or the platform's own — which InstallerX
Revived and its kind can finally see and intercept.

The verdict comes back as the package event for the target package,
armed before the intent fires so that one arriving early is buffered
rather than missed. A five-minute timeout leaves the staged copy for an
installer still showing its prompt; staging that fails or is cancelled
withdraws its entry, as the session route abandons its session. A staged
APK declaring another package is never handed off — the session route
takes it and the platform fails it under its own name.

Before Q, or when the intent could not be fired at all, the session
route applies unchanged. Vector's own dialog remains the gate that names
what is about to be downloaded, whichever route runs.
@xihale xihale changed the title Hand store installs to the user's installer before falling back to a session Hand store installs before falling back to a session Aug 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.

1 participant