main_dex_classes.flags 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. # Proguard flags for what should be kept in the main dex. Only used
  5. # during main dex list determination, not during actual proguarding.
  6. -keep @org.chromium.base.annotations.MainDex class * {
  7. *;
  8. }
  9. -keepclasseswithmembers class * {
  10. @org.chromium.base.annotations.MainDex <methods>;
  11. }
  12. # Assume all IDL-generated classes should be kept. They can't reference other
  13. # non-framework classes, so fairly low-risk.
  14. -keepclasseswithmembers class * {
  15. public static ** asInterface(android.os.IBinder);
  16. }
  17. # Required when code coverage is enabled.
  18. -keep class com.vladium.** {
  19. *;
  20. }
  21. # Renderers / GPU process don't load secondary dex.
  22. -keep public class * extends org.chromium.base.process_launcher.ChildProcessService {
  23. *;
  24. }
  25. # The following are based on $SDK_BUILD_TOOLS/mainDexClasses.rules
  26. # Ours differ in that:
  27. # 1. It omits -keeps for application / instrumentation / backupagents (these are
  28. # redundant since they are added by aapt's main dex list rules output).
  29. # 2. Omits keep for Application.attachBaseContext(), which is overly broad.
  30. # 3. Omits keep for all annotations, which is also overly broad (and pulls in
  31. # any class that has an @IntDef).
  32. ######## START mainDexClasses.rules ########
  33. # Keep old fashion tests in the main dex or they'll be silently ignored by InstrumentationTestRunner
  34. -keep public class * extends android.test.InstrumentationTestCase {
  35. <init>();
  36. }
  37. ######## END mainDexClasses.rules ########