|
1 | | -# Add project specific ProGuard rules here. |
2 | | -# You can control the set of applied configuration files using the |
3 | | -# proguardFiles setting in build.gradle. |
4 | | -# |
5 | | -# For more details, see |
6 | | -# http://developer.android.com/guide/developing/tools/proguard.html |
7 | | - |
8 | | -# If your project uses WebView with JS, uncomment the following |
9 | | -# and specify the fully qualified class name to the JavaScript interface |
10 | | -# class: |
11 | | -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { |
12 | | -# public *; |
13 | | -#} |
14 | | - |
15 | | -# Uncomment this to preserve the line number information for |
16 | | -# debugging stack traces. |
17 | | -#-keepattributes SourceFile,LineNumberTable |
18 | | - |
19 | | -# If you keep the line number information, uncomment this to |
20 | | -# hide the original source file name. |
21 | | -#-renamesourcefileattribute SourceFile |
| 1 | +##---------------Begin: Attribouter-specific configuration -------- |
| 2 | + |
| 3 | +# For xml-specified drawable resources |
| 4 | +-keep class me.jfenn.attribouter.R$* |
| 5 | +-keepclassmembers class me.jfenn.attribouter.R$* { |
| 6 | + public static <fields>; |
| 7 | +} |
| 8 | + |
| 9 | +# For wedge construction (from xml parser) |
| 10 | +-keep class * extends me.jfenn.attribouter.wedges.Wedge |
| 11 | + |
| 12 | +# For data/gson classes |
| 13 | +-keepclassmembers class me.jfenn.attribouter.provider.net.*.data.** { |
| 14 | + !transient <fields>; |
| 15 | +} |
| 16 | + |
| 17 | +##---------------End: Attribouter-specific configuration ---------- |
| 18 | + |
| 19 | +##---------------Begin: proguard configuration for Retrofit ------- |
| 20 | + |
| 21 | +# Retrofit does reflection on generic parameters. InnerClasses is required to use Signature and |
| 22 | +# EnclosingMethod is required to use InnerClasses. |
| 23 | +-keepattributes Signature, InnerClasses, EnclosingMethod |
| 24 | + |
| 25 | +# Retrofit does reflection on method and parameter annotations. |
| 26 | +-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations |
| 27 | + |
| 28 | +# Retain service method parameters when optimizing. |
| 29 | +-keepclassmembers,allowshrinking,allowobfuscation interface * { |
| 30 | + @retrofit2.http.* <methods>; |
| 31 | +} |
| 32 | + |
| 33 | +# Ignore annotation used for build tooling. |
| 34 | +-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement |
| 35 | + |
| 36 | +# Ignore JSR 305 annotations for embedding nullability information. |
| 37 | +-dontwarn javax.annotation.** |
| 38 | + |
| 39 | +# Guarded by a NoClassDefFoundError try/catch and only used when on the classpath. |
| 40 | +-dontwarn kotlin.Unit |
| 41 | + |
| 42 | +# Top-level functions that can only be used by Kotlin. |
| 43 | +-dontwarn retrofit2.KotlinExtensions |
| 44 | +-dontwarn retrofit2.KotlinExtensions$* |
| 45 | + |
| 46 | +# With R8 full mode, it sees no subtypes of Retrofit interfaces since they are created with a Proxy |
| 47 | +# and replaces all potential values with null. Explicitly keeping the interfaces prevents this. |
| 48 | +-if interface * { @retrofit2.http.* <methods>; } |
| 49 | +-keep,allowobfuscation interface <1> |
| 50 | + |
| 51 | +##---------------End: proguard configuration for Retrofit --------- |
| 52 | + |
| 53 | +##---------------Begin: proguard configuration for OkHttp --------- |
| 54 | + |
| 55 | +# JSR 305 annotations are for embedding nullability information. |
| 56 | +-dontwarn javax.annotation.** |
| 57 | + |
| 58 | +# A resource is loaded with a relative path so the package of this class must be preserved. |
| 59 | +-keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase |
| 60 | + |
| 61 | +# Animal Sniffer compileOnly dependency to ensure APIs are compatible with older versions of Java. |
| 62 | +-dontwarn org.codehaus.mojo.animal_sniffer.* |
| 63 | + |
| 64 | +# OkHttp platform used only on JVM and when Conscrypt dependency is available. |
| 65 | +-dontwarn okhttp3.internal.platform.ConscryptPlatform |
| 66 | + |
| 67 | +##---------------End: proguard configuration for OkHttp ----------- |
| 68 | + |
| 69 | +##---------------Begin: proguard configuration for Gson ---------- |
| 70 | + |
| 71 | +# Gson uses generic type information stored in a class file when working with fields. Proguard |
| 72 | +# removes such information by default, so configure it to keep all of it. |
| 73 | +-keepattributes Signature |
| 74 | + |
| 75 | +# For using GSON @Expose annotation |
| 76 | +-keepattributes *Annotation* |
| 77 | + |
| 78 | +# Gson specific classes |
| 79 | +-dontwarn sun.misc.** |
| 80 | +#-keep class com.google.gson.stream.** { *; } |
| 81 | + |
| 82 | +# Application classes that will be serialized/deserialized over Gson |
| 83 | +-keep class com.google.gson.examples.android.model.** { <fields>; } |
| 84 | + |
| 85 | +# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory, |
| 86 | +# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter) |
| 87 | +-keep class * implements com.google.gson.TypeAdapter |
| 88 | +-keep class * implements com.google.gson.TypeAdapterFactory |
| 89 | +-keep class * implements com.google.gson.JsonSerializer |
| 90 | +-keep class * implements com.google.gson.JsonDeserializer |
| 91 | + |
| 92 | +# Prevent R8 from leaving Data object members always null |
| 93 | +-keepclassmembers,allowobfuscation class * { |
| 94 | + @com.google.gson.annotations.SerializedName <fields>; |
| 95 | +} |
| 96 | + |
| 97 | +##---------------End: proguard configuration for Gson ---------- |
0 commit comments