Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare play integrity and launch web on failure #9984

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

toluo-stripe
Copy link
Contributor

@toluo-stripe toluo-stripe commented Jan 24, 2025

Summary

  • Prepare integrity manager when useAttestationEndpoints is enabled
  • Short-circuit to the web flow if integrity manager fails to prepare

Motivation

JIRA

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

Screen.Recording.2025-01-24.at.5.55.01.PM.mov

Changelog

Copy link
Contributor

github-actions bot commented Jan 24, 2025

Diffuse output:

OLD: paymentsheet-example-release-master.apk (signature: V1, V2)
NEW: paymentsheet-example-release-pr.apk (signature: V1, V2)

          │            compressed            │          uncompressed          
          ├───────────┬───────────┬──────────┼──────────┬──────────┬──────────
 APK      │ old       │ new       │ diff     │ old      │ new      │ diff     
──────────┼───────────┼───────────┼──────────┼──────────┼──────────┼──────────
      dex │     4 MiB │     4 MiB │ +1.2 KiB │  8.7 MiB │  8.7 MiB │ +2.1 KiB 
     arsc │   2.3 MiB │   2.3 MiB │      0 B │  2.3 MiB │  2.3 MiB │      0 B 
 manifest │   5.1 KiB │   5.1 KiB │      0 B │ 25.7 KiB │ 25.7 KiB │      0 B 
      res │ 910.3 KiB │ 910.3 KiB │      0 B │  1.4 MiB │  1.4 MiB │      0 B 
   native │   2.6 MiB │   2.6 MiB │      0 B │    6 MiB │    6 MiB │      0 B 
    asset │   1.6 MiB │   1.6 MiB │    +15 B │  1.6 MiB │  1.6 MiB │    +15 B 
    other │   1.4 MiB │   1.4 MiB │     -3 B │  1.6 MiB │  1.6 MiB │      0 B 
──────────┼───────────┼───────────┼──────────┼──────────┼──────────┼──────────
    total │  12.7 MiB │  12.7 MiB │ +1.2 KiB │ 21.6 MiB │ 21.6 MiB │ +2.1 KiB 

 DEX     │ old   │ new   │ diff              
─────────┼───────┼───────┼───────────────────
   files │     1 │     1 │   0               
 strings │ 40955 │ 40962 │  +7 (+22 -15)     
   types │ 14144 │ 14145 │  +1 (+13 -12)     
 classes │ 11805 │ 11806 │  +1 (+5 -4)       
 methods │ 60127 │ 60135 │  +8 (+1317 -1309) 
  fields │ 40226 │ 40242 │ +16 (+705 -689)   

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  243 │  243 │  0   
 entries │ 6211 │ 6211 │  0
APK
     compressed      │     uncompressed     │                                           
──────────┬──────────┼───────────┬──────────┤                                           
 size     │ diff     │ size      │ diff     │ path                                      
──────────┼──────────┼───────────┼──────────┼───────────────────────────────────────────
    4 MiB │ +1.2 KiB │   8.7 MiB │ +2.1 KiB │ ∆ classes.dex                             
  1,000 B │     +9 B │     868 B │     +9 B │ ∆ assets/dexopt/baseline.profm            
  7.7 KiB │     +6 B │   7.6 KiB │     +6 B │ ∆ assets/dexopt/baseline.prof             
 53.6 KiB │     +3 B │ 118.8 KiB │      0 B │ ∆ META-INF/CERT.SF                        
 50.4 KiB │     -3 B │ 118.8 KiB │      0 B │ ∆ META-INF/MANIFEST.MF                    
  1.2 KiB │     -2 B │   1.2 KiB │      0 B │ ∆ META-INF/CERT.RSA                       
    271 B │     -1 B │     120 B │      0 B │ ∆ META-INF/version-control-info.textproto 
──────────┼──────────┼───────────┼──────────┼───────────────────────────────────────────
  4.1 MiB │ +1.2 KiB │   8.9 MiB │ +2.1 KiB │ (total)
DEX
STRINGS:

   old   │ new   │ diff         
  ───────┼───────┼──────────────
   40955 │ 40962 │ +7 (+22 -15) 
  
  + , webViewRequestMode=0}
  + LINK_NATIVE_FAILED_TO_PREPARE_INTEGRITY_MANAGER
  + LLLJJ
  + Lc5/j;
  + Lh7/f;
  + Lq6/K;
  + Lr3/a;
  + Lu6/a;
  + PrepareIntegrityTokenRequest{cloudProjectNumber=
  + [Lc2/J;
  + [Lc2/j;
  + [Lc2/u;
  + [Lc5/f;
  + [Lm1/e;
  + [Lq6/E;
  + [Lq6/q;
  + [Lq6/v;
  + launchWebFlow
  + launchWebFlow(Lcom/stripe/android/link/LinkConfiguration;)V
  + link.native.integrity.preparation_failed
  + linkGate
  + ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"5b3ca3f","r8-mode":"full","version":"8.7.14"}
  
  - LL0/D1;
  - Lc2/M;
  - Lm1/f;
  - Lr2/t;
  - PrepareIntegrityTokenRequest{cloudProjectNumber=527113280969, webViewRequestMode=0}
  - VLLLJL
  - [Lc2/K;
  - [Lc2/l;
  - [Lc2/v;
  - [Lc5/e;
  - [Lm1/f;
  - [Lq6/D;
  - [Lq6/p;
  - [Lq6/r;
  - ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"7feffa3","r8-mode":"full","version":"8.7.14"}
  

TYPES:

   old   │ new   │ diff         
  ───────┼───────┼──────────────
   14144 │ 14145 │ +1 (+13 -12) 
  
  + Lc5/j;
  + Lh7/f;
  + Lq6/K;
  + Lr3/a;
  + Lu6/a;
  + [Lc2/J;
  + [Lc2/j;
  + [Lc2/u;
  + [Lc5/f;
  + [Lm1/e;
  + [Lq6/E;
  + [Lq6/q;
  + [Lq6/v;
  
  - LL0/D1;
  - Lc2/M;
  - Lm1/f;
  - Lr2/t;
  - [Lc2/K;
  - [Lc2/l;
  - [Lc2/v;
  - [Lc5/e;
  - [Lm1/f;
  - [Lq6/D;
  - [Lq6/p;
  - [Lq6/r;
  

METHODS:

   old   │ new   │ diff             
  ───────┼───────┼──────────────────
   60127 │ 60135 │ +8 (+1317 -1309) 
  
  + A5.y i(long, u, u, u) → u
  + A5.y j() → Object
  + A5.y k() → int
  + A5.y l() → ContentInfo
  + A5.y n(Uri)
  + A5.y o() → int
  + A5.y p(KeyEvent) → int
  + A5.y q(int)
  + A5.y r(int, j, String, Bundle)
  + A6.C <init>(A, a, a, c, c, c, c, a, int)
  + A6.E <init>(p, int)
  + A6.F <init>(p, int)
  + A6.J <init>(p, s, a, c, D1, c, A)
  + A6.K <init>(f, D1, p, s, a, c, c, A)
  + A6.Q <init>(p, String, W, a, Integer, Integer, int, int)
  + A6.S <init>(Integer, int, int)
  + B.i <init>(n, j, q)
  + B.z <init>(j, W, W)
  + C.B0 i(long, u, u, u) → u
  + C.D0 m() → int
  + C.E0 <init>(c, PriorityBlockingQueue, d)
  + C.E0 H(b, l) → boolean
  + C.E0 i(long, u, u, u) → u
  + C.E0 j(b, l) → boolean
  + C.E0 l(Object, ArrayList, HashSet)
  + C.F0 i(long, u, u, u) → u
  + C.H0 i(long, u, u, u) → u
  + C.H0 m() → int
  + C.I0 i(long, u, u, u) → u
  + C.I0 m() → int
  + C.J0 i(long, u, u, u) → u
  + C.J0 j(RenderScript) → Bitmap
  + C.J0 m() → int
  + C.J0 n(int) → int
  + C.J0 o(int) → int
  + C.J0 p(View, N0) → N0
  + C.a <init>(s, A, v, Bundle)
  + C.d0 i(long, u, u, u) → u
  + C0.c h(boolean, boolean, c, boolean, k, u, W0, g0, W0, o, p, int)
  + C0.c j(String, u, W0, g0, W0, c, boolean, boolean, boolean, k, a, p, p, int, int, int)
  + C5.D <init>(a, O, a, a, g, a, a, c, m, d, x0)
  + C5.c <init>(y, j, D1, g, c, c, int)
  + C5.f <init>(k, Y0, C, d)
  + C6.m <init>(J, t, o, c, d)
  + C6.w <init>(String, u, W0, g0, W0, c, boolean, boolean, boolean, k, a, p, int, int, int)
  + C6.x <init>(u, W0, g0, W0, boolean, c, boolean, boolean, k, p, int)
  + C6.x <init>(boolean, boolean, c, boolean, k, u, W0, g0, W0, o, int)
  + D1.f <init>(b, K, c, S1, T1)
  + D5.a <init>(j, int, int)
  + E0.I e() → e1
  + E0.e j() → Object
  + E0.e k() → b
  + E0.e n(String) → String
  + E0.e o()
  + E0.e p() → Uri
  + E0.e q(String) → Locale
  + E0.e r(long, List, boolean)
  + E0.e s()
  + E0.e t(Editable, KeyEvent, boolean) → boolean
  + E0.e u(f, boolean) → boolean
  + E0.e v(Object)
  + E0.e w() → int
  + E0.e x(String) → String
  + E0.e y() → Object
  + E0.e z(String) → c1
  + E0.o <init>(d, c, s)
  + E0.z <init>(e1)
  + E0.z j() → Object
  + E0.z k() → SharedPreferences
  + E0.z l(int) → e
  + E0.z m() → boolean
  + E0.z n(int, int) → G
  + E0.z o() → f
  + E0.z p()
  + E1.l d(CharSequence, int) → boolean
  + E1.l e(l) → boolean
  + E6.d <init>(t, b, o, W0, d, i, c)
  + E9.b y(u, W0, g0, W0, boolean, c, boolean, boolean, k, p, p, int)
  + F.T c(k0, e, i) → Object
  + F2.c m() → Object
  + F6.q <init>(t, o, c, d, c, c)
  + G1.d n(Uri)
  + G1.d q(int)
  + G1.e k() → int
  + G1.e l() → ContentInfo
  + G1.e n(Uri)
  + G1.e o() → int
  + G1.e q(int)
  + G1.f k() → int
  + G1.f l() → ContentInfo
  + G1.f o() → int
  + G1.m0 <init>(d, View)
  + G1.u0 <init>(d, e, n, l)
  + G1.y p(View, N0) → N0
  + G5.H <init>(A, Y0, u, a, d)
  + G5.M h(j, p, int)
  + G5.M k(p
...✂

@toluo-stripe toluo-stripe changed the title Tolu/link/launch web Prepare play integrity and launch web on failure Jan 24, 2025
@toluo-stripe toluo-stripe marked this pull request as ready for review January 24, 2025 22:57
@toluo-stripe toluo-stripe requested review from a team as code owners January 24, 2025 22:57
fun providesIntegrityStandardRequestManager(
context: Application
): IntegrityRequestManager = IntegrityStandardRequestManager(
cloudProjectNumber = 577365562050, // stripe-payments-sdk-prod
Copy link
Contributor Author

@toluo-stripe toluo-stripe Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a secret key, so it's safe. financial-connections is doing something similar here. I'm open to injecting this some other way though.

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