2018-08-15 20:46:37 +02:00
|
|
|
# GENERAL OPTIONS
|
|
|
|
|
|
|
|
-allowaccessmodification
|
|
|
|
|
2024-02-29 15:29:05 +01:00
|
|
|
# Preserve some attributes that may be required for reflection.
|
|
|
|
-keepattributes RuntimeVisible*Annotations, AnnotationDefault
|
2018-08-15 20:46:37 +02:00
|
|
|
|
|
|
|
# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
|
|
|
|
-keepclasseswithmembernames class * {
|
|
|
|
native <methods>;
|
|
|
|
}
|
2024-02-29 15:29:05 +01:00
|
|
|
|
2018-08-15 20:46:37 +02:00
|
|
|
-keepclassmembers class * implements android.os.Parcelable {
|
2020-06-04 20:17:07 +02:00
|
|
|
public static final ** CREATOR;
|
2018-08-15 20:46:37 +02:00
|
|
|
}
|
|
|
|
|
2024-02-29 15:29:05 +01:00
|
|
|
# Preserve annotated Javascript interface methods.
|
|
|
|
-keepclassmembers class * {
|
|
|
|
@android.webkit.JavascriptInterface <methods>;
|
2022-01-20 21:10:32 +01:00
|
|
|
}
|
|
|
|
|
2024-02-29 15:29:05 +01:00
|
|
|
# The support libraries 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.
|
|
|
|
-dontnote androidx.**
|
|
|
|
-dontwarn androidx.**
|
|
|
|
|
|
|
|
# This class is deprecated, but remains for backward compatibility.
|
|
|
|
-dontwarn android.util.FloatMath
|
|
|
|
|
|
|
|
# These classes are duplicated between android.jar and core-lambda-stubs.jar.
|
|
|
|
-dontnote java.lang.invoke.**
|
|
|
|
|
2018-08-15 20:46:37 +02:00
|
|
|
# TUSKY SPECIFIC OPTIONS
|
2017-04-08 00:08:51 +02:00
|
|
|
|
2020-06-04 20:17:07 +02:00
|
|
|
# keep members of our model classes, they are used in json de/serialization
|
|
|
|
-keepclassmembers class com.keylesspalace.tusky.entity.* { *; }
|
2017-04-08 00:08:51 +02:00
|
|
|
|
|
|
|
-keep public enum com.keylesspalace.tusky.entity.*$** {
|
|
|
|
**[] $VALUES;
|
|
|
|
public *;
|
|
|
|
}
|
|
|
|
|
2022-02-14 19:20:15 +01:00
|
|
|
-keepclassmembers class com.keylesspalace.tusky.components.conversation.ConversationAccountEntity { *; }
|
|
|
|
-keepclassmembers class com.keylesspalace.tusky.db.DraftAttachment { *; }
|
|
|
|
|
2021-01-25 16:23:43 +01:00
|
|
|
-keep enum com.keylesspalace.tusky.db.DraftAttachment$Type {
|
|
|
|
public *;
|
|
|
|
}
|
|
|
|
|
2022-01-20 21:10:32 +01:00
|
|
|
# https://github.com/google/gson/blob/master/examples/android-proguard-example/proguard.cfg
|
2022-01-21 18:26:57 +01:00
|
|
|
|
|
|
|
# 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 * implements com.google.gson.TypeAdapterFactory
|
|
|
|
-keep class * implements com.google.gson.JsonSerializer
|
|
|
|
-keep class * implements com.google.gson.JsonDeserializer
|
|
|
|
|
2022-01-20 21:10:32 +01:00
|
|
|
# Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher.
|
|
|
|
-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
|
|
|
|
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken
|
|
|
|
|
|
|
|
# Retain generic signatures of classes used in MastodonApi so Retrofit works
|
|
|
|
-keep,allowobfuscation,allowshrinking class retrofit2.Response
|
|
|
|
-keep,allowobfuscation,allowshrinking class kotlin.collections.List
|
|
|
|
-keep,allowobfuscation,allowshrinking class kotlin.collections.Map
|
|
|
|
-keep,allowobfuscation,allowshrinking class retrofit2.Call
|
|
|
|
|
2024-02-29 15:29:05 +01:00
|
|
|
# https://github.com/square/retrofit/pull/3563
|
|
|
|
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation
|
2022-02-09 20:46:13 +01:00
|
|
|
|
2017-04-08 00:08:51 +02:00
|
|
|
# preserve line numbers for crash reporting
|
|
|
|
-keepattributes SourceFile,LineNumberTable
|
2018-08-15 20:46:37 +02:00
|
|
|
-renamesourcefileattribute SourceFile
|
2017-04-08 00:08:51 +02:00
|
|
|
|
2022-05-19 07:19:16 +02:00
|
|
|
# Bouncy Castle -- Keep EC
|
|
|
|
-keep class org.bouncycastle.jcajce.provider.asymmetric.EC$* { *; }
|
|
|
|
-keep class org.bouncycastle.jcajce.provider.asymmetric.ec.KeyPairGeneratorSpi$EC
|
|
|
|
|
2017-04-08 00:08:51 +02:00
|
|
|
# remove all logging from production apk
|
2017-08-11 19:19:35 +02:00
|
|
|
-assumenosideeffects class android.util.Log {
|
|
|
|
public static *** getStackTraceString(...);
|
|
|
|
public static *** d(...);
|
|
|
|
public static *** w(...);
|
|
|
|
public static *** v(...);
|
|
|
|
public static *** i(...);
|
|
|
|
}
|
2020-09-02 12:27:51 +02:00
|
|
|
-assumenosideeffects class java.lang.String {
|
|
|
|
public static java.lang.String format(...);
|
|
|
|
}
|
2018-03-01 19:01:44 +01:00
|
|
|
|
|
|
|
# remove some kotlin overhead
|
|
|
|
-assumenosideeffects class kotlin.jvm.internal.Intrinsics {
|
2021-06-11 20:50:42 +02:00
|
|
|
static void checkNotNull(java.lang.Object);
|
|
|
|
static void checkNotNull(java.lang.Object, java.lang.String);
|
2018-03-01 19:01:44 +01:00
|
|
|
static void checkParameterIsNotNull(java.lang.Object, java.lang.String);
|
2021-06-11 20:50:42 +02:00
|
|
|
static void checkParameterIsNotNull(java.lang.Object, java.lang.String);
|
|
|
|
static void checkNotNullParameter(java.lang.Object, java.lang.String);
|
2018-12-17 23:15:31 +01:00
|
|
|
static void checkExpressionValueIsNotNull(java.lang.Object, java.lang.String);
|
2021-06-11 20:50:42 +02:00
|
|
|
static void checkNotNullExpressionValue(java.lang.Object, java.lang.String);
|
|
|
|
static void checkReturnedValueIsNotNull(java.lang.Object, java.lang.String);
|
|
|
|
static void checkReturnedValueIsNotNull(java.lang.Object, java.lang.String, java.lang.String);
|
2018-12-17 23:15:31 +01:00
|
|
|
static void throwUninitializedPropertyAccessException(java.lang.String);
|
2018-03-01 19:01:44 +01:00
|
|
|
}
|
2023-01-13 19:51:42 +01:00
|
|
|
|
|
|
|
# Preference fragments can be referenced by name, ensure they remain
|
|
|
|
# https://github.com/tuskyapp/Tusky/issues/3161
|
|
|
|
-keep class * extends androidx.preference.PreferenceFragmentCompat
|