记录下 javascript-obfuscator的使用

javascript-obfuscator是一个免费的JavaScript代码混淆工具,它功能强大,可以把你的源代码变得“面目全非”,完全没有可读性。还具有部分防调试功能,给JavaScript代码多一层保护。

1,安装

npm install javascript-obfuscator -g

2,查看版本

javascript-obfuscator -v

3,具体使用

javascript-obfuscator a.js --config config.json --output b.js

a.json 原文件 b.json 输出文件 config.json obfuscator配置文件

配置大概内容:

{
    "compact": true,
    "controlFlowFlattening": true,
    "controlFlowFlatteningThreshold": 0.75,
    "deadCodeInjection": true,
    "deadCodeInjectionThreshold": 0.4,
    "debugProtection": false,
    "debugProtectionInterval": false,
    "disableConsoleOutput": true,
    "identifierNamesGenerator": "hexadecimal",
    "log": false,
    "renameGlobals": false,
    "rotateStringArray": true,
    "selfDefending": true,
    "stringArray": true,
    "stringArrayEncoding": "base64",
    "stringArrayThreshold": 0.75,
    "unicodeEscapeSequence": false
}

最后附上官网地址:https://github.com/javascript-obfuscator/javascript-obfuscator查看具体使用方式

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值