javascript - PhoneGap 源安全

标签 javascript security cordova obfuscation

关于 Platform Security 的最后一节,它提到了一种在 PhoneGap 应用程序中保护源代码的方法。

Reverse engineering is a concern of many people that use PhoneGap since one can simply open an application binary and look at the JavaScript source code of the application. One could even go so far as to add malicious JavaScript code, re-package the application and re-submit it to app stores / markets in an attempt at app phishing. This practice could be undertaken with any application whether it is written with PhoneGap or otherwise since it is a similarly simple task to decompile either Java or Objective-C.

PhoneGap can actually get around this security concern since application developers can download JavaScript in their application at runtime, run that JavaScript, and delete it when the application closes. In that way, the source code is never on the device when the device is at rest. This is a much more difficult prospect with Java or Objective-C let alone the restrictions in the App Store around dynamically running Objective-C code.

但是,我想知道如何防止他人在服务器上下载我的源代码?

最佳答案

我建议注释您的代码,然后通过 Google 的 Closure Compiler 运行它,这将混淆它并执行某些优化。这将使人们很难阅读您的代码,但除此之外,您将不得不接受 JS 是一种客户端语言这一事实​​。

关于javascript - PhoneGap 源安全,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17911854/

相关文章:

mysql - 在 MYSQL 中对敏感数据使用 AES 加密 - 实现问题

http - 我应该为后端 API 使用 Content-Security-Policy HTTP header 吗?

javascript - Ajax/ header 不匹配?

javascript - 如何在相机 Cordova/Phonegap 上显示文字?

angularjs - 如何在 ionic 中选择文本?

javascript - Express js无法获取/注册

javascript - 悬停多个实例 div 时发出独特的声音

javascript - 如何通过消除双重等待和 DRY 代码进行重构?

java - websphere 和 tomcat 之间的共享安全性

javascript - Jquery .when 和多个 .load