added proguard for code obfuscation in android
This commit is contained in:
@@ -53,13 +53,13 @@ android {
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
// TODO: Add your own signing config for the release build.
|
||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
signingConfig signingConfigs.debug
|
||||
minifyEnabled true
|
||||
shrinkResources true
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),
|
||||
'proguard-rules.pro'
|
||||
// TODO: Add your own signing config for the release build.
|
||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
92
android/app/proguard-rules.pro
vendored
92
android/app/proguard-rules.pro
vendored
@@ -1,77 +1,21 @@
|
||||
# Keep Flutter embedding and plugin registrant (important)
|
||||
-keep class io.flutter.embedding.** { *; }
|
||||
-keep class io.flutter.plugins.** { *; }
|
||||
-keep class io.flutter.plugin.** { *; }
|
||||
-keep class io.flutter.app.** { *; }
|
||||
|
||||
# Keep Application / Activity if you customized them (replace with your package name)
|
||||
# -keep class com.yourcompany.yourapp.MainActivity { *; }
|
||||
# -keep class com.yourcompany.yourapp.** { *; }
|
||||
|
||||
# Keep classes referenced from AndroidManifest via reflection or lifecycle
|
||||
-keepclassmembers class * {
|
||||
@android.webkit.JavascriptInterface <methods>;
|
||||
public <init>(android.content.Context, ...);
|
||||
}
|
||||
|
||||
# Keep native entry points (JNI) if any (example)
|
||||
-keepclasseswithmembernames class * {
|
||||
native <methods>;
|
||||
}
|
||||
|
||||
# Keep classes that use reflection heavily (OKHttp/Retrofit/Gson)
|
||||
# Retrofit/OkHttp
|
||||
-keep class okhttp3.** { *; }
|
||||
-keep interface okhttp3.** { *; }
|
||||
-keep class retrofit2.** { *; }
|
||||
-keep interface retrofit2.** { *; }
|
||||
|
||||
# Gson (models accessed by reflection)
|
||||
-keep class com.google.gson.** { *; }
|
||||
-keepattributes Signature
|
||||
-keepattributes *Annotation*
|
||||
|
||||
# Keep Firebase (if you use it)
|
||||
-keep class io.flutter.plugin.** { *; }
|
||||
-keep class io.flutter.util.** { *; }
|
||||
-keep class io.flutter.view.** { *; }
|
||||
-keep class io.flutter.embedding.** { *; }
|
||||
-keep class io.flutter.embedding.engine.plugins.** { *; }
|
||||
-keep class com.google.firebase.** { *; }
|
||||
-keep class com.google.android.gms.** { *; }
|
||||
|
||||
# WorkManager (if used)
|
||||
-keep class androidx.work.impl.background.systemjob.SystemJobService { *; }
|
||||
-keep class androidx.work.** { *; }
|
||||
|
||||
# Room/DB entities - if you use Room, keep annotations and entity classes
|
||||
-keepclassmembers class * {
|
||||
@androidx.room.* <fields>;
|
||||
}
|
||||
-keep class androidx.room.** { *; }
|
||||
|
||||
# Keep classes loaded by reflection (e.g. through Class.forName)
|
||||
-keepclassmembers,includedescriptorclasses class * {
|
||||
public static <fields>;
|
||||
public <init>(...);
|
||||
}
|
||||
|
||||
# Keep Kotlin metadata (for Kotlin reflection)
|
||||
-keep class kotlin.Metadata { *; }
|
||||
|
||||
# Keep names of classes annotated with @Keep
|
||||
-keep @androidx.annotation.Keep class * { *; }
|
||||
-keepclassmembers class * {
|
||||
@androidx.annotation.Keep *;
|
||||
}
|
||||
|
||||
# If using Gson TypeAdapterFactory via reflection
|
||||
-keepclassmembers class * {
|
||||
static ** typeAdapterFactory*(...);
|
||||
}
|
||||
|
||||
# Don't remove debug/logging if you want (optional)
|
||||
#-keep class android.util.Log { *; }
|
||||
|
||||
# Keep any generated plugin registrant classes if present (older projects)
|
||||
-keep class io.flutter.plugins.GeneratedPluginRegistrant { *; }
|
||||
|
||||
# (Optional) Keep parcelable implementations if those are serialized dynamically
|
||||
-keep class * implements android.os.Parcelable {
|
||||
public static final android.os.Parcelable$Creator *;
|
||||
}
|
||||
# Please add these rules to your existing keep rules in order to suppress warnings.
|
||||
# This is generated automatically by the Android Gradle plugin.
|
||||
-dontwarn com.google.android.play.core.splitcompat.SplitCompatApplication
|
||||
-dontwarn com.google.android.play.core.splitinstall.SplitInstallException
|
||||
-dontwarn com.google.android.play.core.splitinstall.SplitInstallManager
|
||||
-dontwarn com.google.android.play.core.splitinstall.SplitInstallManagerFactory
|
||||
-dontwarn com.google.android.play.core.splitinstall.SplitInstallRequest$Builder
|
||||
-dontwarn com.google.android.play.core.splitinstall.SplitInstallRequest
|
||||
-dontwarn com.google.android.play.core.splitinstall.SplitInstallSessionState
|
||||
-dontwarn com.google.android.play.core.splitinstall.SplitInstallStateUpdatedListener
|
||||
-dontwarn com.google.android.play.core.tasks.OnFailureListener
|
||||
-dontwarn com.google.android.play.core.tasks.OnSuccessListener
|
||||
-dontwarn com.google.android.play.core.tasks.Task
|
663
android/build/reports/problems/problems-report.html
Normal file
663
android/build/reports/problems/problems-report.html
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user