disableConsoleOutput:是否禁用console.log等输出,默认为false。 identifierNamesGenerator:标识符名称的生成方式,默认为'mangled'。 log:是否记录混淆过程,默认为false。 numbersToExpressions:是否将数字转换为表达式,默认为false。 renameGlobals:是否重命名全局变量,默认为false。 rotateStringArray:是否启用字符串数组旋转,...
console.log(it.fileName) constobfuscationResult =JavaScriptObfuscator.obfuscate(it.content, {/** 这些都是配置 */compact:false,controlFlowFlattening:true,controlFlowFlatteningThreshold:1,numbersToExpressions:true,simplify:true,stringArrayShuffle:true,splitStrings:true,stringArrayThreshold:1}) fs.writeFile(b...
debugProtectionInterval: 0, disableConsoleOutput: false, identifierNamesGenerator: 'hexadecimal', log: false, numbersToExpressions: false, renameGlobals: false, selfDefending: false, simplify: true, splitStrings: false, stringArray: true, stringArrayCallsTransform: false, stringArrayCallsTransformThreshold...
参数的含义参考https://obfuscator.iojavascript-obfuscator [输入js文件路径] --output [输出js文件路径] --self-defending true --disable-console-output true --debug-protection true --control-flow-flattening true --dead-code-injection ture --string-array true --string-array-rotate true...
{"compact":true,"controlFlowFlattening":true,"controlFlowFlatteningThreshold":0.75,"deadCodeInjection":true,"deadCodeInjectionThreshold":0.4,"debugProtection":false,"debugProtectionInterval":false,"disableConsoleOutput":true,"identifierNamesGenerator":"hexadecimal","log":false,"renameGlobals":false,"rotate...
console.log('-->isNotDirectory:' + file); if (file.indexOf('.js') >= 0 && file.indexOf('.json') < 0) { // 开始混淆代码 console.log('-->Start confusing code:' + file); var cmd = ' javascript-obfuscator ' + readdirpath + ' --config index.json --output ' + readdirpath...
最近看到一个用JavaScript Obfuscator做前端JS代码混淆的案例,由于临近年关坐等放假,就闲得蛋疼简单分析了一下。 JavaScript Obfuscator Tool 首先,我们在官网看一下,JavaScript Obfuscator提供了众多的选项作为混淆入参: 基础 Disable Console Output(禁用控制台输出) ...
console.log(obfuscate(code, options)) 2.3.2 变量名混淆 变量名混淆可以通过配置identifierNamesGenerator 参数实现,我们通过这个参数可以控制变量名混淆的方式,如hexadecimal则会替换为 16 进制形式的字符串,在这里我们可以设定如下值: hexadecimal:将变量名替换为 16 进制形式的字符串,如 0xabc123。
//原始: return this.transformNode(node, parentNode); //修复bug后的代码: //是否是异步函数的标识 var in_async_function = false; //递归函数,检测节点所有上级节点,判断是否处于异步函数中 var point = "-"; function detect_async_function(node:ESTree.Node){ console.log(point, node.type); if(node...
(function (){ var domain = "js-obfuscator.com"; var from_year = 2000 + 17; var copyright = function(){ return "(c)" + from_year + "-" + (new Date).getFullYear() + "," + domain; }; var console_log = console.log; console_log(copyright()) })(); Secret key: ? There...