Android O MR1 SDK.
[android_tools.git] / sdk / tools / proguard / proguard-android-optimize.txt
blob756a209c9ed86eefc43fbcccfe46160be50d66f3
1 # This is a configuration file for ProGuard.
2 # http://proguard.sourceforge.net/index.html#manual/usage.html
4 # This file is no longer maintained and is not used by new (2.2+) versions of the
5 # Android plugin for Gradle. Instead, the Android plugin for Gradle generates the
6 # default rules at build time and stores them in the build directory.
8 # Optimizations: If you don't want to optimize, use the
9 # proguard-android.txt configuration file instead of this one, which
10 # turns off the optimization flags.  Adding optimization introduces
11 # certain risks, since for example not all optimizations performed by
12 # ProGuard works on all versions of Dalvik.  The following flags turn
13 # off various optimizations known to have issues, but the list may not
14 # be complete or up to date. (The "arithmetic" optimization can be
15 # used if you are only targeting Android 2.0 or later.)  Make sure you
16 # test thoroughly if you go this route.
17 -optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*
18 -optimizationpasses 5
19 -allowaccessmodification
20 -dontpreverify
22 # The remainder of this file is identical to the non-optimized version
23 # of the Proguard configuration file (except that the other file has
24 # flags to turn off optimization).
26 -dontusemixedcaseclassnames
27 -dontskipnonpubliclibraryclasses
28 -verbose
30 -keepattributes *Annotation*
31 -keep public class com.google.vending.licensing.ILicensingService
32 -keep public class com.android.vending.licensing.ILicensingService
34 # For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
35 -keepclasseswithmembernames class * {
36     native <methods>;
39 # keep setters in Views so that animations can still work.
40 # see http://proguard.sourceforge.net/manual/examples.html#beans
41 -keepclassmembers public class * extends android.view.View {
42    void set*(***);
43    *** get*();
46 # We want to keep methods in Activity that could be used in the XML attribute onClick
47 -keepclassmembers class * extends android.app.Activity {
48    public void *(android.view.View);
51 # For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
52 -keepclassmembers enum * {
53     public static **[] values();
54     public static ** valueOf(java.lang.String);
57 -keepclassmembers class * implements android.os.Parcelable {
58   public static final android.os.Parcelable$Creator CREATOR;
61 -keepclassmembers class **.R$* {
62     public static <fields>;
65 # The support library contains references to newer platform versions.
66 # Don't warn about those in case this app is linking against an older
67 # platform version.  We know about them, and they are safe.
68 -dontwarn android.support.**
70 # Understand the @Keep support annotation.
71 -keep class android.support.annotation.Keep
73 -keep @android.support.annotation.Keep class * {*;}
75 -keepclasseswithmembers class * {
76     @android.support.annotation.Keep <methods>;
79 -keepclasseswithmembers class * {
80     @android.support.annotation.Keep <fields>;
83 -keepclasseswithmembers class * {
84     @android.support.annotation.Keep <init>(...);