# ── Flutter 核心 ──────────────────────────────────────────
-keep class io.flutter.app.** { *; }
-keep class io.flutter.plugin.** { *; }
-keep class io.flutter.util.** { *; }
-keep class io.flutter.view.** { *; }
-keep class io.flutter.** { *; }
-keep class io.flutter.plugins.** { *; }
-keep class io.flutter.embedding.** { *; }

# ── Firebase / Crashlytics ────────────────────────────────
-keep class com.google.firebase.** { *; }
-keep class com.google.android.gms.** { *; }
-dontwarn com.google.firebase.**
-dontwarn com.google.android.gms.**

# ── OkHttp / 网络 ─────────────────────────────────────────
-dontwarn okhttp3.**
-dontwarn okio.**
-keep class okhttp3.** { *; }
-keep interface okhttp3.** { *; }

# ── 本地认证 (local_auth) ─────────────────────────────────
-keep class androidx.biometric.** { *; }

# ── 安全存储 (flutter_secure_storage) ────────────────────
-keep class com.it_nomads.fluttersecurestorage.** { *; }

# ── 图片缓存 (cached_network_image / Glide) ───────────────
-keep class com.bumptech.glide.** { *; }
-dontwarn com.bumptech.glide.**

# ── 扫码 (mobile_scanner / ML Kit) ───────────────────────
-keep class com.google.mlkit.** { *; }
-dontwarn com.google.mlkit.**
-keep class com.google.android.gms.vision.** { *; }
-keep class dev.steenbakker.mobile_scanner.** { *; }
-dontwarn dev.steenbakker.mobile_scanner.**

# ── WebView (webview_flutter) ─────────────────────────────
-keep class io.flutter.plugins.webviewflutter.** { *; }
-dontwarn io.flutter.plugins.webviewflutter.**

# ── 图片选择 (image_picker) ───────────────────────────────
-keep class io.flutter.plugins.imagepicker.** { *; }

# ── 分享 (share_plus) ────────────────────────────────────
-keep class dev.fluttercommunity.plus.share.** { *; }

# ── URL 启动 (url_launcher) ───────────────────────────────
-keep class io.flutter.plugins.urllauncher.** { *; }

# ── 本地存储 (hive_flutter) ───────────────────────────────
-keep class io.hivedb.** { *; }
-dontwarn io.hivedb.**

# ── Kotlin Coroutines ─────────────────────────────────────
-keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {}
-keepnames class kotlinx.coroutines.CoroutineExceptionHandler {}
-keepclassmembernames class kotlinx.** {
    volatile <fields>;
}
-dontwarn kotlinx.coroutines.**

# ── Kotlin 反射 ───────────────────────────────────────────
-dontwarn kotlin.reflect.jvm.internal.**
-keep class kotlin.Metadata { *; }

# ── 防止 Kotlin 序列化相关类被裁剪 ───────────────────────
-keepattributes *Annotation*
-keepattributes Signature
-keepattributes InnerClasses
-keepattributes EnclosingMethod

# ── 防止枚举被裁剪 ────────────────────────────────────────
-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}

# ── Native 方法 ───────────────────────────────────────────
-keepclasseswithmembernames class * {
    native <methods>;
}

# ── Parcelable（Android 序列化）──────────────────────────
-keepclassmembers class * implements android.os.Parcelable {
    public static final android.os.Parcelable$Creator CREATOR;
}

# ── Serializable ─────────────────────────────────────────
-keepclassmembers class * implements java.io.Serializable {
    static final long serialVersionUID;
    private static final java.io.ObjectStreamField[] serialPersistentFields;
    private void writeObject(java.io.ObjectOutputStream);
    private void readObject(java.io.ObjectInputStream);
    java.lang.Object writeReplace();
    java.lang.Object readResolve();
}

# ── 七陌客服 SDK ──────────────────────────────────────────
-dontwarn javax.persistence.**
-dontwarn org.slf4j.**
-dontwarn com.j256.ormlite.**

# ── Flutter deferred components ───────────────────────────
-dontwarn com.google.android.play.core.**
