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

[WIP] Test terminal size #10383

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft

Conversation

davidme-stripe
Copy link
Contributor

Summary

Motivation

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

Before After
before screenshot after screenshot

Changelog

Copy link
Contributor

Risky Change

This is considered a risky change because it adjusts the sample app build.gradle, please review carefully.
We've seen issues in the past which resulted in failed builds for merchants. Please make sure the build.gradle change is intended.

By adding the label accept-risky-change to this PR, I acknowledge that I'm changing an example app and have verified that the SDK remains in a shippable state.

Copy link
Contributor

github-actions bot commented Mar 12, 2025

Diffuse output:

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

          │             compressed             │           uncompressed           
          ├───────────┬───────────┬────────────┼──────────┬──────────┬────────────
 APK      │ old       │ new       │ diff       │ old      │ new      │ diff       
──────────┼───────────┼───────────┼────────────┼──────────┼──────────┼────────────
      dex │   4.1 MiB │  14.9 MiB │  +10.8 MiB │    9 MiB │ 43.9 MiB │  +34.8 MiB 
     arsc │   2.4 MiB │   2.6 MiB │ +192.5 KiB │  2.4 MiB │  2.6 MiB │ +192.5 KiB 
 manifest │   5.2 KiB │   5.9 KiB │     +767 B │ 25.7 KiB │ 29.4 KiB │   +3.6 KiB 
      res │ 909.3 KiB │   1.2 MiB │ +356.1 KiB │  1.4 MiB │    2 MiB │ +605.8 KiB 
   native │   2.6 MiB │  20.2 MiB │  +17.6 MiB │    6 MiB │ 20.2 MiB │  +14.1 MiB 
    asset │   1.6 MiB │   4.2 MiB │   +2.6 MiB │  1.6 MiB │  4.4 MiB │   +2.8 MiB 
    other │   1.4 MiB │ 881.5 KiB │ -514.2 KiB │  1.6 MiB │  1.1 MiB │ -559.4 KiB 
──────────┼───────────┼───────────┼────────────┼──────────┼──────────┼────────────
    total │  12.9 MiB │    44 MiB │  +31.1 MiB │ 22.1 MiB │ 74.2 MiB │  +52.1 MiB 

         │           raw            │                  unique                   
         ├───────┬────────┬─────────┼───────┬────────┬──────────────────────────
 DEX     │ old   │ new    │ diff    │ old   │ new    │ diff                     
─────────┼───────┼────────┼─────────┼───────┼────────┼──────────────────────────
   files │     1 │      5 │      +4 │       │        │                          
 strings │ 42834 │ 230563 │ +187729 │ 42834 │ 197485 │ +154651 (+165231 -10580) 
   types │ 15365 │  50921 │  +35556 │ 15365 │  43332 │  +27967 (+37457 -9490)   
 classes │ 12970 │  39391 │  +26421 │ 12970 │  39391 │  +26421 (+34876 -8455)   
 methods │ 62776 │ 271239 │ +208463 │ 62776 │ 258248 │ +195472 (+239044 -43572) 
  fields │ 41803 │ 117929 │  +76126 │ 41803 │ 114809 │  +73006 (+106909 -33903) 

 ARSC    │ old  │ new  │ diff           
─────────┼──────┼──────┼────────────────
 configs │  243 │  236 │   -7 (+5 -12)  
 entries │ 6274 │ 6769 │ +495 (+498 -3)
APK
         compressed         │        uncompressed        │                                                                                              
─────────────┬──────────────┼─────────────┬──────────────┤                                                                                              
 size        │ diff         │ size        │ diff         │ path                                                                                         
─────────────┼──────────────┼─────────────┼──────────────┼──────────────────────────────────────────────────────────────────────────────────────────────
     4.2 MiB │     +4.2 MiB │     4.2 MiB │     +4.2 MiB │ + lib/arm64-v8a/libcots-android-native.so                                                    
     4.2 MiB │     +4.2 MiB │     4.2 MiB │     +4.2 MiB │ + lib/armeabi-v7a/libcots-android-native.so                                                  
     3.4 MiB │     +3.4 MiB │    10.3 MiB │    +10.3 MiB │ + classes3.dex                                                                               
     3.1 MiB │     +3.1 MiB │    10.8 MiB │    +10.8 MiB │ + classes4.dex                                                                               
       3 MiB │       +3 MiB │     8.8 MiB │     +8.8 MiB │ + classes2.dex                                                                               
     2.2 MiB │     +2.2 MiB │     2.2 MiB │     +2.2 MiB │ + assets/com/s/e/a96784079b58d357b-                                                          
     1.8 MiB │     +1.8 MiB │     5.3 MiB │     +5.3 MiB │ + classes5.dex                                                                               
     1.1 MiB │     +1.1 MiB │     1.1 MiB │     +1.1 MiB │ + lib/arm64-v8a/libdf96.so                                                                   
     1.9 MiB │     +1.1 MiB │     1.9 MiB │          0 B │ ∆ lib/x86_64/libtensorflowlite_jni.so                                                        
     1.7 MiB │       +1 MiB │     1.7 MiB │          0 B │ ∆ lib/x86/libtensorflowlite_jni.so                                                           
 1,005.5 KiB │ +1,005.5 KiB │ 1,005.4 KiB │ +1,005.4 KiB │ + lib/x86_64/libdf96.so                                                                      
   977.7 KiB │   +977.7 KiB │   977.6 KiB │   +977.6 KiB │ + lib/armeabi-v7a/libdf96.so                                                                 
   918.3 KiB │   +918.3 KiB │   918.2 KiB │   +918.2 KiB │ + lib/arm64-v8a/libsecurepin_.so                                                             
     1.4 MiB │   +808.6 KiB │     1.4 MiB │          0 B │ ∆ lib/arm64-v8a/libtensorflowlite_jni.so                                                     
             │   -731.9 KiB │             │     -735 KiB │ - org/bouncycastle/pqc/crypto/picnic/lowmcL5.bin.properties                                  
   623.3 KiB │   +623.3 KiB │   623.1 KiB │   +623.1 KiB │ + lib/armeabi-v7a/libsecurepin_.so                                                           
     3.5 MiB │   -586.4 KiB │     8.6 MiB │   -419.8 KiB │ ∆ classes.dex                                                                                
   440.2 KiB │   +440.2 KiB │   440.1 KiB │   +440.1 KiB │ + lib/x86_64/libagnos.so                                                                     
   911.8 KiB │   +422.1 KiB │   911.7 KiB │          0 B │ ∆ lib/armeabi-v7a/libtensorflowlite_jni.so                                                   
   413.7 KiB │   +413.7 KiB │   413.6 KiB │   +413.6 KiB │ + lib/arm64-v8a/libagnos.so                                                                  
   337.7 KiB │   +337.7 KiB │   337.4 KiB │   +337.4 KiB │ + com/mastercard/terminalsdk/internal/b-                                                     
   285.8 KiB │   +285.8 KiB │   285.7 KiB │   +285.7 KiB │ + lib/armeabi-v7a/libagnos.so                                                                
     2.6 MiB │   +192.5 KiB │     2.6 MiB │   +192.5 KiB │ ∆ resources.arsc                                                                             
   144.4 KiB │   +144.4 KiB │   258.8 KiB │   +258.8 KiB │ + res/g0.otf                                                                                 
   135.4 KiB │   +135.4 KiB │   248.8 KiB │   +248.8 KiB │ + res/Lz.otf                                                                                 
   123.5 KiB │   +123.5 KiB │     218 KiB │     +218 KiB │ + as
...✂
MANIFEST
@@ -11,3 +11,3 @@
   <uses-sdk
-      android:minSdkVersion="21"
+      android:minSdkVersion="26"
       android:targetSdkVersion="34"
@@ -34,2 +34,19 @@
       />
+  <uses-feature
+      android:name="android.hardware.nfc"
+      android:required="false"
+      />
+  <uses-permission
+      android:name="android.permission.ACCESS_NETWORK_STATE"
+      />
+  <uses-permission
+      android:name="android.permission.NFC"
+      />
+  <uses-permission
+      android:name="android.permission.READ_PHONE_STATE"
+      />
+  <uses-permission
+      android:minSdkVersion="31"
+      android:name="android.permission.HIDE_OVERLAY_WINDOWS"
+      />
   <queries>
@@ -59,5 +76,2 @@
       />
-  <uses-permission
-      android:name="android.permission.ACCESS_NETWORK_STATE"
-      />
   <uses-feature
@@ -66,2 +80,8 @@
       />
+  <uses-permission
+      android:name="android.permission.BLUETOOTH"
+      />
+  <uses-permission
+      android:name="android.permission.BLUETOOTH_ADMIN"
+      />
   <permission
@@ -75,3 +95,4 @@
       android:appComponentFactory="androidx.core.app.CoreComponentFactory"
-      android:extractNativeLibs="true"
+      android:extractNativeLibs="false"
+      android:gwpAsanMode="1"
       android:icon="@mipmap/ic_launcher"
@@ -165,2 +186,40 @@
         android:exported="false"
+        android:name="com.stripe.cots.activity.ContactlessPaymentActivity"
+        android:process=":stripetaptopay"
+        android:theme="@style/Theme.CotsApp"
+        >
+      <intent-filter>
+        <action
+            android:name="android.nfc.action.NDEF_DISCOVERED"
+            />
+        <category
+            android:name="android.intent.category.DEFAULT"
+            />
+      </intent-filter>
+    </activity>
+    <activity
+        android:exported="false"
+        android:name="com.stripe.cots.simulator.SimulatedContactlessPaymentActivity"
+        android:process=":stripetaptopay"
+        android:theme="@style/Theme.CotsApp"
+        />
+    <activity
+        android:configChanges="0x1184"
+        android:name="com.whitecryption.securepin.TuiActivity"
+        android:process=":stripetaptopay"
+        android:screenOrientation="1"
+        android:theme="@style/NoDisplayCutout"
+        />
+    <service
+        android:exported="false"
+        android:name="com.stripe.cots.aidlservice.CotsService"
+        android:process=":stripetaptopay"
+        />
+    <service
+        android:exported="false"
+        android:name="com.stripe.cots.aidlservice.SimulatedCotsService"
+        android:process=":stripetaptopay"
+        />
+    <activity
+        android:exported="false"
         android:name="com.stripe.android.paymentsheet.PaymentSheetActivity"
@@ -415,2 +474,21 @@
     <activity
+        android:excludeFromRecents="true"
+        android:exported="false"
+        android:label="@string/app_name"
+        android:name="com.stripe.stripeterminal.internal.common.usb.UsbEventReceiverActivity"
+        android:noHistory="true"
+        android:taskAffinity="com.stripe.stripeterminal.taskAffinityUsbEventReceiver"
+        android:theme="@style/Theme.Transparent"
+        >
+      <intent-filter>
+        <action
+            android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
+            />
+      </intent-filter>
+      <meta-data
+          android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
+          android:resource="@xml/usb_device_filter"
+          />
+    </activity>
+    <activity
         android:exported="true"
@@ -444,2 +522,7 @@
         />
+    <service
+        android:directBootAware="true"
+        android:exported="false"
+        android:name="androidx.room.MultiInstanceInvalidationService"
+        />
     <meta-data
DEX
STRINGS:

   old   │ new    │ diff                     
  ───────┼────────┼──────────────────────────
   42834 │ 197485 │ +154651 (+165231 -10580) 
  
  +

Copy link

emerge-tools bot commented Mar 12, 2025

1 build increased size, 2 builds decreased size

Name Version Download Change Install Change Approval
Stripe Identity Example
com.stripe.android.identity.example.theme1
21.6.0-theme1 (20) 3.7 MB ⬇️ 74.6 kB (-1.96%) 8.8 MB ⬇️ 196.0 kB (-2.18%) N/A
Financial Connections Example
com.stripe.android.financialconnections.example
21.6.0 (210600) 5.5 MB ⬇️ 100.8 kB (-1.81%) 10.7 MB ⬇️ 236.6 kB (-2.17%) N/A
⚠️ PaymentSheet Example
com.stripe.android.paymentsheet.example
21.6.0 (11) 26.6 MB ⬆️ 18.0 MB (209.31%) 63.2 MB ⬆️ 46.8 MB (286.43%) N/A

Stripe Identity Example 21.6.0-theme1 (20)
com.stripe.android.identity.example.theme1

⚖️ Compare build
⏱️ Analyze build performance

Total install size change: ⬇️ 196.0 kB (-2.18%)
Total download size change: ⬇️ 74.6 kB (-1.96%)

Largest size changes

Item Install Size Change Download Size Change
🗑 androidx.camera.core.impl.utils.executor.MainThreadExecutor ⬇️ -62.1 kB ⬇️ -29.8 kB
androidx.compose.ui.input.key.KeyEvent_androidKt ⬇️ -40.9 kB ⬇️ -19.6 kB
androidx.recyclerview.widget.RecyclerView ⬇️ -30.0 kB ⬇️ -14.4 kB
android.support.v4.media.session.MediaSessionCompat ⬇️ -28.1 kB ⬇️ -13.5 kB
🗑 androidx.constraintlayout.core.widgets.ConstraintAnchor$Type$Enum... ⬇️ -25.0 kB ⬇️ -12.0 kB
View Treemap

Image of diff

Financial Connections Example 21.6.0 (210600)
com.stripe.android.financialconnections.example

⚖️ Compare build
⏱️ Analyze build performance

Total install size change: ⬇️ 236.6 kB (-2.17%)
Total download size change: ⬇️ 100.8 kB (-1.81%)

Largest size changes

Item Install Size Change Download Size Change
🗑 com.stripe.android.paymentsheet.paymentdatacollection.polling.Pol... ⬇️ -65.4 kB ⬇️ -30.8 kB
🗑 _COROUTINE ⬇️ -52.3 kB ⬇️ -24.6 kB
🗑 kotlin.collections.builders.ListBuilderKt ⬇️ -47.6 kB ⬇️ -22.5 kB
🗑 com.nimbusds.jose.util.Base64Codec ⬇️ -44.8 kB ⬇️ -21.1 kB
🗑 kotlin.comparisons.ComparisonsKt__ComparisonsKt ⬇️ -43.1 kB ⬇️ -20.3 kB
View Treemap

Image of diff

PaymentSheet Example 21.6.0 (11)
com.stripe.android.paymentsheet.example

⚖️ Compare build
⏱️ Analyze build performance

Total install size change: ⬆️ 46.8 MB (286.43%)
Total download size change: ⬆️ 18.0 MB (209.31%)

Largest size changes

Item Install Size Change Download Size Change
📝 libcots-android-native.so ⬆️ 4.4 MB ⬆️ 2.9 MB
📝 a96784079b58d357b- ⬆️ 2.3 MB ⬆️ 2.3 MB
🗑 lowmcL5.bin.properties ⬇️ -749.3 kB ⬇️ -749.3 kB
📝 libsecurepin_.so ⬆️ 940.2 kB ⬆️ 511.1 kB
📝 libdf96.so ⬆️ 1.2 MB ⬆️ 490.9 kB
View Treemap

Image of diff


🛸 Powered by Emerge Tools

Comment trigger: Size diff threshold of 100.00kB exceeded

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