Skip to content

Commit dd24027

Browse files
committed
Add consumer proguard rules to prevent minification
1 parent f0cc289 commit dd24027

File tree

6 files changed

+31
-11
lines changed

6 files changed

+31
-11
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## 3.1.2 - November 4, 2024
4+
5+
- Add `consumerProguardRules` build.gradle option to prevent minification of
6+
classes in release builds.
7+
38
## 3.1.1 - November 1, 2024
49

510
- Logs invalid JSON for lifecycle events

modules/@shopify/checkout-sheet-kit/android/build.gradle

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,16 @@ android {
6060
}
6161

6262
buildTypes {
63+
debug {
64+
minifyEnabled true
65+
// consumerProguardFiles 'proguard-rules.pro'
66+
}
67+
6368
release {
64-
minifyEnabled false
69+
minifyEnabled true
70+
71+
// Rules in consumerProguardFiles are automatically included in the ProGuard configuration of any application that uses the library
72+
// consumerProguardFiles 'proguard-rules.pro'
6573
}
6674
}
6775

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Keep the ObjectMapper and its methods
2+
-keep class com.fasterxml.jackson.databind.ObjectMapper { *; }
3+
4+
# Keep Checkout Sheet Kit classes
5+
-keep class com.shopify.checkoutsheetkit.lifecycleevents.CheckoutCompletedEvent { *; }
6+
-keep class com.shopify.checkoutsheetkit.pixelevents.PixelEvent { *; }
7+
-keep class com.shopify.checkoutsheetkit.CheckoutException { *; }
8+
-keep class com.shopify.checkoutsheetkit.CheckoutExpiredException { *; }
9+
-keep class com.shopify.checkoutsheetkit.ClientException { *; }
10+
-keep class com.shopify.checkoutsheetkit.HttpException { *; }
11+
-keep class com.shopify.checkoutsheetkit.ConfigurationException { *; }
12+
-keep class com.shopify.checkoutsheetkit.CheckoutSheetKitException { *; }

modules/@shopify/checkout-sheet-kit/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@shopify/checkout-sheet-kit",
33
"license": "MIT",
4-
"version": "3.1.1",
4+
"version": "3.1.2",
55
"main": "lib/commonjs/index.js",
66
"types": "src/index.ts",
77
"source": "src/index.ts",

sample/android/app/build.gradle

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,6 @@ react {
5353
hermesFlags = ["-O", "-output-source-map"]
5454
}
5555

56-
/**
57-
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
58-
*/
59-
def enableProguardInReleaseBuilds = false
60-
6156
/**
6257
* The preferred build flavor of JavaScriptCore (JSC)
6358
*
@@ -115,8 +110,8 @@ android {
115110
}
116111
release {
117112
signingConfig signingConfigs.release
118-
minifyEnabled enableProguardInReleaseBuilds
119-
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
113+
minifyEnabled true
114+
proguardFiles "proguard-rules.pro"
120115
}
121116
}
122117
}

sample/ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,7 +1235,7 @@ PODS:
12351235
- ReactCommon/turbomodule/bridging
12361236
- ReactCommon/turbomodule/core
12371237
- Yoga
1238-
- RNShopifyCheckoutSheetKit (3.1.0):
1238+
- RNShopifyCheckoutSheetKit (3.1.1):
12391239
- React-Core
12401240
- ShopifyCheckoutSheetKit (~> 3.1.1)
12411241
- RNVectorIcons (10.0.3):
@@ -1524,7 +1524,7 @@ SPEC CHECKSUMS:
15241524
RNGestureHandler: 9b113eb9b7a4cbe66e1dbf4d9914281863ee0703
15251525
RNReanimated: d534e0114e2c3e7011550a78ecf2d0b431435a60
15261526
RNScreens: 23dad53fc9db1da2c93e647ae33fd7ce2bd49d60
1527-
RNShopifyCheckoutSheetKit: 3d854ed7fe1bc96eab4718819ee79d33488066bc
1527+
RNShopifyCheckoutSheetKit: 0fb6aa9fe539a331f313d8e009ecb1917fc6c103
15281528
RNVectorIcons: 50ea777efffdd991a22e968aa312d75da7ff46c3
15291529
ShopifyCheckoutSheetKit: fe309799b18b8d554f28c3f075d6d57d4811c9ab
15301530
SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d

0 commit comments

Comments
 (0)