proguard-rules.pro 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. # ── Flutter 核心 ──────────────────────────────────────────
  2. -keep class io.flutter.app.** { *; }
  3. -keep class io.flutter.plugin.** { *; }
  4. -keep class io.flutter.util.** { *; }
  5. -keep class io.flutter.view.** { *; }
  6. -keep class io.flutter.** { *; }
  7. -keep class io.flutter.plugins.** { *; }
  8. -keep class io.flutter.embedding.** { *; }
  9. # ── Firebase / Crashlytics ────────────────────────────────
  10. -keep class com.google.firebase.** { *; }
  11. -keep class com.google.android.gms.** { *; }
  12. -dontwarn com.google.firebase.**
  13. -dontwarn com.google.android.gms.**
  14. # ── OkHttp / 网络 ─────────────────────────────────────────
  15. -dontwarn okhttp3.**
  16. -dontwarn okio.**
  17. -keep class okhttp3.** { *; }
  18. -keep interface okhttp3.** { *; }
  19. # ── 本地认证 (local_auth) ─────────────────────────────────
  20. -keep class androidx.biometric.** { *; }
  21. # ── 安全存储 (flutter_secure_storage) ────────────────────
  22. -keep class com.it_nomads.fluttersecurestorage.** { *; }
  23. # ── 图片缓存 (cached_network_image / Glide) ───────────────
  24. -keep class com.bumptech.glide.** { *; }
  25. -dontwarn com.bumptech.glide.**
  26. # ── 扫码 (mobile_scanner / ML Kit) ───────────────────────
  27. -keep class com.google.mlkit.** { *; }
  28. -dontwarn com.google.mlkit.**
  29. -keep class com.google.android.gms.vision.** { *; }
  30. -keep class dev.steenbakker.mobile_scanner.** { *; }
  31. -dontwarn dev.steenbakker.mobile_scanner.**
  32. # ── WebView (webview_flutter) ─────────────────────────────
  33. -keep class io.flutter.plugins.webviewflutter.** { *; }
  34. -dontwarn io.flutter.plugins.webviewflutter.**
  35. # ── 图片选择 (image_picker) ───────────────────────────────
  36. -keep class io.flutter.plugins.imagepicker.** { *; }
  37. # ── 分享 (share_plus) ────────────────────────────────────
  38. -keep class dev.fluttercommunity.plus.share.** { *; }
  39. # ── URL 启动 (url_launcher) ───────────────────────────────
  40. -keep class io.flutter.plugins.urllauncher.** { *; }
  41. # ── 本地存储 (hive_flutter) ───────────────────────────────
  42. -keep class io.hivedb.** { *; }
  43. -dontwarn io.hivedb.**
  44. # ── Kotlin Coroutines ─────────────────────────────────────
  45. -keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {}
  46. -keepnames class kotlinx.coroutines.CoroutineExceptionHandler {}
  47. -keepclassmembernames class kotlinx.** {
  48. volatile <fields>;
  49. }
  50. -dontwarn kotlinx.coroutines.**
  51. # ── Kotlin 反射 ───────────────────────────────────────────
  52. -dontwarn kotlin.reflect.jvm.internal.**
  53. -keep class kotlin.Metadata { *; }
  54. # ── 防止 Kotlin 序列化相关类被裁剪 ───────────────────────
  55. -keepattributes *Annotation*
  56. -keepattributes Signature
  57. -keepattributes InnerClasses
  58. -keepattributes EnclosingMethod
  59. # ── 防止枚举被裁剪 ────────────────────────────────────────
  60. -keepclassmembers enum * {
  61. public static **[] values();
  62. public static ** valueOf(java.lang.String);
  63. }
  64. # ── Native 方法 ───────────────────────────────────────────
  65. -keepclasseswithmembernames class * {
  66. native <methods>;
  67. }
  68. # ── Parcelable(Android 序列化)──────────────────────────
  69. -keepclassmembers class * implements android.os.Parcelable {
  70. public static final android.os.Parcelable$Creator CREATOR;
  71. }
  72. # ── Serializable ─────────────────────────────────────────
  73. -keepclassmembers class * implements java.io.Serializable {
  74. static final long serialVersionUID;
  75. private static final java.io.ObjectStreamField[] serialPersistentFields;
  76. private void writeObject(java.io.ObjectOutputStream);
  77. private void readObject(java.io.ObjectInputStream);
  78. java.lang.Object writeReplace();
  79. java.lang.Object readResolve();
  80. }
  81. # ── 七陌客服 SDK ──────────────────────────────────────────
  82. -dontwarn javax.persistence.**
  83. -dontwarn org.slf4j.**
  84. -dontwarn com.j256.ormlite.**
  85. # ── Flutter deferred components ───────────────────────────
  86. -dontwarn com.google.android.play.core.**