Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3f274121 authored by Jared Duke's avatar Jared Duke
Browse files

Add global rule for -keepattributes Exceptions

R8 full mode requires an explicit keep rule for keeping attributes for a
given target (class/method/member). As such, we can set the global rule
for keeping these attributes with minimal cost while reducing the
maintenance burden for adding incremental keep rules.

For a typical Android build, this adds <20KB total to the image.

Bug: 215530220
Test: m
Change-Id: Iad3de32e27da0ca93b618d8a203ee65bae0bb5d1
parent 82d233a1
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -10,6 +10,12 @@
# and RuntimeVisibleTypeAnnotations, as well as associated defaults.
-keepattributes RuntimeVisible*Annotation*,AnnotationDefault

# With R8 full mode, certain attributes are only kept when matched with an
# explicit keep rule for that target, even with a global -keepattributes rule.
# As such, we can add the global keep rule here with minimal cost while
# simplifying incremental development.
-keepattributes Exceptions

# For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
-keepclassmembers enum * {
    public static **[] values();