Support explicitly scoped isolated services - #998
Open
kalanihelekunihi wants to merge 1 commit into
Open
kalanihelekunihi wants to merge 1 commit into
kalanihelekunihi wants to merge 1 commit into
Conversation
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.
Summary
Why
Android services that use
isolatedProcess, including on-device ML runtimes, receive a transient isolated UID and a generated process name such as:Vector previously rejected every isolated UID in
preAppSpecialize, before the daemon could apply the user's package scope. Adding the generated process as a separate scope is not durable because its UID changes between process starts.This change lets the daemon derive the base package from the colon-delimited process name and inherit only that package's explicit scope for the same Android user. A process without a matching explicit base-package scope receives no framework binder and remains uninjected.
Device proof
Tested on a rooted Google Pixel 11 Pro Fold (
yogi) running Android 17 buildDP11.260918.005(16443917), fingerprint:With an Xposed module scoped only to
com.google.android.aicore, repeated isolated-service starts used changing isolated UIDs (99000,99006, and99016). Vector logged:The scoped module then loaded in the isolated service, and AICore completed its local Edge TPU model initialization with repeated
Successfully loaded offline-compiled modelevents. This behavior survived cold process starts and UID changes.The device test used this capability to restore access to a locally present factory model for rooted users after Google's protected model download service rejected the unlocked boot chain. The change itself is generic and does not contain Google package special cases or alter attestation.
Validation
git diff --check./gradlew zipDebugwith OpenJDK 21 and Android SDK: BUILD SUCCESSFULThe repository-wide
ktfmtCheckcurrently reports pre-existing formatting differences in unrelated files on the base branch. The changed Kotlin block was formatted with the repository'sktfmtFormatMaintask, then unrelated formatter changes were discarded.Security and scope behavior