1
0
mirror of https://gitlab.shinice.net/pixeldroid/PixelDroid synced 2024-12-19 11:43:36 +01:00
PixelDroid-App-Android/app/proguard-rules.pro

89 lines
3.2 KiB
Prolog

# proguard file largely copied from Tusky's
# GENERAL OPTIONS (inspired from AOSP's proguard-android-optimize.txt)
# turn on all optimizations except those that are known to cause problems on Android
-optimizations !code/simplification/cast,!field/*,!class/merging/*
-optimizationpasses 6
-allowaccessmodification
# Don't obfuscate because it makes traces useless
-dontobfuscate
-dontusemixedcaseclassnames
-keepattributes *Annotation*
# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
-keepclasseswithmembernames class * {
native <methods>;
}
# keep ViewModel constructors to make ViewModelFactories work
-keepclassmembers public class * extends androidx.lifecycle.ViewModel {
public <init>(...);
}
# 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);
}
# 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 ** CREATOR;
}
# APP SPECIFIC OPTIONS
# keep members of our model classes, they are used in json de/serialization
-keepclassmembers class org.pixeldroid.app.utils.api.objects.* { *; }
-keep public enum org.pixeldroid.app.utils.api.objects.*$** {
**[] $VALUES;
public *;
}
-keepclassmembers class org.pixeldroid.app.settings.licenseObjects.* { *; }
-keep public enum org.pixeldroid.app.settings.licenseObjects.*$** {
**[] $VALUES;
public *;
}
# preserve line numbers for crash reporting
-keepattributes SourceFile,LineNumberTable
-renamesourcefileattribute SourceFile
# remove all logging from production apk
-assumenosideeffects class android.util.Log {
public static *** getStackTraceString(...);
public static *** d(...);
public static *** w(...);
public static *** v(...);
public static *** i(...);
}
-assumenosideeffects class java.lang.String {
public static java.lang.String format(...);
}
# remove some kotlin overhead
-assumenosideeffects class kotlin.jvm.internal.Intrinsics {
static void checkNotNull(java.lang.Object);
static void checkNotNull(java.lang.Object, java.lang.String);
static void checkParameterIsNotNull(java.lang.Object, java.lang.String);
static void checkParameterIsNotNull(java.lang.Object, java.lang.String);
static void checkNotNullParameter(java.lang.Object, java.lang.String);
static void checkExpressionValueIsNotNull(java.lang.Object, java.lang.String);
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);
static void throwUninitializedPropertyAccessException(java.lang.String);
}