Files
aiagent/android/app/proguard-rules.pro
renjianbo 21a06e8664 feat: complete P0-2 Token Refresh, P0-4 Android ProGuard, P0-5 App Update
- P0-2: Refresh token with Redis storage (UUID tokens, 30-day TTL, rotation on refresh)
- P0-2: Backend POST /auth/refresh and /auth/revoke endpoints
- P0-2: Android AuthInterceptor refresh-before-re-login flow
- P0-2: AuthRepository saves refresh_token on login, revokes on logout
- P0-4: Enable R8 minification (isMinifyEnabled=true) with comprehensive keep rules
- P0-5: Backend GET /api/v1/app/check-update with force_update support
- P0-5: Android AppUpdateManager with force/optional update dialogs on startup

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-01 22:20:47 +08:00

140 lines
5.3 KiB
Prolog

# ─────────── 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 <fields>;
}
-keep class com.google.gson.stream.** { *; }
-dontwarn com.google.gson.**
# ─────────── Retrofit ───────────
-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations
-keep class retrofit2.** { *; }
-keepclassmembers,allowobfuscation class * {
@retrofit2.http.* <methods>;
}
-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 <methods>;
}
-keep @androidx.room.Entity class * { *; }
-keep @androidx.room.Dao class * { *; }
-keepclassmembers @androidx.room.Entity class * {
@androidx.room.PrimaryKey <fields>;
}
-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 <init>(...);
}
-keepclassmembers class * {
@dagger.internal.InjectedFieldSignature <fields>;
}
-dontwarn dagger.**
-dontwarn javax.inject.**
-dontwarn dagger.hilt.**
# ─────────── Compose ───────────
-keep class androidx.compose.** { *; }
-keepclassmembers class * {
@androidx.compose.runtime.Composable <methods>;
}
-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 {
<fields>;
}
-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 <fields>;
}
-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 {
<init>(...);
}
# ─────────── Keep Compose previews in debug ───────────
-keep class androidx.compose.ui.tooling.** { *; }