diff --git a/android/build.gradle b/android/build.gradle index ee6a0047..3fe16b1c 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -29,10 +29,21 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true + consumerProguardFiles 'proguard-rules.pro' } lintOptions { disable 'InvalidPackage' } + buildTypes { + debug { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + release { + minifyEnabled true + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } dependencies { implementation 'androidx.webkit:webkit:1.0.0' implementation 'androidx.browser:browser:1.0.0' diff --git a/android/proguard-rules.pro b/android/proguard-rules.pro new file mode 100644 index 00000000..4930aa46 --- /dev/null +++ b/android/proguard-rules.pro @@ -0,0 +1,17 @@ +# WebView +-keepattributes *JavascriptInterface* +-keepclassmembers class * { + @android.webkit.JavascriptInterface ; +} +-keepclassmembers class * extends android.webkit.WebViewClient { + public void *(android.webkit.WebView, java.lang.String, android.graphics.Bitmap); + public boolean *(android.webkit.WebView, java.lang.String); + public void *(android.webkit.webView, jav.lang.String); +} +-keepclassmembers class com.pichillilorenzo.flutter_inappbrowser$JavaScriptBridgeInterface { + ; + ; + public *; + private *; +} +-keep class com.pichillilorenzo.flutter_inappbrowser.** { *; } \ No newline at end of file