Skip to content

Commit 19fb81a

Browse files
authored
fix #2161 remove setting r8 fullmode to false use proguard instead (#2162)
* fix #2161 remove setting r8 fullmode to false use proguard instead * fix readme for stripe package * chore fix integration test
1 parent b65add0 commit 19fb81a

File tree

6 files changed

+17
-22
lines changed

6 files changed

+17
-22
lines changed

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,11 @@ This plugin requires several changes to be able to work on Android devices. Plea
5959
-dontwarn com.stripe.android.pushProvisioning.PushProvisioningActivityStarter$Error
6060
-dontwarn com.stripe.android.pushProvisioning.PushProvisioningActivityStarter
6161
-dontwarn com.stripe.android.pushProvisioning.PushProvisioningEphemeralKeyProvider
62+
# Keep Stripe classes
63+
-keep class com.stripe.** { *; }
6264
```
63-
8. Add the following line to your `gradle.properties` file: [example](https://github.com/flutter-stripe/flutter_stripe/blob/master/example/android/gradle.properties)
64-
```properties
65-
android.enableR8.fullMode=false
66-
```
67-
This will prevent crashes with the Stripe SDK on Android (see [issue](https://github.com/flutter-stripe/flutter_stripe/issues/1909)).
6865

69-
9. Rebuild the app, as the above changes don't update with hot reload
66+
8. Rebuild the app, as the above changes don't update with hot reload
7067

7168
These changes are needed because the Android Stripe SDK requires the use of the AppCompat theme for their UI components and the Support Fragment Manager for the Payment Sheets
7269

example/android/app/proguard-rules.pro

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22
-dontwarn com.stripe.android.pushProvisioning.PushProvisioningActivityStarter$Args
33
-dontwarn com.stripe.android.pushProvisioning.PushProvisioningActivityStarter$Error
44
-dontwarn com.stripe.android.pushProvisioning.PushProvisioningActivityStarter
5-
-dontwarn com.stripe.android.pushProvisioning.PushProvisioningEphemeralKeyProvider
5+
-dontwarn com.stripe.android.pushProvisioning.PushProvisioningEphemeralKeyProvider
6+
# Keep Stripe classes
7+
-keep class com.stripe.** { *; }

example/android/gradle.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
org.gradle.jvmargs=-Xmx1536M
22
android.useAndroidX=true
33
android.enableJetifier=true
4-
android.enableR8.fullMode=false

example/integration_test/app_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ void main() {
6868
number: '4242424242424242',
6969
cvc: '424',
7070
expirationMonth: 04,
71-
expirationYear: 2025,
71+
expirationYear: 2026,
7272
);
7373
await Stripe.instance.dangerouslyUpdateCardDetails(cardDetails);
7474

example/integration_test/payment_method_test.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ void main() {
4141
number: '378282246310005', // Use a card does not support 3DS
4242
cvc: '424',
4343
expirationMonth: 04,
44-
expirationYear: 2025,
44+
expirationYear: 2026,
4545
));
4646

4747
final paymentIntent = await Stripe.instance.confirmPayment(
@@ -63,7 +63,7 @@ void main() {
6363
number: '4242424242424242',
6464
cvc: '424',
6565
expirationMonth: 04,
66-
expirationYear: 2025,
66+
expirationYear: 2026,
6767
));
6868

6969
final paymentMethod = await Stripe.instance.createPaymentMethod(
@@ -78,7 +78,7 @@ void main() {
7878
expect(paymentMethod.card.brand, equals('Visa'));
7979
expect(paymentMethod.card.country, equals('US'));
8080
expect(paymentMethod.card.expMonth, equals(04));
81-
expect(paymentMethod.card.expYear, equals(2025));
81+
expect(paymentMethod.card.expYear, equals(2026));
8282
expect(paymentMethod.card.last4, equals('4242'));
8383
});
8484

@@ -87,7 +87,7 @@ void main() {
8787
number: '4242424242424242',
8888
cvc: '424',
8989
expirationMonth: 04,
90-
expirationYear: 2025,
90+
expirationYear: 2026,
9191
));
9292

9393
final cardPaymentMethod = await Stripe.instance.createPaymentMethod(
@@ -110,7 +110,7 @@ void main() {
110110
expect(paymentMethod.card.brand, equals('Visa'));
111111
expect(paymentMethod.card.country, equals('US'));
112112
expect(paymentMethod.card.expMonth, equals(04));
113-
expect(paymentMethod.card.expYear, equals(2025));
113+
expect(paymentMethod.card.expYear, equals(2026));
114114
expect(paymentMethod.card.last4, equals('4242'));
115115
});
116116

@@ -119,7 +119,7 @@ void main() {
119119
number: '4242424242424242',
120120
cvc: '424',
121121
expirationMonth: 04,
122-
expirationYear: 2025,
122+
expirationYear: 2026,
123123
));
124124

125125
final token = await Stripe.instance.createToken(
@@ -137,7 +137,7 @@ void main() {
137137
expect(paymentMethod.card.brand, equals('Visa'));
138138
expect(paymentMethod.card.country, equals('US'));
139139
expect(paymentMethod.card.expMonth, equals(04));
140-
expect(paymentMethod.card.expYear, equals(2025));
140+
expect(paymentMethod.card.expYear, equals(2026));
141141
expect(paymentMethod.card.last4, equals('4242'));
142142
});
143143
testWidgets('alipay', (tester) async {

packages/stripe/README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,11 @@ This plugin requires several changes to be able to work on Android devices. Plea
5959
-dontwarn com.stripe.android.pushProvisioning.PushProvisioningActivityStarter$Error
6060
-dontwarn com.stripe.android.pushProvisioning.PushProvisioningActivityStarter
6161
-dontwarn com.stripe.android.pushProvisioning.PushProvisioningEphemeralKeyProvider
62+
# Keep Stripe classes
63+
-keep class com.stripe.** { *; }
6264
```
63-
8. Add the following line to your `gradle.properties` file: [example](https://github.com/flutter-stripe/flutter_stripe/blob/master/example/android/gradle.properties)
64-
```properties
65-
android.enableR8.fullMode=false
66-
```
67-
This will prevent crashes with the Stripe SDK on Android (see [issue](https://github.com/flutter-stripe/flutter_stripe/issues/1909)).
6865

69-
9. Rebuild the app, as the above changes don't update with hot reload
66+
8. Rebuild the app, as the above changes don't update with hot reload
7067

7168
These changes are needed because the Android Stripe SDK requires the use of the AppCompat theme for their UI components and the Support Fragment Manager for the Payment Sheets
7269

0 commit comments

Comments
 (0)