• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Some classes in the libraries extend package private classes to chare common functionality
2# that isn't explicitly part of the API
3-dontskipnonpubliclibraryclasses -dontskipnonpubliclibraryclassmembers
4
5# For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
6-keepclassmembers enum * {
7    public static **[] values();
8    public static ** valueOf(java.lang.String);
9}
10
11# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
12-keepclasseswithmembernames class * {
13    native <methods>;
14}
15
16# class$ methods are inserted by some compilers to implement .class construct,
17# see http://proguard.sourceforge.net/manual/examples.html#library
18-keepclassmembernames class * {
19    java.lang.Class class$(java.lang.String);
20    java.lang.Class class$(java.lang.String, boolean);
21}
22
23# Keep serializable classes and necessary members for serializable classes
24# Copied from the ProGuard manual at http://proguard.sourceforge.net.
25-keepnames class * implements java.io.Serializable
26-keepclassmembers class * implements java.io.Serializable {
27    static final long serialVersionUID;
28    private static final java.io.ObjectStreamField[] serialPersistentFields;
29    !static !transient <fields>;
30    private void writeObject(java.io.ObjectOutputStream);
31    private void readObject(java.io.ObjectInputStream);
32    java.lang.Object writeReplace();
33    java.lang.Object readResolve();
34}
35
36# Keep Throwable's constructor that takes a String argument.
37-keepclassmembers class * extends java.lang.Throwable {
38  <init>(java.lang.String);
39}
40
41# Please specify classes to be kept explicitly in your package's configuration.
42# -keep class * extends android.app.Activity
43# -keep class * extends android.view.View
44# -keep class * extends android.app.Service
45# -keep class * extends android.content.BroadcastReceiver
46# -keep class * extends android.content.ContentProvider
47# -keep class * extends android.preference.Preference
48# -keep class * extends android.app.BackupAgent
49
50# Parcelable CREATORs must be kept for Parcelable functionality
51-keep class * implements android.os.Parcelable {
52  public static final ** CREATOR;
53}
54
55# The support library contains references to newer platform versions.
56# Don't warn about those in case this app is linking against an older
57# platform version.  We know about them, and they are safe.
58# See proguard-android.txt in the SDK package.
59#
60# DO NOT USE THIS: We figured it's dangerous to blindly ignore all support library warnings.
61# ProGuard may strip members of subclass of unknown super classes, in case an app is linking against
62# LOCAL_SDK_VERSION lower than the support library's LOCAL_SDK_VERSION.
63# See bug/20658265.
64# -dontwarn android.support.**
65
66# From https://github.com/google/guava/wiki/UsingProGuardWithGuava
67# Striped64, LittleEndianByteArray, UnsignedBytes, AbstractFuture
68-dontwarn sun.misc.Unsafe
69# Futures.getChecked (which often won't work with Proguard anyway) uses this. It
70# has a fallback, but again, don't use Futures.getChecked on Android regardless.
71-dontwarn java.lang.ClassValue
72
73# Less spammy.
74-dontnote
75
76# The lite proto runtime uses reflection to access fields based on the names in
77# the schema, keep all the fields.
78-keepclassmembers class * extends com.google.protobuf.MessageLite { <fields>; }
79