-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Update ProGuard default shrinking rules #2448
Changes from 2 commits
7fa9ef5
e384d4d
f60e17d
eea08d0
4c40a91
c34126b
af98d32
ac6e590
8d14f1a
743d529
3468700
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,6 +65,6 @@ | |
# See also https://github.com/google/gson/pull/2420#discussion_r1241813541 for a more detailed explanation | ||
-if class * | ||
-keepclasseswithmembers,allowobfuscation,allowoptimization class <1> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you remove There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Having |
||
<init>(); | ||
<init>(...); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please adjust the comment in lines 62 and 63 (GitHub does not let me comment there); for example reword it to:
|
||
@com.google.gson.annotations.SerializedName <fields>; | ||
} |
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.
I think this
if class *
,-classeswithmembers... class <1>
doesn't do anything relative to-classeswithmembers... class *
, after reading some of the follow-up threads on that change.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.
At least for R8 it does seem to make a difference:
-keepclasseswithmembers ... class *
always keeps the class, even if it isn't used. Whereas-if class * ... -keepclasseswithmembers ... class <1>
only keeps the class if it is actually used.Unfortunately this is not covered by the tests yet; have created #2455 to add a test for this.
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.
Thanks also for the other points you raised, but unless sgjesse wants to address them here as well could you please create a separate GitHub issue or pull request? Otherwise the discussion on this pull request here might drift too far away from the original topic.
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.
Changed the rules to be two
-if
rules