Relax consumer rules to allow for better minifying and obfuscation#1193
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1193 +/- ##
=======================================
Coverage 85.92% 85.92%
=======================================
Files 181 181
Lines 6217 6217
Branches 900 900
=======================================
Hits 5342 5342
Misses 533 533
Partials 342 342 ☔ View full report in Codecov by Sentry. |
This reverts commit 83ecfa7.
vegaro
left a comment
There was a problem hiding this comment.
Are the classes annotated with @Parcelize correctly kept?
| @@ -1,4 +1,4 @@ | |||
| -keep class com.revenuecat.** { *; } | |||
| -keep class com.revenuecat.purchases.amazon.** {*;} | |||
There was a problem hiding this comment.
Is this needed? We are already keeping them in the consumer rules of the amazon module ttps://github.com//pull/1193/files#diff-327934b4ae63dd824b813f85b180c4689acb3a23339ecee4dbdb40d40dec32da
There was a problem hiding this comment.
Actually, it seems it's not needed in either place. I've tried removing it from both places and testing the app with a minified build with amazon support and it worked fine. It makes sense since we aren't accessing the Amazon SDK with reflection anymore. Removed these rules here: 93608fd
From what I've seen in the official documentation, I don't think that's necessary. Parcelize works using code generation, not reflection so it should work fine even if the code/fields are minified. |
…n for those anymore
| # hide the original source file name. | ||
| #-renamesourcefileattribute SourceFile | ||
| -keep class com.revenuecat.purchases.** { *; } No newline at end of file | ||
| -keep class com.revenuecat.purchases.** { *; } |
There was a problem hiding this comment.
I wonder if we should remove these? Devs are not supposed to add this since this keeps everything, removing it from here might help us find issues if we ever have any?
There was a problem hiding this comment.
Right, I was thinking we probably wanted to remove the integration tests module soon. But it's true this now allow us to run some basic tests against a minified version of the SDK that we wouldn't have otherwise,
Description
This PR relaxes the rules in our
consumer-rules.profiles. This allows to obfuscate and minify more code from our SDK. Note that this means that stack traces will be obfuscated moving forward and will need the mapping file in order to deobfuscate.