webview中JavascriptInterface接口在release包中无法使用的问题
I changed the Proguard configuration file like this:
-keep public class com.mypackage.MyClass$MyJavaScriptInterface
-keep public class * implements com.mypackage.MyClass$MyJavaScriptInterface
-keepclassmembers class com.mypackage.MyClass$MyJavaScriptInterface {
<methods>;
}
For API 17+ you also need to preserve the @JavascriptInterface annotations:
-keepattributes JavascriptInterface