The entire method of addJavascriptInterface is
A general example is as follows:
webView.addJavascriptInterface(new MyJavaScriptInterface(), "myContent");
where MyJavaScriptInterface is the inner class:
public class MyJavaScriptInterface {
@JavascriptInterface
public String getContent() {
return content;
}
}
Then we need to declare MyJavaScriptInterface in the obfuscated script, otherwise it cannot be called.
-keepattributes *Annotation*
-keepattributes *JavascriptInterface*
-keepclassmembers class {包名}$MyJavaScriptInterface {
public *;
}