| OLD | NEW |
| 1 # As of August 11, 2016, obfuscation was tested and passed on the trybots, | 1 # As of August 11, 2016, obfuscation was tested and passed on the trybots, |
| 2 # saving us 660kb on our .dex size and 53kb memory/process. Enable obfuscation | 2 # saving us 660kb on our .dex size and 53kb memory/process. Enable obfuscation |
| 3 # as soon as Crash supports ReTrace's deobfuscation of stack traces. | 3 # as soon as Crash supports ReTrace's deobfuscation of stack traces. |
| 4 # | 4 # |
| 5 # To enable obfuscation, remove the -keepnames rule for | 5 # To enable obfuscation, remove the -keepnames rule for |
| 6 # com.google.android.apps.chrome.** and org.chromium.**, and uncomment the | 6 # com.google.android.apps.chrome.** and org.chromium.**, and uncomment the |
| 7 # following two lines: | 7 # following two lines: |
| 8 # -renamesourcefileattribute PG | 8 # -renamesourcefileattribute PG |
| 9 # -repackageclasses "" | 9 # -repackageclasses "" |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 -optimizationpasses 3 | 25 -optimizationpasses 3 |
| 26 | 26 |
| 27 # Class merging messes up stacktraces beyond the point of them being | 27 # Class merging messes up stacktraces beyond the point of them being |
| 28 # deobfuscatable. If turned on, it would give us a 2% reduction in .dex size. | 28 # deobfuscatable. If turned on, it would give us a 2% reduction in .dex size. |
| 29 -optimizations !class/merging/* | 29 -optimizations !class/merging/* |
| 30 | 30 |
| 31 # Allowing Proguard to change modifiers. This change shrinks the .dex size by | 31 # Allowing Proguard to change modifiers. This change shrinks the .dex size by |
| 32 # ~1.1%, and reduces the method count by ~4.3%. | 32 # ~1.1%, and reduces the method count by ~4.3%. |
| 33 -allowaccessmodification | 33 -allowaccessmodification |
| 34 | 34 |
| 35 # Allows Proguard freedom in removing these log related calls. We ask for debug |
| 36 # and verbose logs to be stripped out in base.Log, so we are just ensuring we |
| 37 # get rid of all other debug/verbose logs. |
| 38 -assumenosideeffects class android.util.Log { |
| 39 static *** d(...); |
| 40 static *** v(...); |
| 41 static *** isLoggable(...); |
| 42 } |
| 43 |
| 35 # Fragments are loaded using reflection via Fragment.instantiate(Context,String) | 44 # Fragments are loaded using reflection via Fragment.instantiate(Context,String) |
| 36 # This can be improved upon - see crbug.com/622023. | 45 # This can be improved upon - see crbug.com/622023. |
| 37 -keep public class com.google.android.apps.chrome** extends android.app.Fragment | 46 -keep public class com.google.android.apps.chrome** extends android.app.Fragment |
| 38 -keep public class org.chromium** extends android.app.Fragment | 47 -keep public class org.chromium** extends android.app.Fragment |
| 39 | 48 |
| 40 # These classes aren't themselves referenced, but __ProcessService[0,1,2...] are | 49 # These classes aren't themselves referenced, but __ProcessService[0,1,2...] are |
| 41 # referenced, and we look up these services by appending a number onto the name | 50 # referenced, and we look up these services by appending a number onto the name |
| 42 # of the base class. Thus, we need to keep the base class name around so that | 51 # of the base class. Thus, we need to keep the base class name around so that |
| 43 # the child classes can be looked up. | 52 # the child classes can be looked up. |
| 44 -keep class org.chromium.content.app.SandboxedProcessService | 53 -keep class org.chromium.content.app.SandboxedProcessService |
| (...skipping 10 matching lines...) Expand all Loading... |
| 55 public <init>(...); | 64 public <init>(...); |
| 56 } | 65 } |
| 57 | 66 |
| 58 # Google Play Services warnings are about its resources. | 67 # Google Play Services warnings are about its resources. |
| 59 -dontwarn com.google.android.gms.R** | 68 -dontwarn com.google.android.gms.R** |
| 60 | 69 |
| 61 # The support library contains references to newer platform versions. | 70 # The support library contains references to newer platform versions. |
| 62 # Don't warn about those in case this app is linking against an older | 71 # Don't warn about those in case this app is linking against an older |
| 63 # platform version. We know about them, and they are safe. | 72 # platform version. We know about them, and they are safe. |
| 64 -dontwarn android.support.** | 73 -dontwarn android.support.** |
| OLD | NEW |