本文介绍了如何在PhoneGap Android应用程序中加密内容资产文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用phonegap开发了一个示例android应用程序,如果有人对apk文件进行逆向工程,他们可以轻松获取javascript,html文件。
保护资产文件夹中javascript和html文件的最佳方法是什么,因为我将在javascript源文件中定义很多api键,这些键应该被隐藏。

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.

推荐答案

@mahesh

1)前段时间我有问题,但在iOS上。结果是仅在为iOS修补PhoneGap之后。我已经在。另外,对于Android而言,此方法可能很弱,因为Java代码可能会进行99%的反编译,黑客会看到您的密钥。

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)您可以使用webview并加载一个base64字符串:

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

受保护的字符串base64Str = + wL00h2L ....;
wv1.loadData(base64Str, text / html; charset = utf-8, base64);

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

谢谢

这篇关于如何在PhoneGap Android应用程序中加密内容资产文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-03 08:39