How to encrypt the content assets folder in phonegap android application

徘徊边缘 提交于 2019-12-13 04:56:25

问题


I have developed a sample android application using phonegap,If someone reverse engineers the apk file,They can easily get the javascript,html files . What is the best way to secure javascript and html files in the assets folder since i will be defining lot of api keys in the javascript source files which should be hidden.


回答1:


@mahesh

1) Some time ago I have same problem but on iOS. And the result was only after patching PhoneGap for iOS. I have wrote an article at http://oleksiy.pro/2011/09/20/phonegap-application-encryption/. Also, for Android this method could be weak, because java code could be 99% decompiled, and hacker will see your key.

2) You can use a webview and load a base64 string:

protected String base64Str = "+wL00h2L...."; wv1.loadData(base64Str, "text/html; charset=utf-8", "base64");

Thanks



来源:https://stackoverflow.com/questions/24925594/how-to-encrypt-the-content-assets-folder-in-phonegap-android-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!