blob: 3c25e895fa8c1c2de913a1634ef229de8e461f64 [file] [log] [blame]
Ying Wang38cdd442013-05-30 10:45:46 -07001# To prevent name conflict in incremental obfuscation.
2-useuniqueclassmembernames
3
4# Some classes in the libraries extend package private classes to chare common functionality
5# that isn't explicitly part of the API
6-dontskipnonpubliclibraryclasses -dontskipnonpubliclibraryclassmembers
7
Ying Wang57453512013-05-17 10:02:00 -07008# For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
9-keepclassmembers enum * {
10 public static **[] values();
11 public static ** valueOf(java.lang.String);
12}
13
14# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
15-keepclasseswithmembernames class * {
16 native <methods>;
17}
18
19# class$ methods are inserted by some compilers to implement .class construct,
20# see http://proguard.sourceforge.net/manual/examples.html#library
21-keepclassmembernames class * {
22 java.lang.Class class$(java.lang.String);
23 java.lang.Class class$(java.lang.String, boolean);
24}
25
Ying Wang57453512013-05-17 10:02:00 -070026# Keep serializable classes and necessary members for serializable classes
27# Copied from the ProGuard manual at http://proguard.sourceforge.net.
28-keepnames class * implements java.io.Serializable
29-keepclassmembers class * implements java.io.Serializable {
30 static final long serialVersionUID;
31 private static final java.io.ObjectStreamField[] serialPersistentFields;
32 !static !transient <fields>;
33 private void writeObject(java.io.ObjectOutputStream);
34 private void readObject(java.io.ObjectInputStream);
35 java.lang.Object writeReplace();
36 java.lang.Object readResolve();
37}
38
Ying Wang480a9bb2015-05-11 14:56:20 -070039# Keep Throwable's constructor that takes a String argument.
40-keepclassmembers class * extends java.lang.Throwable {
41 <init>(java.lang.String);
42}
43
Ying Wang57453512013-05-17 10:02:00 -070044# Please specify classes to be kept explicitly in your package's configuration.
45# -keep class * extends android.app.Activity
46# -keep class * extends android.view.View
47# -keep class * extends android.app.Service
48# -keep class * extends android.content.BroadcastReceiver
49# -keep class * extends android.content.ContentProvider
50# -keep class * extends android.preference.Preference
51# -keep class * extends android.app.BackupAgent
52
Scott Kennedy62eb51a2014-04-07 11:25:47 -070053# Parcelable CREATORs must be kept for Parcelable functionality
54-keep class * implements android.os.Parcelable {
55 public static final ** CREATOR;
56}
Ying Wang57453512013-05-17 10:02:00 -070057
58# The support library contains references to newer platform versions.
59# Don't warn about those in case this app is linking against an older
60# platform version. We know about them, and they are safe.
61# See proguard-android.txt in the SDK package.
Ying Wang4f5d0e62015-05-04 19:21:48 -070062#
63# DO NOT USE THIS: We figured it's dangerous to blindly ignore all support library warnings.
64# ProGuard may strip members of subclass of unknown super classes, in case an app is linking against
65# LOCAL_SDK_VERSION lower than the support library's LOCAL_SDK_VERSION.
66# See bug/20658265.
67# -dontwarn android.support.**
Ying Wangf864d502014-06-17 11:53:31 -070068
69# Less spammy.
70-dontnote