我想做一个JavaScript应用程序,不是开源的,因此我希望学习如何可以混淆我的JS代码?这可能吗?
当前回答
有许多免费的JavaScript混淆工具;然而,我认为重要的是要注意,很难混淆JavaScript到不能进行逆向工程的地步。
为此,我在一定程度上使用了几个选项:
YUI Compressor. Yahoo!'s JavaScript compressor does a good job of condensing the code that will improve its load time. There is a small level of obfuscation that works relatively well. Essentially, Compressor will change function names, remove white space, and modify local variables. This is what I use most often. This is an open-source Java-based tool. JSMin is a tool written by Douglas Crockford that seeks to minify your JavaScript source. In Crockford's own words, "JSMin does not obfuscate, but it does uglify." It's primary goal is to minify the size of your source for faster loading in browsers. Free JavaScript Obfuscator. This is a web-based tool that attempts to obfuscate your code by actually encoding it. I think that the trade-offs of its form of encoding (or obfuscation) could come at the cost of filesize; however, that's a matter of personal preference.
其他回答
有许多免费的JavaScript混淆工具;然而,我认为重要的是要注意,很难混淆JavaScript到不能进行逆向工程的地步。
为此,我在一定程度上使用了几个选项:
YUI Compressor. Yahoo!'s JavaScript compressor does a good job of condensing the code that will improve its load time. There is a small level of obfuscation that works relatively well. Essentially, Compressor will change function names, remove white space, and modify local variables. This is what I use most often. This is an open-source Java-based tool. JSMin is a tool written by Douglas Crockford that seeks to minify your JavaScript source. In Crockford's own words, "JSMin does not obfuscate, but it does uglify." It's primary goal is to minify the size of your source for faster loading in browsers. Free JavaScript Obfuscator. This is a web-based tool that attempts to obfuscate your code by actually encoding it. I think that the trade-offs of its form of encoding (or obfuscation) could come at the cost of filesize; however, that's a matter of personal preference.
我正在使用闭包编译器实用程序的java脚本混淆。它减少了代码,并为混淆提供了更多的选项。 此实用程序可在谷歌代码在以下URL: 闭包的工具
但是现在我听到很多关于UglifyJS的消息。你可以在闭包编译器和UglifyJS之间找到各种比较,其中Uglify似乎是赢家。 UglifyJS:一种可以与闭包媲美的快速Node.js压缩器
很快我就给了UglifyJS机会。
Dean Edward's Packer是一个很好的混淆器,尽管它主要是混淆代码,而不是代码中可能存在的任何字符串元素。
参见:在线Javascript压缩工具,并从下拉菜单中选择Packer (Dean Edwards)
你试过香蕉脚本吗?它生成高度压缩且完全不可读的代码。
JScrambler试试。最近我试了一下,印象深刻。 它为那些不太关心细节,只想快速完成的人提供了一组模板,用于混淆预定义的设置。您还可以通过选择任何您想要的转换/技术来创建自定义混淆。
推荐文章
- 截断字符串直接JavaScript
- 我如何使用可选的链接与数组和函数?
- EINVRES请求https://bower.herokuapp.com/packages/失败,提示502
- 使用fetch进行基本身份验证?
- 如何从子组件内部更新React上下文?
- 如何将一个普通对象转换为ES6映射?
- scrollIntoView卷轴太远了
- Angular ng-repeat反过来
- 如何获得请求路径与表达请求对象
- 使用Handlebars 'each'循环访问父对象的属性
- 盎格鲁- ngcloak / ngg展示blink元素
- 禁用表单自动提交按钮单击
- 节点和错误:EMFILE,打开的文件太多
- JavaScript函数中的默认参数值
- 使用RegExp.exec从字符串中提取所有匹配项