aws-amplify / aws-sdk-android

AWS SDK for Android. For more information, see our web site:
https://docs.amplify.aws
Other
1.02k stars 548 forks source link

Consumer proguard rules are too broad #3560

Open alipov opened 2 months ago

alipov commented 2 months ago

Describe the bug SDK's consumer proguard rules include the following rule that affects all enum classes in hosting application (not just the ones belonging to this SDK):

# Enums are not obfuscated correctly in combination with Gson
-keepclassmembers enum * { *; }

There are enum classes in my application whose members I want to be obfuscated, but the above rule prevents that.

To Reproduce Create an app with an enum class, consume it somewhere. Build a release version with minification/obfuscation enabled.

Which AWS service(s) are affected? None, but it affects the hosting app.

Expected behavior The SDK doesn't affect the obfuscation of host application's enum members.
For example, consider to reduce rule's scope only to classes in com.amazonaws or com.amazon packages:

-keepclassmembers enum com.amazonaws.**,com.amazon.** { *; }

Environment Information (please complete the following information):

joon-won commented 2 months ago

Hi @alipov, our team will take a look into the issue