fix: add missing ProGuard rules to prevent release build crash
R8 minification was stripping/renaming classes needed at runtime: private @Serializable ImageEntry, enum valueOf() names, Ktor internals, and ViewModel constructors. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
dda0dd9d5f
commit
cc383eb668
1 changed files with 44 additions and 0 deletions
44
android/app/proguard-rules.pro
vendored
44
android/app/proguard-rules.pro
vendored
|
|
@ -1,6 +1,50 @@
|
|||
# ========================
|
||||
# kotlinx.serialization
|
||||
# ========================
|
||||
-keepattributes *Annotation*, InnerClasses
|
||||
-dontnote kotlinx.serialization.AnnotationsKt
|
||||
|
||||
-keepclassmembers class kotlinx.serialization.json.** { *** Companion; }
|
||||
|
||||
# Keep @Serializable classes and their generated serializers
|
||||
-keepclassmembers @kotlinx.serialization.Serializable class ** {
|
||||
*** Companion;
|
||||
*** INSTANCE;
|
||||
kotlinx.serialization.KSerializer serializer(...);
|
||||
}
|
||||
-keepclasseswithmembers class io.picoclaw.android.** {
|
||||
kotlinx.serialization.KSerializer serializer(...);
|
||||
}
|
||||
|
||||
# Keep generated $$serializer classes
|
||||
-keepclassmembers class io.picoclaw.android.**$$serializer {
|
||||
*** INSTANCE;
|
||||
*;
|
||||
}
|
||||
|
||||
# Keep private ImageEntry used via Json.decodeFromString in MessageMapper
|
||||
-keep class io.picoclaw.android.core.data.mapper.ImageEntry { *; }
|
||||
|
||||
# ========================
|
||||
# Enums stored as strings in Room DB
|
||||
# ========================
|
||||
-keepclassmembers enum io.picoclaw.android.core.domain.model.MessageSender { *; }
|
||||
-keepclassmembers enum io.picoclaw.android.core.domain.model.MessageStatus { *; }
|
||||
|
||||
# ========================
|
||||
# Ktor
|
||||
# ========================
|
||||
-keep class io.ktor.** { *; }
|
||||
-keepclassmembers class io.ktor.** { volatile <fields>; }
|
||||
-dontwarn io.ktor.**
|
||||
|
||||
# ========================
|
||||
# OkHttp / Okio
|
||||
# ========================
|
||||
-dontwarn okhttp3.**
|
||||
-dontwarn okio.**
|
||||
|
||||
# ========================
|
||||
# Koin / ViewModels
|
||||
# ========================
|
||||
-keep class * extends androidx.lifecycle.ViewModel { <init>(...); }
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue