2013-05-30 19:45:46 +02:00
|
|
|
# Some classes in the libraries extend package private classes to chare common functionality
|
|
|
|
# that isn't explicitly part of the API
|
|
|
|
-dontskipnonpubliclibraryclasses -dontskipnonpubliclibraryclassmembers
|
|
|
|
|
2022-07-26 01:49:39 +02:00
|
|
|
# Annotations are implemented as attributes, so we have to explicitly keep them.
|
|
|
|
# Keep all runtime-visible annotations like RuntimeVisibleParameterAnnotations
|
|
|
|
# and RuntimeVisibleTypeAnnotations, as well as associated defaults.
|
|
|
|
-keepattributes RuntimeVisible*Annotation*,AnnotationDefault
|
|
|
|
|
2013-05-17 19:02:00 +02:00
|
|
|
# For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
|
|
|
|
-keepclassmembers enum * {
|
|
|
|
public static **[] values();
|
|
|
|
public static ** valueOf(java.lang.String);
|
|
|
|
}
|
|
|
|
|
|
|
|
# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
|
2022-02-07 19:29:28 +01:00
|
|
|
-keepclasseswithmembernames,includedescriptorclasses class * {
|
2013-05-17 19:02:00 +02:00
|
|
|
native <methods>;
|
|
|
|
}
|
|
|
|
|
|
|
|
# class$ methods are inserted by some compilers to implement .class construct,
|
|
|
|
# see http://proguard.sourceforge.net/manual/examples.html#library
|
|
|
|
-keepclassmembernames class * {
|
|
|
|
java.lang.Class class$(java.lang.String);
|
|
|
|
java.lang.Class class$(java.lang.String, boolean);
|
|
|
|
}
|
|
|
|
|
|
|
|
# Keep serializable classes and necessary members for serializable classes
|
|
|
|
# Copied from the ProGuard manual at http://proguard.sourceforge.net.
|
|
|
|
-keepnames class * implements java.io.Serializable
|
|
|
|
-keepclassmembers class * implements java.io.Serializable {
|
|
|
|
static final long serialVersionUID;
|
|
|
|
private static final java.io.ObjectStreamField[] serialPersistentFields;
|
|
|
|
!static !transient <fields>;
|
|
|
|
private void writeObject(java.io.ObjectOutputStream);
|
|
|
|
private void readObject(java.io.ObjectInputStream);
|
|
|
|
java.lang.Object writeReplace();
|
|
|
|
java.lang.Object readResolve();
|
|
|
|
}
|
|
|
|
|
2015-05-11 23:56:20 +02:00
|
|
|
# Keep Throwable's constructor that takes a String argument.
|
|
|
|
-keepclassmembers class * extends java.lang.Throwable {
|
|
|
|
<init>(java.lang.String);
|
|
|
|
}
|
|
|
|
|
2013-05-17 19:02:00 +02:00
|
|
|
# Please specify classes to be kept explicitly in your package's configuration.
|
|
|
|
# -keep class * extends android.app.Activity
|
|
|
|
# -keep class * extends android.view.View
|
|
|
|
# -keep class * extends android.app.Service
|
|
|
|
# -keep class * extends android.content.BroadcastReceiver
|
|
|
|
# -keep class * extends android.content.ContentProvider
|
|
|
|
# -keep class * extends android.preference.Preference
|
|
|
|
# -keep class * extends android.app.BackupAgent
|
|
|
|
|
2014-04-07 20:25:47 +02:00
|
|
|
# Parcelable CREATORs must be kept for Parcelable functionality
|
2022-09-20 01:23:16 +02:00
|
|
|
-keepclassmembers class * implements android.os.Parcelable {
|
2014-04-07 20:25:47 +02:00
|
|
|
public static final ** CREATOR;
|
|
|
|
}
|
2013-05-17 19:02:00 +02:00
|
|
|
|
|
|
|
# The support library contains references to newer platform versions.
|
|
|
|
# Don't warn about those in case this app is linking against an older
|
|
|
|
# platform version. We know about them, and they are safe.
|
|
|
|
# See proguard-android.txt in the SDK package.
|
2015-05-05 04:21:48 +02:00
|
|
|
#
|
|
|
|
# DO NOT USE THIS: We figured it's dangerous to blindly ignore all support library warnings.
|
|
|
|
# ProGuard may strip members of subclass of unknown super classes, in case an app is linking against
|
|
|
|
# LOCAL_SDK_VERSION lower than the support library's LOCAL_SDK_VERSION.
|
|
|
|
# See bug/20658265.
|
|
|
|
# -dontwarn android.support.**
|
2014-06-17 20:53:31 +02:00
|
|
|
|
2019-04-11 23:09:37 +02:00
|
|
|
# From https://github.com/google/guava/wiki/UsingProGuardWithGuava
|
|
|
|
# Striped64, LittleEndianByteArray, UnsignedBytes, AbstractFuture
|
|
|
|
-dontwarn sun.misc.Unsafe
|
|
|
|
# Futures.getChecked (which often won't work with Proguard anyway) uses this. It
|
|
|
|
# has a fallback, but again, don't use Futures.getChecked on Android regardless.
|
|
|
|
-dontwarn java.lang.ClassValue
|
|
|
|
|
2022-08-11 00:14:06 +02:00
|
|
|
# Ignore missing annotation references for various support libraries.
|
|
|
|
# While this is not ideal, it should be relatively safe given that
|
|
|
|
# 1) runtime-visible annotations will still be kept, and 2) compile-time
|
|
|
|
# annotations are stripped by R8 anyway.
|
|
|
|
# Note: The ** prefix is used to accommodate jarjar repackaging.
|
|
|
|
# TODO(b/242088131): Remove these exemptions after resolving transitive libs
|
|
|
|
# dependencies that are provided to R8.
|
|
|
|
-dontwarn **android**.annotation*.**
|
|
|
|
-dontwarn **com.google.errorprone.annotations.**
|
|
|
|
-dontwarn javax.annotation.**
|
|
|
|
-dontwarn org.checkerframework.**
|
|
|
|
-dontwarn org.jetbrains.annotations.**
|
|
|
|
|
2014-06-17 20:53:31 +02:00
|
|
|
# Less spammy.
|
|
|
|
-dontnote
|
2019-08-26 23:22:02 +02:00
|
|
|
|
|
|
|
# The lite proto runtime uses reflection to access fields based on the names in
|
2022-07-12 23:20:03 +02:00
|
|
|
# the schema, keep all the fields. Wildcard is used to apply the rule to classes
|
|
|
|
# that have been renamed with jarjar.
|
|
|
|
-keepclassmembers class * extends **.protobuf.MessageLite { <fields>; }
|