jbudorick | 78730f18 | 2017-04-26 21:24:22 | [diff] [blame] | 1 | # Copyright 2017 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 | # Proguard flags for what should be kept in the main dex. Only used |
| 6 | # during main dex list determination, not during actual proguarding. |
| 7 | |
jbudorick | f091dcb | 2015-08-25 21:36:59 | [diff] [blame] | 8 | -keep @**.MainDex class * { |
| 9 | *; |
| 10 | } |
jbudorick | f667d3b3a | 2015-11-13 00:44:58 | [diff] [blame] | 11 | |
| 12 | -keepclasseswithmembers class * { |
Andrew Grieve | 524c5cdd | 2018-03-16 21:18:13 | [diff] [blame^] | 13 | @**.MainDex *; |
| 14 | } |
| 15 | |
| 16 | -keepclasseswithmembers class * { |
jbudorick | f667d3b3a | 2015-11-13 00:44:58 | [diff] [blame] | 17 | public static ** asInterface(android.os.IBinder); |
| 18 | } |
agrieve | 23ea0f5 | 2016-01-06 01:58:58 | [diff] [blame] | 19 | |
| 20 | # Required when code coverage is enabled. |
| 21 | -keep class com.vladium.** { |
jbudorick | 73357e23 | 2017-05-02 18:59:06 | [diff] [blame] | 22 | *; |
| 23 | } |
| 24 | |
John Budorick | 7c3794d | 2017-05-23 16:15:38 | [diff] [blame] | 25 | -keep public class * extends android.app.Service { |
| 26 | <init>(); |
| 27 | } |
| 28 | |
jbudorick | 73357e23 | 2017-05-02 18:59:06 | [diff] [blame] | 29 | # Used by tests for secondary dex extraction. |
| 30 | -keep class android.support.v4.content.ContextCompat { |
| 31 | *; |
agrieve | 23ea0f5 | 2016-01-06 01:58:58 | [diff] [blame] | 32 | } |
Andrew Grieve | ed8cd47 | 2018-03-16 02:06:11 | [diff] [blame] | 33 | |
| 34 | # Need test classes to be in the main dex because test listing does not |
| 35 | # load secondary dex on Dalvik devices. |
| 36 | -keep @**.RunWith class * {} |
Andrew Grieve | 524c5cdd | 2018-03-16 21:18:13 | [diff] [blame^] | 37 | |
| 38 | # The following are based on $SDK_BUILD_TOOLS/mainDexClasses.rules |
| 39 | # Ours differ in that it omits -keeps for application / instrumentation / |
| 40 | # backupagents (these are added by aapt's main dex list rules output). |
| 41 | # The keeps in this file are not only redundant, but the explicit -keep |
| 42 | # of Application.attachBaseContext() is overly broad and adds ~20k methods to |
| 43 | # chrome_public_apk at the time of this change. |
| 44 | |
| 45 | ######## START mainDexClasses.rules ######## |
| 46 | |
| 47 | # We need to keep all annotation classes because proguard does not trace annotation attribute |
| 48 | # it just filter the annotation attributes according to annotation classes it already kept. |
| 49 | -keep public class * extends java.lang.annotation.Annotation { |
| 50 | *; |
| 51 | } |
| 52 | # Keep old fashion tests in the main dex or they'll be silently ignored by InstrumentationTestRunner↵ |
| 53 | -keep public class * extends android.test.InstrumentationTestCase { |
| 54 | <init>(); |
| 55 | } |
| 56 | |
| 57 | ######## END mainDexClasses.rules ######## |