在Android中,JavaScript接口注入漏洞 [英] In Android, JavaScript Interface Injection Vulnerability
本文介绍了在Android中,JavaScript接口注入漏洞的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的应用程序从Google PlayStore收到[JavaScript界面注入漏洞的修复]。
My application received [Remediation for JavaScript Interface Injection Vulnerability] from Google PlayStore.
通过非https网页中的javascript界面进行Webview控制。
Webview control via javascript interface in non-https webpage.
这是我的解决方案。
这个问题是否正确?或者如何修改?
It is correct for this issue? or how to modify?
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
if(request.getUrl().getHost().equals("mydomain.com")) {
view.addJavascriptInterface(new MyJavaScriptInterface(), "myview");
} else {
view.removeJavascriptInterface("myview");
}
return super.shouldOverrideUrlLoading(view, request);
}
推荐答案
我使用https url解决了。我在我的网站上安装了ssl证书。
I solved using https url. I installed on my site an ssl certificate.
这篇关于在Android中,JavaScript接口注入漏洞的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文