1# Copyright 2016 The Chromium Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5# Contains flags that we'd like all Chromium .apks to use. 6 7# Not needed for Android and saves a bit of processing time. 8-dontpreverify 9 10# Keep line number information, useful for stack traces. 11-keepattributes SourceFile,LineNumberTable 12 13# Keep all CREATOR fields within Parcelable that are kept. 14-keepclassmembers class * implements android.os.Parcelable { 15 public static *** CREATOR; 16} 17 18# Don't obfuscate Parcelables as they might be marshalled outside Chrome. 19# If we annotated all Parcelables that get put into Bundles other than 20# for saveInstanceState (e.g. PendingIntents), then we could actually keep the 21# names of just those ones. For now, we'll just keep them all. 22-keepnames class * implements android.os.Parcelable 23 24# Keep all enum values and valueOf methods. See 25# http://proguard.sourceforge.net/index.html#manual/examples.html 26# for the reason for this. Also, see http://crbug.com/248037. 27-keepclassmembers enum * { 28 public static **[] values(); 29} 30 31# Keep classes implementing ParameterProvider -- these will be instantiated 32# via reflection. 33-keep class * implements org.chromium.base.test.params.ParameterProvider 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 44# The following chart was created on July 20, 2016, to decide on 3 optimization 45# passes for Chrome. 46# optimization passes | time | .dex size | dirty memory per process 47# ----------------------------------------------------------------- 48# 1 | 0:48 | 5805676 | 488972 49# 2 | 1:07 | 5777376 | 487092 50# 3 | 1:24 | 5772192 | 486596 51# 4 | 1:42 | 5771124 | 486484 52# 5 | 1:56 | 5770504 | 486432 53-optimizationpasses 3 54 55# Horizontal class merging marginally increases dex size (as of Mar 2018). 56-optimizations !class/merging/horizontal 57 58# Allowing Proguard to change modifiers. This change shrinks the .dex size by 59# ~1%, and reduces the method count by ~4%. 60-allowaccessmodification 61 62# The support library contains references to newer platform versions. 63# Don't warn about those in case this app is linking against an older 64# platform version. We know about them, and they are safe. 65-dontwarn android.support.** 66