This commit is contained in:
蒋小陌 2024-10-15 18:57:56 +08:00
parent 9f3b135454
commit 2ac39eb74b
2 changed files with 9 additions and 8 deletions

File diff suppressed because one or more lines are too long

View File

@ -7,13 +7,14 @@ const outputFilePath = './index.js';
const code = fs.readFileSync(inputFilePath, 'utf8'); const code = fs.readFileSync(inputFilePath, 'utf8');
const obfuscatedCode = JavaScriptObfuscator.obfuscate(code, { const obfuscatedCode = JavaScriptObfuscator.obfuscate(code, {
compact: true, compact: true, // 压缩代码
controlFlowFlattening: true, controlFlowFlattening: true, // 控制流混淆
deadCodeInjection: true, deadCodeInjection: true, // 死代码注入
numbersToExpressions: true, numbersToExpressions: true, // 将数字转换为表达式
renameGlobals: true, renameGlobals: true, // 重命名全局变量
simplify: true, simplify: true, // 简化代码
stringArray: true, splitStrings: true, // 将字符串拆分为多个字符串
stringArray: true, // 将字符串转换为数组
}).getObfuscatedCode(); }).getObfuscatedCode();
fs.writeFileSync(outputFilePath, obfuscatedCode); fs.writeFileSync(outputFilePath, obfuscatedCode);