Skip to content

Commit

Permalink
Fix desktop proguard
Browse files Browse the repository at this point in the history
  • Loading branch information
DRSchlaubi committed Nov 29, 2023
1 parent 1290f95 commit 7351704
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 8 deletions.
12 changes: 11 additions & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 22 additions & 5 deletions app/desktop/rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,28 @@
-keepclassmembers class io.ktor.** { volatile <fields>; }
-keep class io.ktor.client.engine.okhttp.OkHttpEngineContainer
-keep class io.ktor.serialization.kotlinx.json.KotlinxSerializationJsonExtensionProvider
-keep class kotlinx.coroutines.** { *; }
# even though we don't use log4j, proguard fails preverification if this class gets optimized
-keep class io.netty.util.internal.logging.Log4J2LoggerFactory { *; }
-keepattributes Signature,InnerClasses

# ServiceLoader support
-keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {}
-keepnames class kotlinx.coroutines.CoroutineExceptionHandler {}

# Most of volatile fields are updated with AFU and should not be mangled
-keepclassmembers class kotlinx.coroutines.** {
volatile <fields>;
}
-keepclasseswithmembers class io.netty.** {
*;
}
-keepnames class io.netty.** {
*;
}
# Same story for the standard library's SafeContinuation that also uses AtomicReferenceFieldUpdater
-keepclassmembers class kotlin.coroutines.SafeContinuation {
volatile <fields>;
}

-dontwarn kotlinx.atomicfu.**
-dontwarn io.netty.**
-dontwarn com.typesafe.**
Expand All @@ -35,9 +47,6 @@

# serialization
# For some reason if we don't do this, we get a VerifyError at runtime
-keep class kotlinx.serialization.* { *; }
-keep class dev.schlaubi.tonbrett.common.** { *; }

# Serializer for classes with named companion objects are retrieved using `getDeclaredClasses`.
# If you have any, replace classes with those containing named companion objects.
-keepattributes InnerClasses # Needed for `getDeclaredClasses`.
Expand All @@ -56,6 +65,14 @@
<1>.<2>$Companion Companion;
}


-keep class dev.schlaubi.tonbrett.common.** {*;}
-keep class dev.schlaubi.tonbrett.app.desktop.** {*;}
-keep class kotlinx.serialization.* { *; }

# compose
-keep class androidx.compose.ui.text.platform.Platform { *; }
-keep class androidx.compose.runtime.** { *; }

# https://github.com/Guardsquare/proguard/issues/349
-optimizations !class/unboxing/enum
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {

allprojects {
group = "dev.schlaubi.tonbrett"
version = "1.17.9"
version = "1.17.10"

repositories {
mavenCentral()
Expand Down
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ ktor-server-websockets = { group = "io.ktor", name = "ktor-server-websockets", v
ktor-server-auth = { group = "io.ktor", name = "ktor-server-auth", version.ref = "ktor" }
ktor-server-netty = { group = "io.ktor", name = "ktor-server-netty", version.ref = "ktor" }
ktor-server-cors = { group = "io.ktor", name = "ktor-server-cors", version.ref = "ktor" }
ktor-server-status-pages = { group = "io.ktor", name = "ktor-server-status-pages", version.ref = "ktor" }
ktor-server-auth-jwt = { group = "io.ktor", name = "ktor-server-auth-jwt", version.ref = "ktor" }
ktor-client-core = { group = "io.ktor", name = "ktor-client-core", version.ref = "ktor" }
ktor-client-js = { group = "io.ktor", name = "ktor-client-js", version.ref = "ktor" }
Expand Down

0 comments on commit 7351704

Please sign in to comment.