Skip to content

Remove -dontoptimize from Amazon consumer ProGuard rules#3646

Open
tsushanth wants to merge 1 commit into
RevenueCat:mainfrom
tsushanth:fix/remove-amazon-dontoptimize
Open

Remove -dontoptimize from Amazon consumer ProGuard rules#3646
tsushanth wants to merge 1 commit into
RevenueCat:mainfrom
tsushanth:fix/remove-amazon-dontoptimize

Conversation

@tsushanth

@tsushanth tsushanth commented Jun 25, 2026

Copy link
Copy Markdown

Why

feature/amazon/consumer-rules.pro contains a -dontoptimize directive 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 -dontoptimize line from feature/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 -dontoptimize from feature/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.

@tsushanth tsushanth requested a review from a team as a code owner June 25, 2026 01:32
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.

App not optimized by R8 due to the -dontoptimize rule in feature/amazon/consumer-rules.pro

2 participants