Hand store installs before falling back to a session - #941
Open
xihale wants to merge 1 commit into
Open
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.