# ─────────── General ─────────── -keepattributes *Annotation* -keepattributes Signature -keepattributes InnerClasses -keepattributes EnclosingMethod -keepattributes Exceptions # ─────────── DTOs (Gson serialization) ─────────── -keep class com.tiangong.aiagent.data.remote.dto.** { *; } -keepclassmembers class com.tiangong.aiagent.data.remote.dto.** { *; } # ─────────── Gson ─────────── -keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations -keep class com.google.gson.** { *; } -keepclassmembers,allowobfuscation class * { @com.google.gson.annotations.SerializedName ; } -keep class com.google.gson.stream.** { *; } -dontwarn com.google.gson.** # ─────────── Retrofit ─────────── -keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations -keep class retrofit2.** { *; } -keepclassmembers,allowobfuscation class * { @retrofit2.http.* ; } -dontwarn retrofit2.** -dontwarn javax.annotation.** -dontwarn kotlin.Unit -dontwarn retrofit2.KotlinExtensions -dontwarn retrofit2.KotlinExtensions$* # ─────────── OkHttp ─────────── -keep class okhttp3.** { *; } -keep class okio.** { *; } -dontwarn okhttp3.** -dontwarn okio.** # ─────────── Room ─────────── -keep class * extends androidx.room.RoomDatabase { *; } -keepclassmembers class * extends androidx.room.RoomDatabase { abstract ; } -keep @androidx.room.Entity class * { *; } -keep @androidx.room.Dao class * { *; } -keepclassmembers @androidx.room.Entity class * { @androidx.room.PrimaryKey ; } -keep class * extends androidx.room.migration.Migration { *; } -keep class androidx.room.** { *; } -dontwarn androidx.room.** # ─────────── Hilt / Dagger ─────────── -keep class dagger.** { *; } -keep class javax.inject.** { *; } -keep class * extends dagger.hilt.android.internal.managers.ViewComponentManager$FragmentContextWrapper { *; } -keep class dagger.hilt.** { *; } -keep class * extends dagger.hilt.android.lifecycle.HiltViewModel { *; } -keepclassmembers class * { @javax.inject.Inject (...); } -keepclassmembers class * { @dagger.internal.InjectedFieldSignature ; } -dontwarn dagger.** -dontwarn javax.inject.** -dontwarn dagger.hilt.** # ─────────── Compose ─────────── -keep class androidx.compose.** { *; } -keepclassmembers class * { @androidx.compose.runtime.Composable ; } -dontwarn androidx.compose.** # ─────────── Firebase FCM ─────────── -keep class com.google.firebase.** { *; } -keep class com.google.android.gms.** { *; } -dontwarn com.google.firebase.** -dontwarn com.google.android.gms.** # ─────────── Coil ─────────── -keep class coil.** { *; } -dontwarn coil.** # ─────────── DataStore ─────────── -keep class androidx.datastore.** { *; } -keepclassmembers class * extends androidx.datastore.preferences.protobuf.GeneratedMessageLite { ; } -dontwarn androidx.datastore.** # ─────────── Security Crypto ─────────── -keep class androidx.security.crypto.** { *; } -dontwarn androidx.security.crypto.** # ─────────── ExoPlayer / Media3 ─────────── -keep class androidx.media3.** { *; } -dontwarn androidx.media3.** # ─────────── Markwon ─────────── -keep class io.noties.markwon.** { *; } -dontwarn io.noties.markwon.** # ─────────── Splash Screen ─────────── -keep class androidx.core.splashscreen.** { *; } # ─────────── Bugly (Tencent crash reporting) ─────────── -dontwarn com.tencent.bugly.** -keep public class com.tencent.bugly.** { *; } # ─────────── Kotlin Coroutines ─────────── -keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {} -keepnames class kotlinx.coroutines.CoroutineExceptionHandler {} -keepclassmembers class kotlinx.coroutines.** { volatile ; } -dontwarn kotlinx.coroutines.** # ─────────── Kotlin ─────────── -keep class kotlin.** { *; } -keep class kotlin.Metadata { *; } -dontwarn kotlin.** # ─────────── BuildConfig ─────────── -keep class com.tiangong.aiagent.BuildConfig { *; } # ─────────── Application / Activities ─────────── -keep class com.tiangong.aiagent.AgentApplication { *; } -keep class com.tiangong.aiagent.MainActivity { *; } # ─────────── ViewModels (Hilt-injected) ─────────── -keep class * extends androidx.lifecycle.ViewModel { *; } -keepclassmembers class * extends androidx.lifecycle.ViewModel { (...); } # ─────────── Keep Compose previews in debug ─────────── -keep class androidx.compose.ui.tooling.** { *; }