mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 15:17:05 +05:30
android: turn on R8
This commit is contained in:
parent
1d02f56025
commit
c1c3c3cdc9
5 changed files with 74 additions and 3 deletions
36
android/proguard-android-optimize.pro
Normal file
36
android/proguard-android-optimize.pro
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
-allowaccessmodification
|
||||||
|
-dontpreverify
|
||||||
|
-dontusemixedcaseclassnames
|
||||||
|
-dontskipnonpubliclibraryclasses
|
||||||
|
-verbose
|
||||||
|
|
||||||
|
-keepattributes *Annotation*
|
||||||
|
|
||||||
|
-keepclasseswithmembernames 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>(...);
|
||||||
|
}
|
9
android/proguard-rules-missing-classes.pro
Normal file
9
android/proguard-rules-missing-classes.pro
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
-dontwarn org.bouncycastle.jsse.BCSSLParameters
|
||||||
|
-dontwarn org.bouncycastle.jsse.BCSSLSocket
|
||||||
|
-dontwarn org.bouncycastle.jsse.provider.BouncyCastleJsseProvider
|
||||||
|
-dontwarn org.conscrypt.Conscrypt$Version
|
||||||
|
-dontwarn org.conscrypt.Conscrypt
|
||||||
|
-dontwarn org.conscrypt.ConscryptHostnameVerifier
|
||||||
|
-dontwarn org.openjsse.javax.net.ssl.SSLParameters
|
||||||
|
-dontwarn org.openjsse.javax.net.ssl.SSLSocket
|
||||||
|
-dontwarn org.openjsse.net.ssl.OpenJSSE
|
26
android/proguard-rules.pro
vendored
Normal file
26
android/proguard-rules.pro
vendored
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
# Keep `Companion` object fields of serializable classes.
|
||||||
|
# This avoids serializer lookup through `getDeclaredClasses` as done for named companion objects.
|
||||||
|
-if @kotlinx.serialization.Serializable class **
|
||||||
|
-keepclassmembers class <1> {
|
||||||
|
static <1>$Companion Companion;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Keep `serializer()` on companion objects (both default and named) of serializable classes.
|
||||||
|
-if @kotlinx.serialization.Serializable class ** {
|
||||||
|
static **$* *;
|
||||||
|
}
|
||||||
|
-keepclassmembers class <2>$<3> {
|
||||||
|
kotlinx.serialization.KSerializer serializer(...);
|
||||||
|
}
|
||||||
|
|
||||||
|
# Keep `INSTANCE.serializer()` of serializable objects.
|
||||||
|
-if @kotlinx.serialization.Serializable class ** {
|
||||||
|
public static ** INSTANCE;
|
||||||
|
}
|
||||||
|
-keepclassmembers class <1> {
|
||||||
|
public static <1> INSTANCE;
|
||||||
|
kotlinx.serialization.KSerializer serializer(...);
|
||||||
|
}
|
||||||
|
|
||||||
|
# @Serializable and @Polymorphic are used at runtime for polymorphic serialization.
|
||||||
|
-keepattributes RuntimeVisibleAnnotations,AnnotationDefault
|
|
@ -31,10 +31,10 @@ class ApplicationPlugin : Plugin<Project> {
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
named("release") {
|
named("release") {
|
||||||
isMinifyEnabled = false
|
isMinifyEnabled = true
|
||||||
setProguardFiles(
|
setProguardFiles(
|
||||||
listOf(
|
listOf(
|
||||||
"proguard-android-optimize.txt",
|
"proguard-android-optimize.pro",
|
||||||
"proguard-rules.pro",
|
"proguard-rules.pro",
|
||||||
"proguard-rules-missing-classes.pro",
|
"proguard-rules-missing-classes.pro",
|
||||||
)
|
)
|
||||||
|
|
|
@ -24,7 +24,7 @@ kapt.include.compile.classpath=false
|
||||||
android.injected.testOnly=false
|
android.injected.testOnly=false
|
||||||
|
|
||||||
# Use R8 instead of ProGuard for code shrinking.
|
# Use R8 instead of ProGuard for code shrinking.
|
||||||
android.enableR8.fullMode=true
|
android.enableR8.fullMode=false
|
||||||
|
|
||||||
# Enable AndroidX
|
# Enable AndroidX
|
||||||
android.useAndroidX=true
|
android.useAndroidX=true
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue