flutter Android混淆

1 在android/app目录下新建文件,名为proguard-rules.pro。文件内容如下:

-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 com.umeng.** {*;}

-keepclassmembers class * {
   public  (org.json.JSONObject);
}

-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}

2 在android/app目录下build.gradle文件中release下面添加如下内容:

minifyEnabled true
            useProguard true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

你可能感兴趣的:(Flutter,flutter,android,java)