反向 Uglified Javascript 代码
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18408535/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Reverse Uglified Javascript Code
提问by Dr.YSG
I am looking for way (preferably and online site) to a reverse Uglify of some javascript. The Website: http://jsbeautifier.org/is great for minifed code, but it is does not do a great job for ugly stuff.
我正在寻找方法(最好是在线站点)来反向 Uglify 一些 javascript。网站:http: //jsbeautifier.org/ 非常适合小型化代码,但它对于丑陋的东西却做得不好。
采纳答案by camolin3
There is this awesome online tool, JSNice, that makes a great job of finding names to obfuscated variables.
有一个很棒的在线工具JSNice,它可以很好地为混淆变量查找名称。
We make even obfuscated JavaScript code readable. We will rename variables and parameters to names that we learn from thousands of open source projects. Furthermore, often we are also able to guess or infer type annotations.
我们甚至使混淆的 JavaScript 代码可读。我们将变量和参数重命名为我们从数千个开源项目中学到的名称。此外,通常我们还能够猜测或推断类型注释。
回答by Srinivas
chrome dev tools also can do this.
chrome 开发工具也可以做到这一点。
point no 2 in http://www.elijahmanor.com/2011/08/7-chrome-tips-developers-designers-may.html
http://www.elijahmanor.com/2011/08/7-chrome-tips-developers-designers-may.html 中的第2 点
回答by Ish
Depends on what options you used when you uglify your code. If you just remove the line breaks, then Chrome dev tools will be able to do a great work as sirinivas explained. But if you mangle the code, then ther is no way you can get the exact previous code. (in uglifying var logngvariable = a + b; becomes var c=a+b;. there is no way a tool can figure out the previous name logngvariable )
取决于您在丑化代码时使用的选项。如果您只是删除换行符,那么 Chrome 开发工具将能够像 sirinivas 解释的那样出色地完成工作。但是,如果您弄乱了代码,则无法获得与之前完全相同的代码。(丑化 var logngvariable = a + b; 变成 var c=a+b;。没有任何工具可以找出以前的名称 logngvariable )
On the otherhand if you want an un-uglified code you may not uglify it at the first place... :)
另一方面,如果你想要一个未丑化的代码,你可能一开始就不会丑化它...... :)