Skip to content

auth: export consent activities returned via KEY_INTENT - #3879

Open
highda wants to merge 1 commit into
microg:masterfrom
highda:fix/auth-consent-activities-exported
Open

highda wants to merge 1 commit into
microg:masterfrom
highda:fix/auth-consent-activities-exported

Conversation

@highda

@highda highda commented Oct 11, 2026

Copy link
Copy Markdown

AskPermissionActivity and AskPackageOverrideActivity are returned to the
caller through AccountManager's KEY_INTENT from getAuthToken(). With the
interactive getAuthToken(account, type, options, activity, callback, handler)
overload, AccountManager starts that intent from the caller's process, so the
activity has to be launchable by another app. Both are exported="false", so on
Android 12+ the launch is denied:

Permission Denial: starting Intent { cmp=com.google.android.gms/org.microg.gms.auth.AskPackageOverrideActivity }
  ... not exported from uid <gms-uid>

and the token request hangs with no consent UI.

LoginActivity is returned the same way from addAccount() and is already
exported="true" (adding accounts works). This makes the two consent
activities consistent with it.

Most visible with Aurora Store personal sign-in: it requests a token with
overridePackage=com.android.vending and never gets the override consent, so
login spins forever. AskPermissionActivity hits the same wall when per-app
account-permission consent is needed (AuroraOSS/AuroraStore#1470).

Security: same exposure LoginActivity already has. The activities resolve
their result through the AccountAuthenticatorResponse the framework embeds in
the intent, and AskPackageOverrideActivity only writes the grant after the
user taps Allow on a dialog that names the requesting app and account, keyed to
that app's package and signature. Can gate on a non-null response or a
signature permission instead if preferred.

Repro on Pixel 10 / Android 16 / microG 0.3.17: Aurora personal sign-in hangs,
logcat shows the not exported from uid denial. Pre-seeding the override grant
that the activity would write makes getAuthToken() skip it and sign-in
completes, which isolates the failure to the activity launch.

AskPermissionActivity and AskPackageOverrideActivity are returned to the
caller through AccountManager's KEY_INTENT from getAuthToken(). When the
caller uses an interactive getAuthToken() overload, AccountManager starts
that intent from the *caller's* process, so the target activity must be
launchable by another app (i.e. exported). Both were android:exported=
"false", so the launch fails with:

  Permission Denial: starting Intent ... not exported from uid <gms>

and the auth request hangs or crashes. LoginActivity, returned the same
way from addAccount(), is already android:exported="true"; this applies
the same fix to the two consent activities.

Fixes Aurora Store personal sign-in (overridePackage=com.android.vending)
on Android 12+, where the package-override consent could never be shown.

Signed-off-by: highda <github@highda.space>
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