Explorar o código

enable proguard on release build type, as requested in tanersener/mobile-ffmpeg#82

Taner Sener %!s(int64=6) %!d(string=hai) anos
pai
achega
f412ea2425
Modificáronse 2 ficheiros con 31 adicións e 2 borrados
  1. 6 2
      example/android/app/build.gradle
  2. 25 0
      example/android/app/proguard-rules.pro

+ 6 - 2
example/android/app/build.gradle

@@ -41,9 +41,13 @@ android {
     }
 
     buildTypes {
+        debug {
+            minifyEnabled false
+            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
+        }
         release {
-            // TODO: Add your own signing config for the release build.
-            // Signing with the debug keys for now, so `flutter run --release` works.
+            minifyEnabled true
+            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
             signingConfig signingConfigs.debug
         }
     }

+ 25 - 0
example/android/app/proguard-rules.pro

@@ -0,0 +1,25 @@
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the proguardFiles
+# directive in build.gradle.
+#
+# For more details, see
+#   http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+#Flutter Wrapper
+-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.**  { *; }
+
+# Flutter FFmpeg
+-keep class com.arthenica.mobileffmpeg.Config {
+    native <methods>;
+    void log(int, byte[]);
+    void statistics(int, float, float, long , int, double, double);
+}