Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix release build variant errors #244

Merged
merged 2 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
/.kotlin

keystore.properties
keystore.jks
40 changes: 14 additions & 26 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,18 @@
# Protobuf
-keep class * extends com.google.protobuf.GeneratedMessageLite { *; }

# KotlinX Serialization
# 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;
# Prevents issues like ths one: https://github.com/Kotlin/kotlinx.serialization/issues/2385
# Custom rule that keeps a class that meets the following criteria:
# - Is annotated by the @Serialization annotation
# - Lives inside a package or subpackages of com.paulrybitskyi.gamedge.feature
# - Has a name that ends with the "Route" word
-keep @kotlinx.serialization.Serializable class com.paulrybitskyi.gamedge.feature.**.*Route

# Prevents issues like ths one: https://github.com/square/retrofit/issues/3774
-keep,allowobfuscation,allowshrinking class com.github.michaelbull.result.Result

# Prevents issues where the @Apicalypse annotation is not being kept by ProGuard
# and, as a result, the API queries are genereted incorrectly
-keepclassmembers,allowobfuscation,allowshrinking class ** {
@com.paulrybitskyi.gamedge.igdb.apicalypse.**.Apicalypse <fields>;
}

# 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