Commit 7dafecf
committed
Drop setPackage from SmsRetriever consent flow
In my testing, we don't need setpackage here at all, its redudant and removing it allows us to avoid the need for flavoring (compile time) or switching it to runtime compilation.
In my diagnostic probe tool, I tested three scenarios:
```
component-only = keep the explicit component, but do not call setPackage(...)
component + self package = keep the same explicit component, and set the package to the renamed/local package (BuildConfig.APPLICATION_ID)
component + canonical com.google.android.gms package = keep the same explicit component, but set the package field to the canonical Google package instead
```
all three intent variants still resolved to the same UserConsentPromptActivity. This is because the component itself is doing the routing work.
```
03-12 13:13:54.342 I PkgRenameDiag: Consent prompt component-only -> action=null | package=null | component=app.revanced.android.gms/org.microg.gms.auth.phone.UserConsentPromptActivity | activities=1 match(es): app.revanced.android.gms/org.microg.gms.auth.phone.UserConsentPromptActivity
03-12 13:13:54.342 I PkgRenameDiag: Consent prompt component+self package -> action=null | package=app.revanced.android.gms | component=app.revanced.android.gms/org.microg.gms.auth.phone.UserConsentPromptActivity | activities=1 match(es): app.revanced.android.gms/org.microg.gms.auth.phone.UserConsentPromptActivity
03-12 13:13:54.342 I PkgRenameDiag: Consent prompt component+canonical package -> action=null | package=com.google.android.gms | component=app.revanced.android.gms/org.microg.gms.auth.phone.UserConsentPromptActivity | activities=1 match(es): app.revanced.android.gms/org.microg.gms.auth.phone.UserConsentPromptActivity
```
I also looked at how PackageManager resolves intents:
```
1. SmsRetrieverCore creates an explicit intent for UserConsentPromptActivity.
2. It attaches the google.messenger extra.
3. It places that intent into SmsRetriever.EXTRA_CONSENT_INTENT.
4. That extra is returned to the client app as part of the SMS User Consent API result.
5. Later, the client app launches that consent intent.
```
So for an explicit local activity intent, the component itself is already doing the main routing work.1 parent 62ab6b5 commit 7dafecf
2 files changed
Lines changed: 0 additions & 23 deletions
File tree
- play-services-auth-api-phone/core
- src/main/kotlin/org/microg/gms/auth/phone
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | 22 | | |
27 | 23 | | |
28 | 24 | | |
29 | 25 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | 26 | | |
49 | 27 | | |
50 | 28 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
143 | 142 | | |
144 | 143 | | |
145 | 144 | | |
| |||
0 commit comments