Remove -dontoptimize from Amazon consumer ProGuard rules#3646
Open
tsushanth wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
feature/amazon/consumer-rules.procontains a-dontoptimizedirective that disables R8/ProGuard optimization globally for any app that depends on the Amazon billing feature. This causes the entire consuming app to skip optimization, not just the Amazon SDK classes — silently inflating APK size and degrading runtime performance for all customers using the Amazon appstore variant.The rule was almost certainly a defensive copy-paste from Amazon's own SDK documentation, which advises it for their internal SDK. It is not needed for the RevenueCat wrapper and has no documented justification in the file.
What changes
Remove the
-dontoptimizeline fromfeature/amazon/consumer-rules.pro. The remaining rules (-dontwarn,-keep class com.amazon.**,-keepattributes *Annotation*) are unaffected and continue to prevent stripping of Amazon SDK reflection targets.Validation
R8 optimization is now re-enabled for the Amazon feature module's consumers. The existing
-keep class com.amazon.** {*;}rule still prevents any Amazon SDK class from being removed or renamed, so there is no regression risk for Amazon IAP calls. No logic in the RevenueCat codebase relies on optimization being disabled.Fixes #3496
Note
Low Risk
Single-line ProGuard consumer rule change with Amazon SDK classes still fully kept; no runtime logic changes.
Overview
Removes
-dontoptimizefromfeature/amazon/consumer-rules.pro, so apps that depend on the Amazon billing feature no longer inherit a rule that turned off R8/ProGuard optimization for the whole app.-dontwarn,-keep class com.amazon.**, and-keepattributes *Annotation*are unchanged and still protect Amazon SDK classes from stripping/renaming.Reviewed by Cursor Bugbot for commit 7b22faf. Bugbot is set up for automated code reviews on this repo. Configure here.