blob: a0f577d8ba3bbe508254e1b34da34da91d630f8f [file] [log] [blame]
Ying Wang38cdd442013-05-30 10:45:46 -07001# 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
Ying Wang57453512013-05-17 10:02:00 -07005# 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
Ying Wang57453512013-05-17 10:02:00 -070023# 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
Ying Wang480a9bb2015-05-11 14:56:20 -070036# Keep Throwable's constructor that takes a String argument.
37-keepclassmembers class * extends java.lang.Throwable {
38 <init>(java.lang.String);
39}
40
Ying Wang57453512013-05-17 10:02:00 -070041# 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
Scott Kennedy62eb51a2014-04-07 11:25:47 -070050# Parcelable CREATORs must be kept for Parcelable functionality
51-keep class * implements android.os.Parcelable {
52 public static final ** CREATOR;
53}
Ying Wang57453512013-05-17 10:02:00 -070054
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.
Ying Wang4f5d0e62015-05-04 19:21:48 -070059#
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.**
Ying Wangf864d502014-06-17 11:53:31 -070065
Colin Crosse75840f2019-04-11 14:09:37 -070066# 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
Ying Wangf864d502014-06-17 11:53:31 -070073# Less spammy.
74-dontnote