Proguard fixes

This commit is contained in:
Jobobby04 2021-05-22 16:07:06 -04:00
parent 63139a5c08
commit 7e612e63b4
3 changed files with 50 additions and 49 deletions

View File

@ -62,14 +62,12 @@ android {
applicationIdSuffix = ".rt" applicationIdSuffix = ".rt"
//isMinifyEnabled = true //isMinifyEnabled = true
//isShrinkResources = true //isShrinkResources = true
isZipAlignEnabled = true setProguardFiles(listOf(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"))
setProguardFiles(listOf(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"))
} }
named("release") { named("release") {
isMinifyEnabled = true isMinifyEnabled = true
isShrinkResources = true isShrinkResources = true
isZipAlignEnabled = true setProguardFiles(listOf(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"))
setProguardFiles(listOf(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"))
} }
} }

View File

@ -0,0 +1,34 @@
-allowaccessmodification
-dontusemixedcaseclassnames
-verbose
-keepattributes *Annotation*
-keepclasseswithmembernames,includedescriptorclasses class * {
native <methods>;
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keepclassmembers class * implements android.os.Parcelable {
public static final ** CREATOR;
}
-keep class androidx.annotation.Keep
-keep @androidx.annotation.Keep class * {*;}
-keepclasseswithmembers class * {
@androidx.annotation.Keep <methods>;
}
-keepclasseswithmembers class * {
@androidx.annotation.Keep <fields>;
}
-keepclasseswithmembers class * {
@androidx.annotation.Keep <init>(...);
}

View File

@ -67,54 +67,22 @@
kotlinx.serialization.KSerializer serializer(...); kotlinx.serialization.KSerializer serializer(...);
} }
# Madokami extension username and password crash fix # Keep extension's common dependencies
-keepclassmembers class androidx.preference.EditTextPreference { -keep,allowoptimization class eu.kanade.tachiyomi.** { public protected *; }
*** mOnBindEditTextListener; -keep,allowoptimization class kotlin.** { public protected *; }
*** mText; -keep,allowoptimization class okhttp3.** { public protected *; }
public *; -keep,allowoptimization class rx.** { public protected *; }
} -keep,allowoptimization class org.jsoup.** { public protected *; }
-keep,allowoptimization class com.google.gson.** { public protected *; }
# Hitomi extension crash fix -keep,allowoptimization class com.github.salomonbrys.kotson.** { public protected *; }
-keepclassmembers class rx.Single { -keep,allowoptimization class com.squareup.duktape.** { public protected *; }
*** onSubscribe; -keep,allowoptimization class androidx.preference.** { *; }
final *; -keep,allowoptimization class okio.** { *; }
protected *; -keep,allowoptimization class kotlinx.serialization.** { *; }
public *;
}
# Manga Plus fixes
-keep class kotlinx.serialization.**
-keepclassmembers class kotlinx.serialization.** {
<methods>;
}
# Genkan.io crash fix
-keepclassmembers class rx.Observable {
rx.Observable concatWith(rx.Observable);
}
# Guya
-keepclassmembers class rx.observables.BlockingObservable {
*** subscribe(rx.functions.Action1);
}
# RxJava 1.1.0 # RxJava 1.1.0
-dontwarn sun.misc.** -dontwarn sun.misc.**
-keepclassmembers class rx.internal.util.unsafe.*ArrayQueue*Field* {
long producerIndex;
long consumerIndex;
}
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef {
rx.internal.util.atomic.LinkedQueueNode producerNode;
}
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef {
rx.internal.util.atomic.LinkedQueueNode consumerNode;
}
-dontnote rx.internal.util.PlatformDependent -dontnote rx.internal.util.PlatformDependent
# === Reactive network: https://github.com/pwittchen/ReactiveNetwork/tree/v0.12.4#proguard-configuration # === Reactive network: https://github.com/pwittchen/ReactiveNetwork/tree/v0.12.4#proguard-configuration
@ -151,8 +119,9 @@
# Application classes that will be serialized/deserialized over Gson # Application classes that will be serialized/deserialized over Gson
-keep class com.google.gson.examples.android.model.** { <fields>; } -keep class com.google.gson.examples.android.model.** { <fields>; }
# Prevent proguard from stripping interface information from TypeAdapterFactory, # Prevent proguard from stripping interface information from TypeAdapterFactory, TypeAdapter,
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter) # 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.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer -keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer -keep class * implements com.google.gson.JsonDeserializer