This project very good, so I use it in many of my projects, so I recommend the following suggestions here:
String Array, our array can consider using a single Unicode Escape Sequence. The remaining strings can be considered separately.void 0 if there is a variable named undefined in scope (variable name will be mangled, typically reduced to a single character)An example of a combination of obfuscate() options:
var SourceCodeList = {
"test_1.js": "function hi(){console.log(\"Hello World!\");}hi();",
"test_2.js": "console.log(\"Welcome use a free and efficient obfuscator for JavaScript\");"
};
var options = {
compact: true,
controlFlowFlattening: true,
controlFlowFlatteningThreshold: 0.75,
deadCodeInjection: true,
deadCodeInjectionThreshold: 0.4,
debugProtection: false,
debugProtectionInterval: false,
disableConsoleOutput: true,
identifierNamesGenerator: 'hexadecimal',
renameGlobals: false,
rotateStringArray: true,
selfDefending: true,
shuffleStringArray: true,
splitStrings: true,
splitStringsChunkLength: '10',
stringArray: true,
stringArrayEncoding: 'base64',
stringArrayThreshold: 0.75,
transformObjectKeys: true,
unicodeEscapeSequence: false
};
var obfuscationResult = JavaScriptObfuscator.obfuscate(SourceCodeList, options);
console.log(obfuscationResult.getObfuscatedCode());
Third point comparison
Before:
var _0x2e7f=['Hello\x20World!','log'];(function(_0x53d6b3,_0x2e7f7e){var _0x41301a=function(_0x3ed08d){while(--_0x3ed08d){_0x53d6b3['push'](_0x53d6b3['shift']());}};_0x41301a(++_0x2e7f7e);}(_0x2e7f,0x1c4));var _0x4130=function(_0x53d6b3,_0x2e7f7e){_0x53d6b3=_0x53d6b3-0x0;var _0x41301a=_0x2e7f[_0x53d6b3];return _0x41301a;};function hi(){console[_0x4130('0x1')](_0x4130('0x0'));}hi();
After:
var _0x2e7f=['\x6c\x6f\x67','\x48\x65\x6c\x6c\x6f\x20\x57\x6f\x72\x6c\x64\x21'];(function(_0x53d6b3,_0x2e7f7e){var _0x41301a=function(_0x3ed08d){while(--_0x3ed08d){_0x53d6b3['push'](_0x53d6b3['shift']());}};_0x41301a(++_0x2e7f7e);}(_0x2e7f,0x1c4));var _0x4130=function(_0x53d6b3,_0x2e7f7e){_0x53d6b3=_0x53d6b3-0x0;var _0x41301a=_0x2e7f[_0x53d6b3];return _0x41301a;};function hi(){console[_0x4130('0x1')](_0x4130('0x0'));}hi();
Hi. Multiple sources obfuscation here
https://github.com/javascript-obfuscator/javascript-obfuscator/pull/581
Multiple sources obfuscation just released as 0.27.0 release
wow~like
I think the following encryption schemes can be tried for String Array Encoding
Most helpful comment
Multiple sources obfuscation just released as
0.27.0release