add proguard

This commit is contained in:
crazecoder 2019-11-13 16:11:02 +08:00
parent ffb36fa966
commit b389760d46
2 changed files with 28 additions and 0 deletions

View File

@ -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'

17
android/proguard-rules.pro vendored Normal file
View File

@ -0,0 +1,17 @@
# WebView
-keepattributes *JavascriptInterface*
-keepclassmembers class * {
@android.webkit.JavascriptInterface <methods>;
}
-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 {
<fields>;
<methods>;
public *;
private *;
}
-keep class com.pichillilorenzo.flutter_inappbrowser.** { *; }