blob: 31dbdd619ea0f4092b9eb389b610b6de6c043aa5 [file] [log] [blame]
jbudorick78730f182017-04-26 21:24:221# 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
Andrew Grievefaee7be2018-03-26 20:00:138-keep @org.chromium.base.annotations.MainDex class * {
jbudorickf091dcb2015-08-25 21:36:599 *;
10}
jbudorickf667d3b3a2015-11-13 00:44:5811
12-keepclasseswithmembers class * {
Andrew Grievefaee7be2018-03-26 20:00:1313 @org.chromium.base.annotations.MainDex <methods>;
Andrew Grieve524c5cdd2018-03-16 21:18:1314}
15
Andrew Grievefaee7be2018-03-26 20:00:1316# Assume all IDL-generated classes should be kept. They can't reference other
17# non-framework classes, so fairly low-risk.
Andrew Grieve524c5cdd2018-03-16 21:18:1318-keepclasseswithmembers class * {
jbudorickf667d3b3a2015-11-13 00:44:5819 public static ** asInterface(android.os.IBinder);
20}
agrieve23ea0f52016-01-06 01:58:5821
22# Required when code coverage is enabled.
23-keep class com.vladium.** {
jbudorick73357e232017-05-02 18:59:0624 *;
25}
26
Andrew Grievefaee7be2018-03-26 20:00:1327# Renderers / GPU process don't load secondary dex.
Andrew Grieve4fdd0122018-03-19 16:38:2228-keep public class * extends org.chromium.base.process_launcher.ChildProcessService {
29 *;
30}
31
jbudorick73357e232017-05-02 18:59:0632# Used by tests for secondary dex extraction.
33-keep class android.support.v4.content.ContextCompat {
34 *;
agrieve23ea0f52016-01-06 01:58:5835}
Andrew Grieveed8cd472018-03-16 02:06:1136
Andrew Grieve524c5cdd2018-03-16 21:18:1337# The following are based on $SDK_BUILD_TOOLS/mainDexClasses.rules
Andrew Grieve66b933a52018-03-20 01:32:2438# Ours differ in that:
39# 1. It omits -keeps for application / instrumentation / backupagents (these are
40# redundant since they are added by aapt's main dex list rules output).
41# 2. Omits keep for Application.attachBaseContext(), which is overly broad.
42# 3. Omits keep for all annotations, which is also overly broad (and pulls in
43# any class that has an @IntDef).
Andrew Grieve524c5cdd2018-03-16 21:18:1344
45######## START mainDexClasses.rules ########
46
Andrew Grieve66b933a52018-03-20 01:32:2447# Keep old fashion tests in the main dex or they'll be silently ignored by InstrumentationTestRunner
Andrew Grieve524c5cdd2018-03-16 21:18:1348-keep public class * extends android.test.InstrumentationTestCase {
Andrew Grieve66b933a52018-03-20 01:32:2449 <init>();
Andrew Grieve524c5cdd2018-03-16 21:18:1350}
51
52######## END mainDexClasses.rules ########