146 lines
4.7 KiB
INI
146 lines
4.7 KiB
INI
# This is a configuration file for ProGuard.
|
|
# http://proguard.sourceforge.net/index.html#manual/usage.html
|
|
|
|
|
|
# The remainder of this file is identical to the non-optimized version
|
|
# of the Proguard configuration file (except that the other file has
|
|
# flags to turn off optimization).
|
|
|
|
-dontusemixedcaseclassnames
|
|
-verbose
|
|
-dontobfuscate
|
|
-keepattributes *Annotation*
|
|
|
|
# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
|
|
-keepclasseswithmembernames class * {
|
|
native <methods>;
|
|
}
|
|
|
|
# keep setters in Views so that animations can still work.
|
|
# see http://proguard.sourceforge.net/manual/examples.html#beans
|
|
-keepclassmembers public class * extends android.view.View {
|
|
void set*(***);
|
|
*** get*();
|
|
}
|
|
|
|
# We want to keep methods in Activity that could be used in the XML attribute onClick
|
|
-keepclassmembers class * extends android.app.Activity {
|
|
public void *(android.view.View);
|
|
}
|
|
|
|
# Keep everything related to mpv
|
|
-keep class com.github.k1rakishou.chan.core.mpv.** { *; }
|
|
|
|
# For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
|
|
-keepclassmembers enum * {
|
|
public static **[] values();
|
|
public static ** valueOf(java.lang.String);
|
|
}
|
|
|
|
-keepclassmembers class * implements android.os.Parcelable {
|
|
public static final android.os.Parcelable$Creator CREATOR;
|
|
}
|
|
|
|
-keepclassmembers class **.R$* {
|
|
public static <fields>;
|
|
}
|
|
|
|
# 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.
|
|
-dontwarn android.support.**
|
|
|
|
# Required for the gif library
|
|
-keep public class pl.droidsonroids.gif.GifIOException{<init>(int);}
|
|
-keep class pl.droidsonroids.gif.GifInfoHandle{<init>(long,int,int,int);}
|
|
|
|
# OkHttp and LeakCanary
|
|
-dontwarn java.nio.**
|
|
-dontwarn javax.annotation.**
|
|
-dontwarn org.codehaus.mojo.**
|
|
# LeakCanary uses removed method (checks the API level)
|
|
-dontwarn com.squareup.leakcanary.DisplayLeakService
|
|
-dontwarn org.conscrypt.**
|
|
|
|
# Jsoup
|
|
-keeppackagenames org.jsoup.nodes
|
|
|
|
# JS interfaces
|
|
-keepclassmembers class * {
|
|
@android.webkit.JavascriptInterface <methods>;
|
|
}
|
|
|
|
-keep @org.greenrobot.eventbus.Subscribe class *
|
|
|
|
#-keep public class * extends android.support.design.**
|
|
|
|
# Keep Feather inject working.
|
|
-keepclassmembers,allowobfuscation class * {
|
|
@javax.inject.* *;
|
|
<init>();
|
|
}
|
|
|
|
-keepclassmembers class * {
|
|
@org.greenrobot.eventbus.Subscribe <methods>;
|
|
}
|
|
-keep enum org.greenrobot.eventbus.ThreadMode { *; }
|
|
|
|
-keep,allowobfuscation @interface com.github.k1rakishou.common.DoNotStrip
|
|
|
|
# Do not strip any method/class that is annotated with @DoNotStrip
|
|
-keep @com.github.k1rakishou.common.DoNotStrip class *
|
|
-keepclassmembers class * {
|
|
@com.github.k1rakishou.common.DoNotStrip *;
|
|
}
|
|
|
|
# Gson specific classes
|
|
-dontwarn sun.misc.**
|
|
#-keep class com.google.gson.stream.** { *; }
|
|
|
|
# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
|
|
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
|
|
-keep class * extends com.google.gson.TypeAdapter
|
|
-keep class * extends com.google.gson.internal.bind.TypeAdapters
|
|
-keep class * implements com.google.gson.TypeAdapterFactory
|
|
-keep class * implements com.google.gson.JsonSerializer
|
|
-keep class * implements com.google.gson.JsonDeserializer
|
|
|
|
# Prevent R8 from leaving Data object members always null
|
|
-keepclassmembers,allowobfuscation class * {
|
|
@com.google.gson.annotations.SerializedName <fields>;
|
|
}
|
|
|
|
-keepclassmembers enum * { *; }
|
|
-keep class * extends androidx.room.RoomDatabase
|
|
|
|
# For F-Droid reproducible builds
|
|
-keep class kotlinx.coroutines.CoroutineExceptionHandler
|
|
-keep class kotlinx.coroutines.internal.MainDispatcherFactory
|
|
|
|
# Proguard keeps removing files that are used by the native library so it causes crashes.
|
|
# This seems to fix the issue.
|
|
-keep class com.github.k1rakishou.chan.core.lib.** { *; }
|
|
-dontwarn java.lang.invoke.**
|
|
-dontwarn org.joda.convert.**
|
|
|
|
-keepattributes Signature
|
|
-keepattributes *Annotation*
|
|
|
|
-dontwarn sun.misc.**
|
|
-keep class com.google.gson.examples.android.model.** { <fields>; }
|
|
|
|
-keep class * extends com.google.gson.TypeAdapter
|
|
-keep class * implements com.google.gson.TypeAdapterFactory
|
|
-keep class * implements com.google.gson.JsonSerializer
|
|
-keep class * implements com.google.gson.JsonDeserializer
|
|
|
|
-keepclassmembers,allowobfuscation class * {
|
|
@com.google.gson.annotations.SerializedName <fields>;
|
|
}
|
|
|
|
-keep class com.google.gson.reflect.TypeToken
|
|
-keep class * extends com.google.gson.reflect.TypeToken
|
|
-keep public class * implements java.lang.reflect.Type
|
|
|
|
-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
|
|
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken |