-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More specific Proguard rules #217
Conversation
- make proguard rules more specific - target location and core, which we use within CORE
libcore/proguard-consumer.pro
Outdated
@@ -1,5 +1,6 @@ | |||
# Consumer proguard rules for libcore | |||
|
|||
# --- GMS --- | |||
-keep class com.google.android.gms.** { *; } | |||
-keep class com.google.android.gms.location.** { *; } | |||
-keep class com.google.android.gms.common.** { *; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the reason for keeping these classes? Are you using reflection on these or any other reason why they should be kept?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per @LukasPaczos comment on the original PR that started this Proguard
change (#81 (comment)). This is necessary to prevent warnings in the maps sdk when building for release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True. However, we should only keep the required ones, or maybe we can even dontwarn
some of those?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could remove the keep
and then keep the dontwarn
. Does that implementation work for you two, without having any negative effects on the maps sdk?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refs https://developers.google.com/android/guides/setup:
Note: ProGuard directives are included in the Play services client libraries to preserve the required classes. The Android Plugin for Gradle automatically appends ProGuard configuration files in an AAR (Android ARchive) package and appends that package to your ProGuard configuration. During project creation, Android Studio automatically creates the ProGuard configuration files and build.gradle properties for ProGuard use. To use ProGuard with Android Studio, you must enable the ProGuard setting in your build.gradle buildTypes. For more information, see the ProGuard guide.
What I understand from there is that if you are not referencing any of those compoenents via reflection, we should be good with using only dontwarn
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect. I don't. I'll make the change.
- remove location and common keep rules, since we are not using reflection
Update proguard rules to be more specific and lower method counts. We utilize
common
andlocation
within theCore
library and will keep only those.fixes #199