| OLD | NEW |
| 1 # Keep line number information, useful for stack traces. | 1 # Keep line number information, useful for stack traces. |
| 2 -keepattributes SourceFile,LineNumberTable | 2 -keepattributes SourceFile,LineNumberTable |
| 3 | 3 |
| 4 # Keep all annotation related attributes that can affect runtime | 4 # Keep all annotation related attributes that can affect runtime |
| 5 -keepattributes RuntimeVisible*Annotations | 5 -keepattributes RuntimeVisible*Annotations |
| 6 -keepattributes AnnotationDefault | 6 -keepattributes AnnotationDefault |
| 7 | 7 |
| 8 # Keep the annotations, because if we don't, the ProGuard rules that use them | 8 # Keep the annotations, because if we don't, the ProGuard rules that use them |
| 9 # will not be respected. These classes then show up in our final dex, which we | 9 # will not be respected. These classes then show up in our final dex, which we |
| 10 # do not want - see crbug.com/628226. | 10 # do not want - see crbug.com/628226. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 | 44 |
| 45 # Allows Proguard freedom in removing these log related calls. We ask for debug | 45 # Allows Proguard freedom in removing these log related calls. We ask for debug |
| 46 # and verbose logs to be stripped out in base.Log, so we are just ensuring we | 46 # and verbose logs to be stripped out in base.Log, so we are just ensuring we |
| 47 # get rid of all other debug/verbose logs. | 47 # get rid of all other debug/verbose logs. |
| 48 -assumenosideeffects class android.util.Log { | 48 -assumenosideeffects class android.util.Log { |
| 49 static *** d(...); | 49 static *** d(...); |
| 50 static *** v(...); | 50 static *** v(...); |
| 51 static *** isLoggable(...); | 51 static *** isLoggable(...); |
| 52 } | 52 } |
| 53 | 53 |
| 54 # The following chart was created on July 20, 2016, to decide on 3 optimization | |
| 55 # passes. | |
| 56 # optimization passes | time | .dex size | dirty memory per process | |
| 57 # ----------------------------------------------------------------- | |
| 58 # 1 | 0:48 | 5805676 | 488972 | |
| 59 # 2 | 1:07 | 5777376 | 487092 | |
| 60 # 3 | 1:24 | 5772192 | 486596 | |
| 61 # 4 | 1:42 | 5771124 | 486484 | |
| 62 # 5 | 1:56 | 5770504 | 486432 | |
| 63 -optimizationpasses 3 | |
| 64 | |
| 65 # Class merging provides negligible .dex size reduction and method count | |
| 66 # reduction (about 0.3% improvement on method count, and 0.1% savings on size), | |
| 67 # and it messes up stack traces if the classes are optimized. Thus, it is in our | |
| 68 # best interests to turn it off. See crbug.com/620323 | |
| 69 -optimizations !class/merging/* | |
| 70 | |
| 71 # Allowing Proguard to change modifiers. This change shrinks the .dex size by | |
| 72 # ~1.1%, and reduces the method count by ~4.3%. | |
| 73 -allowaccessmodification | |
| 74 | |
| 75 # Keep all enum values and valueOf methods. See | 54 # Keep all enum values and valueOf methods. See |
| 76 # http://proguard.sourceforge.net/index.html#manual/examples.html | 55 # http://proguard.sourceforge.net/index.html#manual/examples.html |
| 77 # for the reason for this. Also, see http://crbug.com/248037. | 56 # for the reason for this. Also, see http://crbug.com/248037. |
| 78 -keepclassmembers enum * { | 57 -keepclassmembers enum * { |
| 79 public static **[] values(); | 58 public static **[] values(); |
| 80 public static ** valueOf(java.lang.String); | 59 public static ** valueOf(java.lang.String); |
| 81 } | 60 } |
| OLD | NEW |