Skip to content

Commit

Permalink
fix proguard issues with serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
avan1235 committed Nov 6, 2023
1 parent f83885f commit 1c2f2e3
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 1 deletion.
6 changes: 5 additions & 1 deletion androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import java.lang.System.getenv

plugins {
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.android.application)
alias(libs.plugins.compose.multiplatform)
}
Expand Down Expand Up @@ -41,7 +42,10 @@ android {
release {
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"))
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro",
)
}
}
packaging {
Expand Down
1 change: 1 addition & 0 deletions androidApp/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-dontwarn org.slf4j.impl.StaticLoggerBinder
1 change: 1 addition & 0 deletions desktopApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import java.lang.System.getenv

plugins {
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.compose.multiplatform)
}

Expand Down
36 changes: 36 additions & 0 deletions desktopApp/compose-desktop.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
-keep class com.arkivanov.decompose.extensions.compose.jetbrains.mainthread.SwingMainThreadChecker
-keep class kotlinx.coroutines.swing.SwingDispatcherFactory
-keep class org.bridj.** { *; }
-keep class io.ktor.serialization.kotlinx.json.KotlinxSerializationJsonExtensionProvider { *; }
-keep class kotlinx.serialization.SerialFormat { *; }
-keepattributes Annotation, InnerClasses
-dontnote kotlinx.serialization.AnnotationsKt
-dontnote kotlinx.serialization.SerializationKt
-keep,includedescriptorclasses class ml.dev.kotlin.openotp.**$$serializer { *; }
-keepclassmembers class ml.dev.kotlin.openotp.** {
*** Companion;
}
-keepclasseswithmembers class ml.dev.kotlin.openotp.** {
kotlinx.serialization.KSerializer serializer(...);
}
-keepclassmembers class kotlinx.serialization.json.** {
*** Companion;
}
-keepclasseswithmembers class kotlinx.serialization.json.** {
kotlinx.serialization.KSerializer serializer(...);
}
-keepclassmembers class kotlinx.serialization.cbor.** {
*** Companion;
}
-keepclasseswithmembers class kotlinx.serialization.cbor.** {
kotlinx.serialization.KSerializer serializer(...);
}

-dontwarn com.arkivanov.decompose.extensions.compose.jetbrains.pages.**
-dontwarn org.xml.sax.**
Expand All @@ -17,3 +41,15 @@
-dontwarn ch.qos.logback.classic.**
-dontwarn javafx.**
-dontwarn com.github.eduramiba.webcamcapture.**
-dontwarn android.security.**
-dontwarn android.net.http.**
-dontwarn android.net.ssl.**
-dontwarn android.util.**
-dontwarn android.os.**
-dontwarn org.bouncycastle.jsse.**
-dontwarn org.openjsse.javax.net.ssl.**
-dontwarn org.openjsse.net.ssl.**
-dontwarn org.conscrypt.**
-dontwarn java.lang.Thread$Builder$OfPlatform
-dontwarn java.lang.Thread$Builder$OfVirtual
-dontwarn java.lang.Thread$Builder

0 comments on commit 1c2f2e3

Please sign in to comment.