1
0
mirror of https://github.com/tuskyapp/Tusky synced 2024-12-22 23:08:04 +01:00
Tusky-App-Android/app/proguard-rules.pro

79 lines
2.9 KiB
Prolog
Raw Normal View History

# GENERAL OPTIONS
-allowaccessmodification
# Preserve some attributes that may be required for reflection.
-keepattributes RuntimeVisible*Annotations, AnnotationDefault
# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
-keepclasseswithmembernames class * {
native <methods>;
}
put r8 rules for enums back in to fix crash in AccountListActivity (#4299) Regression from #4291 // cc @cbeyls <details> <summary>Stacktrace</summary> ``` Process: com.keylesspalace.tusky, PID: 31230 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.keylesspalace.tusky/com.keylesspalace.tusky.components.accountlist.AccountListActivity}: java.lang.RuntimeException: java.lang.NoSuchMethodException: h4.a.values [] at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3635) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3792) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2210) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7839) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003) Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodException: h4.a.values [] at java.lang.Enum.enumValues(Enum.java:270) at java.lang.Enum.access$000(Enum.java:61) at java.lang.Enum$1.create(Enum.java:277) at java.lang.Enum$1.create(Enum.java:275) at libcore.util.BasicLruCache.get(BasicLruCache.java:63) at java.lang.Enum.getSharedConstants(Enum.java:289) at java.lang.Enum.valueOf(Enum.java:243) at java.io.ObjectInputStream.readEnum(ObjectInputStream.java:1841) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1409) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:427) at android.os.Parcel.readSerializable(Parcel.java:3507) at android.os.Parcel.readValue(Parcel.java:3277) at android.os.Parcel.readArrayMapInternal(Parcel.java:3623) at android.os.BaseBundle.initializeFromParcelLocked(BaseBundle.java:292) at android.os.BaseBundle.unparcel(BaseBundle.java:236) at android.os.BaseBundle.getSerializable(BaseBundle.java:1268) at android.os.Bundle.getSerializable(Bundle.java:1104) at android.content.Intent.getSerializableExtra(Intent.java:8575) at com.keylesspalace.tusky.components.accountlist.AccountListActivity.onCreate(SourceFile:23) at android.app.Activity.performCreate(Activity.java:8051) at android.app.Activity.performCreate(Activity.java:8031) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1329) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3608) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3792)  at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)  at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2210)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loopOnce(Looper.java:201)  at android.os.Looper.loop(Looper.java:288)  at android.app.ActivityThread.main(ActivityThread.java:7839)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)  Caused by: java.lang.NoSuchMethodException: h4.a.values [] at java.lang.Class.getMethod(Class.java:2103) at java.lang.Class.getDeclaredMethod(Class.java:2081) at java.lang.Enum.enumValues(Enum.java:267) at java.lang.Enum.access$000(Enum.java:61)  at java.lang.Enum$1.create(Enum.java:277)  at java.lang.Enum$1.create(Enum.java:275)  at libcore.util.BasicLruCache.get(BasicLruCache.java:63)  at java.lang.Enum.getSharedConstants(Enum.java:289)  at java.lang.Enum.valueOf(Enum.java:243)  at java.io.ObjectInputStream.readEnum(ObjectInputStream.java:1841)  at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1409)  at java.io.ObjectInputStream.readObject(ObjectInputStream.java:427)  at android.os.Parcel.readSerializable(Parcel.java:3507)  at android.os.Parcel.readValue(Parcel.java:3277)  at android.os.Parcel.readArrayMapInternal(Parcel.java:3623)  at android.os.BaseBundle.initializeFromParcelLocked(BaseBundle.java:292)  at android.os.BaseBundle.unparcel(BaseBundle.java:236)  at android.os.BaseBundle.getSerializable(BaseBundle.java:1268)  at android.os.Bundle.getSerializable(Bundle.java:1104)  at android.content.Intent.getSerializableExtra(Intent.java:8575)  at com.keylesspalace.tusky.components.accountlist.AccountListActivity.onCreate(SourceFile:23)  at android.app.Activity.performCreate(Activity.java:8051)  at android.app.Activity.performCreate(Activity.java:8031)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1329)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3608)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3792)  at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)  at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2210)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loopOnce(Looper.java:201)  at android.os.Looper.loop(Looper.java:288)  at android.app.ActivityThread.main(ActivityThread.java:7839)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)  ``` </details> closes #4297
2024-03-04 06:54:09 +01:00
# For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
-keepclassmembers,allowoptimization enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keepclassmembers class * implements android.os.Parcelable {
2020-06-04 20:17:07 +02:00
public static final ** CREATOR;
}
# Preserve annotated Javascript interface methods.
-keepclassmembers class * {
@android.webkit.JavascriptInterface <methods>;
}
# 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.**
# TUSKY SPECIFIC OPTIONS
2017-04-08 00:08:51 +02:00
# preserve line numbers for crash reporting
-keepattributes SourceFile,LineNumberTable
-renamesourcefileattribute SourceFile
2017-04-08 00:08:51 +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(...);
}
-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 {
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);
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);
2018-03-01 19:01:44 +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