android hack 

小心Android中的JavaScriptInterface

去年的某一天,收到客户的反馈说我们的产品在他的手机上不工作。

看了一下日志发现是WebView中JavaScript调用的某个Java方法找不到,通过报错信息搜索后得知:

Caution: If you've set your targetSdkVersion to 17 or higher, you must add the @JavascriptInterface annotation to any method that you want available your web page code (the method must also be public). If you......