Change Log
domainDest option that option allows the browser to be redirected to a passed domain if the source code isn't run on the domains specified by domainLock.ObfuscationResult object now contains getOptions method to get options that were used during obfuscationidentifierNamesCache option for reading and writing identifier names cache. See README.md.--identifier-names-cache-path option for reading and writing identifier names cache. See README.md.controlFlowFlattenig option is enabled. Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/920node@16 and dropped support of node@10. This should not affect obfuscated codestringArray calls wrappers now inserted as FunctionDeclaration nodes at random indexesrenamePropertiesMode to switch between new safe and old unsafe modes of renameProperties option. Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/878renameProperties option now works in safe way by defaulttop-level await. Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/884controlFlowFlattening option is enabled. Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/887numbersToExpressions option for float numbers. Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/882simplify option regression after 2.10.2. Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/864simplify options when a node with a single-statement body is inside simplified IfStatement node. Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/860base64 encoded strings from atob code helper to prevent mutation of RegExp.$1 value during calls to the stringArray. Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/829rotateStringArray option"use strict"; directive during obfuscationrc4 and base64 encodings are enabledstringArrayWrappersCount option when identifiersPrefix option is set. symbol. https://github.com/javascript-obfuscator/javascript-obfuscator/issues/816transformObjectKeys option is enabled. Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/813stringArrayWrappersParametersMaxCount CLI option namestringArrayIndexesType accepts an array of types of string array call indexeshexadecimal-numeric-string to hexadecimal-numberstringArrayIndexShift enables additional index shift for all string array callsstringArrayWrappersParametersMaxCount allows to control the maximum number of string array wrappers parametersstringArrayWrappersType: 'function' option value moved from high-obfuscation to medium-obfuscation options presetignoreRequireImports prevents obfuscation of require imports. Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/801@javascript-obfuscator/escodegen to 2.1.1escodegen to @javascript-obfuscator/escodegennullish-coalescing. Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/604exported field of ExportAllDeclaration node. Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/710SpreadElement when transformObjectKeys option is enabled. Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/797ExportSpecifierTransformer. Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/791PowerShell. Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/783Node.js@15webpack@5ExpressionStatementsMergeTransformer when simplify option is enabled. Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/777identifierNamesGenerator: 'mangled-shuffled' after 2.2.0. Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/778--output is a directory pathwin32 environment. Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/576win32 environment. Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/760javascript-obfuscator now can be built under win32 environmentURI-malformed when splitStrings and stringArrayEncoding options are enabled. https://github.com/javascript-obfuscator/javascript-obfuscator/issues/530forceTransformStrings allows force transform strings even if by stringArrayThreshold (or possible other thresholds in the future) they shouldn't be transformed. Implemented https://github.com/javascript-obfuscator/javascript-obfuscator/issues/657identifierNamesGenerator: 'mangled' option that causes wrong identifier names generationstringArrayWrappersType allows to select a type of the wrappers that are appending by the stringArrayWrappersCount optionstringArrayWrappersCount sets the count of wrappers for the string array inside each root or function scopestringArrayWrappersChainedCalls enables the chained calls between string array wrappersgetOptionsByPreset allows to get options for the passed options preset namestringArrayEncoding option now accepts an array of encodings. Each string will be randomly encoded with passed encodingsplitStrings and renameProperties option. https://github.com/javascript-obfuscator/javascript-obfuscator/issues/729optionsPreset allows to set options presetdeadCodeInjection dead code identifiers. Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/708TaggedTemplateLiteral obfuscation. https://github.com/javascript-obfuscator/javascript-obfuscator/issues/716ExportNamedDeclaration and ExportAllDeclaration nodesTaggedTemplateLiteral obfuscation. https://github.com/javascript-obfuscator/javascript-obfuscator/issues/696disableConsoleOutput template. https://github.com/javascript-obfuscator/javascript-obfuscator/issues/691Uncaught SyntaxError: yield is a reserved identifier when deadCodeInjection is enableddomainLock option patterns with leading dot character (.example.com) now cover root domains (example.com) in addition to all sub-domains (sub.example.com). https://github.com/javascript-obfuscator/javascript-obfuscator/issues/640simplify option now affects all block statements. Improved variable declarations merging.numbersToExpressions enables numbers conversion to expressionsmangled identifier name generatorsIfStatement contains only single let or const variable declaration when simlify option enabled. https://github.com/javascript-obfuscator/javascript-obfuscator/issues/661source-map: 'inline' encoding after 1.3.0mangled-shuffled identifier names generator based on mangled identifier names generatorsimplify enables additional code obfuscation through simplificationstringArrayEncoding: base64 and rc4.js and .json extensions)Initializing stage after 1.2.0selfDefending is enabled. https://github.com/javascript-obfuscator/javascript-obfuscator/issues/615renameProperties enables renaming of property namesObjectPattern with single RestElement. https://github.com/javascript-obfuscator/javascript-obfuscator/issues/607self-defending code for target: 'browser-no-eval'. https://github.com/javascript-obfuscator/javascript-obfuscator/issues/610identifierNamesGenerator: 'mangled'deadCodeInjection optionacorn-import-meta packageobfuscateMultiple methodobfuscateMultiple to obfuscation of multiple source codesmangled identifier names generator logicselfDefending helper logicsuper call--output logic. Now --output value can describe if it's a file or a directory path. Check README.md for more infonode target for sourceMap* optionsimport.meta support. Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/505target: 'node' will cause a validation erroridentifierNamesGenerator: 'mangled speedtransformObjectKeys runtime errorsMaximum call stack size exceeded error on large strings when splitString option is enabledawesome-typescript-loader on ts-loadershuffleStringArray randomly shuffles string array itemsespree on acornTypeError: Assignment to constant variable when auto-detection of kind of variables is inserted const variables for controlFlowStorage nodestransformObjectKeys transformation to cover more casesfor-await-of statement: https://github.com/javascript-obfuscator/javascript-obfuscator/issues/419mangled and dictionary identifier names generatorsidentifierNamesGenerator: dictionary and debugProtection optionsseed option now accepts string and number valuesidentifierNamesGenerator now allows to set new dictionary identifier names generatoridentifiersDictionary sets identifiers dictionary for identifierNamesGenerator: dictionary optionThanks to our contributors!
reservedNames optionThanks to our contributors!
splitStrings option now correctly works with transformObjectKeys optionTransformersRunner rework to support topological sort of node transformerssplitStrings option now correctly splits strings inside objectssplitStrings option now affects template literal stringssplitStrings splits literal strings into chunks with length of splitStringsChunkLength option valuesplitStringsChunkLength sets chunk length of splitStrings optionThanks to our contributors!
Thanks to our contributors!
Thanks to our contributors!
Thanks to our contributors!
reservedStrings disables transformation of string literals, which being matched by passed RegExp patternsinputFileName allows to set name of the input file with source code. This name will used internally, for example, for source map generation.domainLock now will work in SVG.
esprima on espreenode@4 and node@5 support.extension value of target option on browser-no-eval.reservedName option. Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/216exclude allows to exclude specific files or directories from obfuscation.import and export declarations.esprima error messages.identifiersPrefix sets prefix for all global identifiers.transformObjectKeys enables object keys transformation and obfuscation.eval expressions obfuscation.deadCodeInjection is enabled and identifierNamesGenerator is set to mangled.mangle option was removed.identifierNamesGenerator allows to set identifier names generator (hexadecimal or mangled).kebab-case format (--disableConsoleOutout -> --disable-console-output).mangle option algorithm without esmangle; fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/110@license and @preserve words won't be removed from obfuscated code.target allows to set target environment for obfuscated code.es2015 class names.log enables logging of the information to the console.renameGlobals allows to enable obfuscation of global variable and function names with declaration.deadCodeInjection. With this option random blocks of dead code will add to the obfuscated code.deadCodeInjectionThreshold allows to set percentage of nodes that will affected by deadCodeInjection.mangle enables mangling of variable names.--config allows to set config file with obfuscator options.disableConsoleOutput option now disabled by default.escapeUnicodeSequence option now disabled by default.controlFlowFlattening now affects string literal nodes.rc4 stringArrayEncoding.escodegen to escodegen-wallaby, fixed https://github.com/javascript-obfuscator/javascript-obfuscator/pull/50[email protected] and [email protected] support.controlFlowFlattening allows to enable/disable Control Flow flattening. Control flow flattening is a structure transformation of the source code that hinders program comprehension.controlFlowFlatteningThreshold allows to set percentage of nodes that will affected by controlFlowFlattening.es2015 support: correct obfuscation of TemplateLiteral, ArrayPattern, AssignmentPattern nodes.npm to yarn internally.Cannot read property 'type' of undefined error, when RandomGeneratorUtils.getMathRandom() returned incorrect value 1.[email protected] and [email protected] support.npm to yarn internally.controlFlowFlattening allows to enable/disable Control Flow flattening. Control flow flattening is a structure transformation of the source code that hinders program comprehension.controlFlowFlatteningThreshold allows to set percentage of nodes that will affected by controlFlowFlattening.es2015 support: correct obfuscation of TemplateLiteral, ArrayPattern, AssignmentPattern nodes.selfDefending option now disabled by default.seed sets seed for random generator. This is useful for creating repeatable results.disableConsoleOutput option now replaces console.xxx functions on empty function instead of infinity loop.unicodeArray option has been renamed to stringArray.unicodeArrayThreshold option has been renamed to stringArrayThreshold.encodeUnicodeArray option has been renamed to stringArrayEncoding and now accepts following values: true|false|'base64'|'rc4'.wrapUnicodeArrayCalls was removed and now all calls to stringArray are always wrapped by special wrapper function.unicodeEscapeSequence allows to enable/disable strings conversion to unicode escape sequence.domainLock locks the obfuscated source code so it only runs on specific domains and/or sub-domains.sourceMapBaseUrl sets base url to the source map import url when sourceMapMode: 'separate'.selfDefendingNode or consoleOutputNode now inserted into deepest stack trace function call.Utils.decToHex methodobfuscate(sourceCode, options) returns ObfuscationResult object instead string. ObfuscationResult object contains two public methods: getObfuscatedCode() and getSourceMap().javascript-obfuscator command. See README.md for available options.sourceMap enables source map generation for obfuscated code.sourceMapMode specifies source map generation mode.