Obfuscate-混淆js方案
发表于 : 2025年 11月 6日 16:37 星期四
//降低混淆提高速度
const obfuscationOptions = {
compact: true,
controlFlowFlattening: false,
controlFlowFlatteningThreshold: 0,
deadCodeInjection: false,
stringArray: true,
stringArrayEncoding: ['base64'],
stringArrayThreshold: 1.0,
stringArrayRotate: true,
stringArrayShuffle: true,
stringArrayWrappersCount: 2,
stringArrayWrappersChainedCalls: false,
stringArrayWrappersParametersMaxCount: 3,
renameGlobals: true,
identifierNamesGenerator: 'mangled-shuffled',
identifierNamesCache: null,
identifiersPrefix: '',
renameProperties: false,
renamePropertiesMode: 'safe',
ignoreImports: false,
target: 'browser',
numbersToExpressions: false,
simplify: false,
splitStrings: true,
splitStringsChunkLength: 1,
transformObjectKeys: false,
unicodeEscapeSequence: true,
selfDefending: false,
debugProtection: false,
debugProtectionInterval: 0,
disableConsoleOutput: true,
domainLock: []
};
// --- 最强混淆配置:无明文内容 ---
const obfuscationOptions = {
compact: true,
controlFlowFlattening: true,
controlFlowFlatteningThreshold: 1.0,
deadCodeInjection: false,
stringArray: true,
stringArrayEncoding: ['base64', 'rc4'],
stringArrayThreshold: 1.0,
stringArrayRotate: true,
stringArrayShuffle: true,
stringArrayWrappersCount: 5,
stringArrayWrappersChainedCalls: true,
stringArrayWrappersParametersMaxCount: 5,
renameGlobals: true,
identifierNamesGenerator: 'mangled-shuffled',
identifierNamesCache: null,
identifiersPrefix: '',
renameProperties: false,
renamePropertiesMode: 'safe',
ignoreImports: false,
target: 'browser',
numbersToExpressions: true,
simplify: false,
splitStrings: true,
splitStringsChunkLength: 5,
transformObjectKeys: true,
unicodeEscapeSequence: true,
selfDefending: true,
debugProtection: false,
debugProtectionInterval: 0,
disableConsoleOutput: true,
domainLock: []
};
const obfuscationOptions = {
compact: true,
controlFlowFlattening: false,
controlFlowFlatteningThreshold: 0,
deadCodeInjection: false,
stringArray: true,
stringArrayEncoding: ['base64'],
stringArrayThreshold: 1.0,
stringArrayRotate: true,
stringArrayShuffle: true,
stringArrayWrappersCount: 2,
stringArrayWrappersChainedCalls: false,
stringArrayWrappersParametersMaxCount: 3,
renameGlobals: true,
identifierNamesGenerator: 'mangled-shuffled',
identifierNamesCache: null,
identifiersPrefix: '',
renameProperties: false,
renamePropertiesMode: 'safe',
ignoreImports: false,
target: 'browser',
numbersToExpressions: false,
simplify: false,
splitStrings: true,
splitStringsChunkLength: 1,
transformObjectKeys: false,
unicodeEscapeSequence: true,
selfDefending: false,
debugProtection: false,
debugProtectionInterval: 0,
disableConsoleOutput: true,
domainLock: []
};
// --- 最强混淆配置:无明文内容 ---
const obfuscationOptions = {
compact: true,
controlFlowFlattening: true,
controlFlowFlatteningThreshold: 1.0,
deadCodeInjection: false,
stringArray: true,
stringArrayEncoding: ['base64', 'rc4'],
stringArrayThreshold: 1.0,
stringArrayRotate: true,
stringArrayShuffle: true,
stringArrayWrappersCount: 5,
stringArrayWrappersChainedCalls: true,
stringArrayWrappersParametersMaxCount: 5,
renameGlobals: true,
identifierNamesGenerator: 'mangled-shuffled',
identifierNamesCache: null,
identifiersPrefix: '',
renameProperties: false,
renamePropertiesMode: 'safe',
ignoreImports: false,
target: 'browser',
numbersToExpressions: true,
simplify: false,
splitStrings: true,
splitStringsChunkLength: 5,
transformObjectKeys: true,
unicodeEscapeSequence: true,
selfDefending: true,
debugProtection: false,
debugProtectionInterval: 0,
disableConsoleOutput: true,
domainLock: []
};