diff --git a/CHANGELOG.md b/CHANGELOG.md index 1961c7c0..b42993ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ Change Log v3.0.0 --- * **Breaking change:** `ignoreRequireImports` option renamed to `ignoreImports` +* **Breaking change:** `rotateStringArray` option renamed to `stringArrayRotate` +* **Breaking change:** `shuffleStringArray` option renamed to `stringArrayShuffle` +* `ignoreImports` now ignores `dynamic` imports in addition to `require` imports v2.19.1 --- diff --git a/README.md b/README.md index 1f1dd0a3..5b91eb54 100644 --- a/README.md +++ b/README.md @@ -112,7 +112,7 @@ var obfuscationResult = JavaScriptObfuscator.obfuscate( controlFlowFlatteningThreshold: 1, numbersToExpressions: true, simplify: true, - shuffleStringArray: true, + stringArrayShuffle: true, splitStrings: true, stringArrayThreshold: 1 } @@ -368,10 +368,8 @@ Following options are available for the JS Obfuscator: renamePropertiesMode: 'safe', reservedNames: [], reservedStrings: [], - rotateStringArray: true, seed: 0, selfDefending: false, - shuffleStringArray: true, simplify: true, sourceMap: false, sourceMapBaseUrl: '', @@ -386,6 +384,8 @@ Following options are available for the JS Obfuscator: ], stringArrayEncoding: [], stringArrayIndexShift: true, + stringArrayRotate: true, + stringArrayShuffle: true, stringArrayWrappersCount: 1, stringArrayWrappersChainedCalls: true, stringArrayWrappersParametersMaxCount: 2, @@ -430,10 +430,8 @@ Following options are available for the JS Obfuscator: --rename-properties-mode [safe, unsafe] --reserved-names '' (comma separated) --reserved-strings '' (comma separated) - --rotate-string-array --seed --self-defending - --shuffle-string-array --simplify --source-map --source-map-base-url @@ -446,6 +444,8 @@ Following options are available for the JS Obfuscator: --string-array-indexes-type '' (comma separated) [hexadecimal-number, hexadecimal-numeric-string] --string-array-encoding '' (comma separated) [none, base64, rc4] --string-array-index-shift + --string-array-rotate + --string-array-shuffle --string-array-wrappers-count --string-array-wrappers-chained-calls --string-array-wrappers-parameters-max-count @@ -968,13 +968,6 @@ Example: } ``` -### `rotateStringArray` -Type: `boolean` Default: `true` - -##### :warning: [`stringArray`](#stringarray) must be enabled - -Shift the `stringArray` array by a fixed and random (generated at the code obfuscation) places. This makes it harder to match the order of the removed strings to their original place. - ### `seed` Type: `string|number` Default: `0` @@ -990,13 +983,6 @@ Type: `boolean` Default: `false` This option makes the output code resilient against formatting and variable renaming. If one tries to use a JavaScript beautifier on the obfuscated code, the code won't work anymore, making it harder to understand and modify it. -### `shuffleStringArray` -Type: `boolean` Default: `true` - -##### :warning: [`stringArray`](#stringarray) must be enabled - -Randomly shuffles the `stringArray` array items. - ### `simplify` Type: `boolean` Default: `true` @@ -1163,6 +1149,20 @@ Type: `boolean` Default: `true` Enables additional index shift for all string array calls +### `stringArrayRotate` +Type: `boolean` Default: `true` + +##### :warning: [`stringArray`](#stringarray) must be enabled + +Shift the `stringArray` array by a fixed and random (generated at the code obfuscation) places. This makes it harder to match the order of the removed strings to their original place. + +### `stringArrayShuffle` +Type: `boolean` Default: `true` + +##### :warning: [`stringArray`](#stringarray) must be enabled + +Randomly shuffles the `stringArray` array items. + ### `stringArrayWrappersCount` Type: `number` Default: `1` @@ -1435,15 +1435,15 @@ Performance will 50-100% slower than without obfuscation log: false, numbersToExpressions: true, renameGlobals: false, - rotateStringArray: true, selfDefending: true, - shuffleStringArray: true, simplify: true, splitStrings: true, splitStringsChunkLength: 5, stringArray: true, stringArrayEncoding: ['rc4'], stringArrayIndexShift: true, + stringArrayRotate: true, + stringArrayShuffle: true, stringArrayWrappersCount: 5, stringArrayWrappersChainedCalls: true, stringArrayWrappersParametersMaxCount: 5, @@ -1472,15 +1472,15 @@ Performance will 30-35% slower than without obfuscation log: false, numbersToExpressions: true, renameGlobals: false, - rotateStringArray: true, selfDefending: true, - shuffleStringArray: true, simplify: true, splitStrings: true, splitStringsChunkLength: 10, stringArray: true, stringArrayEncoding: ['base64'], stringArrayIndexShift: true, + stringArrayRotate: true, + stringArrayShuffle: true, stringArrayWrappersCount: 2, stringArrayWrappersChainedCalls: true, stringArrayWrappersParametersMaxCount: 4, @@ -1507,14 +1507,14 @@ Performance will slightly slower than without obfuscation log: false, numbersToExpressions: false, renameGlobals: false, - rotateStringArray: true, selfDefending: true, - shuffleStringArray: true, simplify: true, splitStrings: false, stringArray: true, stringArrayEncoding: [], stringArrayIndexShift: true, + stringArrayRotate: true, + stringArrayShuffle: true, stringArrayWrappersCount: 1, stringArrayWrappersChainedCalls: true, stringArrayWrappersParametersMaxCount: 2, @@ -1538,14 +1538,14 @@ Performance will slightly slower than without obfuscation log: false, numbersToExpressions: false, renameGlobals: false, - rotateStringArray: true, selfDefending: false, - shuffleStringArray: true, simplify: true, splitStrings: false, stringArray: true, stringArrayEncoding: [], stringArrayIndexShift: true, + stringArrayRotate: true, + stringArrayShuffle: true, stringArrayWrappersCount: 1, stringArrayWrappersChainedCalls: true, stringArrayWrappersParametersMaxCount: 2, diff --git a/src/cli/JavaScriptObfuscatorCLI.ts b/src/cli/JavaScriptObfuscatorCLI.ts index ca1ab65e..1d789a40 100644 --- a/src/cli/JavaScriptObfuscatorCLI.ts +++ b/src/cli/JavaScriptObfuscatorCLI.ts @@ -312,10 +312,6 @@ export class JavaScriptObfuscatorCLI implements IInitializable { `Values: ${CLIUtils.stringifyOptionAvailableValues(RenamePropertiesMode)}. ` + `Default: ${RenamePropertiesMode.Safe}` ) - .option( - '--rotate-string-array ', 'Enable rotation of string array values during obfuscation', - BooleanSanitizer - ) .option( '--seed ', 'Sets seed for random generator. This is useful for creating repeatable results.', @@ -326,10 +322,6 @@ export class JavaScriptObfuscatorCLI implements IInitializable { 'Disables self-defending for obfuscated code', BooleanSanitizer ) - .option( - '--shuffle-string-array ', 'Randomly shuffles string array items', - BooleanSanitizer - ) .option( '--simplify ', 'Enables additional code obfuscation through simplification', BooleanSanitizer @@ -393,6 +385,14 @@ export class JavaScriptObfuscatorCLI implements IInitializable { 'Enables additional index shift for all string array calls', BooleanSanitizer ) + .option( + '--string-array-rotate ', 'Enable rotation of string array values during obfuscation', + BooleanSanitizer + ) + .option( + '--string-array-shuffle ', 'Randomly shuffles string array items', + BooleanSanitizer + ) .option( '--string-array-wrappers-count ', 'Sets the count of wrappers for the string array inside each root or function scope', diff --git a/src/interfaces/options/IOptions.ts b/src/interfaces/options/IOptions.ts index bdc34f26..fdec2b61 100644 --- a/src/interfaces/options/IOptions.ts +++ b/src/interfaces/options/IOptions.ts @@ -37,10 +37,8 @@ export interface IOptions { readonly renamePropertiesMode: TRenamePropertiesMode; readonly reservedNames: string[]; readonly reservedStrings: string[]; - readonly rotateStringArray: boolean; readonly seed: string | number; readonly selfDefending: boolean; - readonly shuffleStringArray: boolean; readonly simplify: boolean; readonly sourceMap: boolean; readonly sourceMapBaseUrl: string; @@ -53,6 +51,8 @@ export interface IOptions { readonly stringArrayEncoding: TStringArrayEncoding[]; readonly stringArrayIndexesType: TStringArrayIndexesType[]; readonly stringArrayIndexShift: boolean; + readonly stringArrayRotate: boolean; + readonly stringArrayShuffle: boolean; readonly stringArrayWrappersChainedCalls: boolean; readonly stringArrayWrappersCount: number; readonly stringArrayWrappersParametersMaxCount: number; diff --git a/src/node-transformers/string-array-transformers/StringArrayRotateFunctionTransformer.ts b/src/node-transformers/string-array-transformers/StringArrayRotateFunctionTransformer.ts index 29785a5b..3df7f6be 100644 --- a/src/node-transformers/string-array-transformers/StringArrayRotateFunctionTransformer.ts +++ b/src/node-transformers/string-array-transformers/StringArrayRotateFunctionTransformer.ts @@ -136,7 +136,7 @@ export class StringArrayRotateFunctionTransformer extends AbstractNodeTransforme * @returns {IVisitor | null} */ public getVisitor (nodeTransformationStage: NodeTransformationStage): IVisitor | null { - if (!this.options.rotateStringArray) { + if (!this.options.stringArrayRotate) { return null; } diff --git a/src/node-transformers/string-array-transformers/StringArrayTransformer.ts b/src/node-transformers/string-array-transformers/StringArrayTransformer.ts index 747791f4..5bd33e10 100644 --- a/src/node-transformers/string-array-transformers/StringArrayTransformer.ts +++ b/src/node-transformers/string-array-transformers/StringArrayTransformer.ts @@ -162,11 +162,11 @@ export class StringArrayTransformer extends AbstractNodeTransformer { this.stringArrayStorageAnalyzer.analyze(programNode); } - if (this.options.shuffleStringArray) { + if (this.options.stringArrayShuffle) { this.stringArrayStorage.shuffleStorage(); } - if (this.options.rotateStringArray) { + if (this.options.stringArrayRotate) { this.stringArrayStorage.rotateStorage(); } } diff --git a/src/options/Options.ts b/src/options/Options.ts index 6e989582..0a59a6e1 100644 --- a/src/options/Options.ts +++ b/src/options/Options.ts @@ -260,24 +260,12 @@ export class Options implements IOptions { }) public readonly reservedStrings!: string[]; - /** - * @type {boolean} - */ - @IsBoolean() - public readonly rotateStringArray!: boolean; - /** * @type {boolean} */ @IsBoolean() public readonly selfDefending!: boolean; - /** - * @type {boolean} - */ - @IsBoolean() - public readonly shuffleStringArray!: boolean; - /** * @type {boolean} */ @@ -363,6 +351,18 @@ export class Options implements IOptions { @IsBoolean() public readonly stringArrayIndexShift!: boolean; + /** + * @type {boolean} + */ + @IsBoolean() + public readonly stringArrayRotate!: boolean; + + /** + * @type {boolean} + */ + @IsBoolean() + public readonly stringArrayShuffle!: boolean; + /** * @type {boolean} */ diff --git a/src/options/normalizer-rules/StringArrayRule.ts b/src/options/normalizer-rules/StringArrayRule.ts index dd9ff051..280ab0e5 100644 --- a/src/options/normalizer-rules/StringArrayRule.ts +++ b/src/options/normalizer-rules/StringArrayRule.ts @@ -12,13 +12,13 @@ export const StringArrayRule: TOptionsNormalizerRule = (options: IOptions): IOpt if (!options.stringArray) { options = { ...options, - rotateStringArray: false, - shuffleStringArray: false, stringArray: false, stringArrayEncoding: [ StringArrayEncoding.None ], stringArrayIndexShift: false, + stringArrayRotate: false, + stringArrayShuffle: false, stringArrayWrappersChainedCalls: false, stringArrayWrappersCount: 0, stringArrayThreshold: 0 diff --git a/src/options/presets/Default.ts b/src/options/presets/Default.ts index 80d99608..c5c193dc 100644 --- a/src/options/presets/Default.ts +++ b/src/options/presets/Default.ts @@ -38,10 +38,10 @@ export const DEFAULT_PRESET: TInputOptions = Object.freeze({ renamePropertiesMode: RenamePropertiesMode.Safe, reservedNames: [], reservedStrings: [], - rotateStringArray: true, + stringArrayRotate: true, seed: 0, selfDefending: false, - shuffleStringArray: true, + stringArrayShuffle: true, simplify: true, sourceMap: false, sourceMapBaseUrl: '', diff --git a/src/options/presets/LowObfuscation.ts b/src/options/presets/LowObfuscation.ts index 8f95cf3f..d144739a 100644 --- a/src/options/presets/LowObfuscation.ts +++ b/src/options/presets/LowObfuscation.ts @@ -8,8 +8,8 @@ export const LOW_OBFUSCATION_PRESET: TInputOptions = Object.freeze({ ...DEFAULT_PRESET, disableConsoleOutput: true, optionsPreset: OptionsPreset.LowObfuscation, - rotateStringArray: true, + stringArrayRotate: true, selfDefending: true, - shuffleStringArray: true, + stringArrayShuffle: true, simplify: true }); diff --git a/src/options/presets/NoCustomNodes.ts b/src/options/presets/NoCustomNodes.ts index f54209e7..e808f8be 100644 --- a/src/options/presets/NoCustomNodes.ts +++ b/src/options/presets/NoCustomNodes.ts @@ -34,10 +34,10 @@ export const NO_ADDITIONAL_NODES_PRESET: TInputOptions = Object.freeze({ renamePropertiesMode: RenamePropertiesMode.Safe, reservedNames: [], reservedStrings: [], - rotateStringArray: false, + stringArrayRotate: false, seed: 0, selfDefending: false, - shuffleStringArray: false, + stringArrayShuffle: false, simplify: false, sourceMap: false, sourceMapBaseUrl: '', diff --git a/src/storages/string-array-transformers/StringArrayStorage.ts b/src/storages/string-array-transformers/StringArrayStorage.ts index b34c0c29..7d91579b 100644 --- a/src/storages/string-array-transformers/StringArrayStorage.ts +++ b/src/storages/string-array-transformers/StringArrayStorage.ts @@ -139,7 +139,7 @@ export class StringArrayStorage extends MapStorage <`${string}-${TStringArrayEnc StringArrayStorage.maximumIndexShiftAmount ) : 0; - this.rotationAmount = this.options.rotateStringArray + this.rotationAmount = this.options.stringArrayRotate ? this.randomGenerator.getRandomInteger( StringArrayStorage.minimumRotationAmount, StringArrayStorage.maximumRotationAmount diff --git a/test/functional-tests/custom-code-helpers/string-array/StringArrayRotateFunctionCodeHelper.spec.ts b/test/functional-tests/custom-code-helpers/string-array/StringArrayRotateFunctionCodeHelper.spec.ts index b4858421..7c4443ed 100644 --- a/test/functional-tests/custom-code-helpers/string-array/StringArrayRotateFunctionCodeHelper.spec.ts +++ b/test/functional-tests/custom-code-helpers/string-array/StringArrayRotateFunctionCodeHelper.spec.ts @@ -22,7 +22,7 @@ describe('StringArrayRotateFunctionCodeHelper', () => { code, { ...NO_ADDITIONAL_NODES_PRESET, - rotateStringArray: true, + stringArrayRotate: true, stringArray: true, stringArrayThreshold: 1 } @@ -44,7 +44,7 @@ describe('StringArrayRotateFunctionCodeHelper', () => { code, { ...NO_ADDITIONAL_NODES_PRESET, - rotateStringArray: false, + stringArrayRotate: false, stringArray: true, stringArrayThreshold: 1 } @@ -70,7 +70,7 @@ describe('StringArrayRotateFunctionCodeHelper', () => { code, { ...NO_ADDITIONAL_NODES_PRESET, - rotateStringArray: true, + stringArrayRotate: true, stringArray: true, stringArrayThreshold: 1 } @@ -97,7 +97,7 @@ describe('StringArrayRotateFunctionCodeHelper', () => { { ...NO_ADDITIONAL_NODES_PRESET, identifierNamesGenerator: IdentifierNamesGenerator.MangledIdentifierNamesGenerator, - rotateStringArray: true, + stringArrayRotate: true, stringArray: true, stringArrayThreshold: 1 } diff --git a/test/functional-tests/custom-code-helpers/string-array/templates/string-array-rotate-function-template/StringArrayRotateFunctionTemplate.spec.ts b/test/functional-tests/custom-code-helpers/string-array/templates/string-array-rotate-function-template/StringArrayRotateFunctionTemplate.spec.ts index 83b795db..7e1c59f7 100644 --- a/test/functional-tests/custom-code-helpers/string-array/templates/string-array-rotate-function-template/StringArrayRotateFunctionTemplate.spec.ts +++ b/test/functional-tests/custom-code-helpers/string-array/templates/string-array-rotate-function-template/StringArrayRotateFunctionTemplate.spec.ts @@ -25,7 +25,7 @@ describe('StringArrayRotateFunctionTemplate', () => { ...NO_ADDITIONAL_NODES_PRESET, stringArray: true, stringArrayThreshold: 1, - rotateStringArray: true + stringArrayRotate: true } ); @@ -55,7 +55,7 @@ describe('StringArrayRotateFunctionTemplate', () => { ...NO_ADDITIONAL_NODES_PRESET, stringArray: true, stringArrayThreshold: 1, - rotateStringArray: true + stringArrayRotate: true } ); @@ -85,7 +85,7 @@ describe('StringArrayRotateFunctionTemplate', () => { ...NO_ADDITIONAL_NODES_PRESET, stringArray: true, stringArrayThreshold: 1, - rotateStringArray: true + stringArrayRotate: true } ); @@ -113,7 +113,7 @@ describe('StringArrayRotateFunctionTemplate', () => { ...NO_ADDITIONAL_NODES_PRESET, stringArray: true, stringArrayThreshold: 1, - rotateStringArray: true + stringArrayRotate: true } ); @@ -141,7 +141,7 @@ describe('StringArrayRotateFunctionTemplate', () => { ...NO_ADDITIONAL_NODES_PRESET, stringArray: true, stringArrayThreshold: 1, - rotateStringArray: true + stringArrayRotate: true } ); diff --git a/test/functional-tests/javascript-obfuscator/JavaScriptObfuscator.spec.ts b/test/functional-tests/javascript-obfuscator/JavaScriptObfuscator.spec.ts index 9e7573cf..99481fd5 100644 --- a/test/functional-tests/javascript-obfuscator/JavaScriptObfuscator.spec.ts +++ b/test/functional-tests/javascript-obfuscator/JavaScriptObfuscator.spec.ts @@ -1272,7 +1272,7 @@ describe('JavaScriptObfuscator', () => { numbersToExpressions: true, simplify: true, renameProperties: true, - rotateStringArray: true, + stringArrayRotate: true, stringArray: true, stringArrayEncoding: [ StringArrayEncoding.Base64, @@ -1406,7 +1406,7 @@ describe('JavaScriptObfuscator', () => { debugProtection: true, debugProtectionInterval: true, disableConsoleOutput: false, - rotateStringArray: true, + stringArrayRotate: true, selfDefending: true, stringArray: true, stringArrayThreshold: 1, diff --git a/test/functional-tests/node-transformers/string-array-transformers/string-array-rotate-function-transformer/StringArrayRotateFunctionTransformer.spec.ts b/test/functional-tests/node-transformers/string-array-transformers/string-array-rotate-function-transformer/StringArrayRotateFunctionTransformer.spec.ts index f2c6a71b..1c26cd53 100644 --- a/test/functional-tests/node-transformers/string-array-transformers/string-array-rotate-function-transformer/StringArrayRotateFunctionTransformer.spec.ts +++ b/test/functional-tests/node-transformers/string-array-transformers/string-array-rotate-function-transformer/StringArrayRotateFunctionTransformer.spec.ts @@ -31,7 +31,7 @@ describe('StringArrayRotateFunctionTransformer', function () { code, { ...NO_ADDITIONAL_NODES_PRESET, - rotateStringArray: true, + stringArrayRotate: true, stringArray: true, stringArrayThreshold: 1 } @@ -53,7 +53,7 @@ describe('StringArrayRotateFunctionTransformer', function () { code, { ...NO_ADDITIONAL_NODES_PRESET, - rotateStringArray: false, + stringArrayRotate: false, stringArray: true, stringArrayThreshold: 1 } @@ -75,7 +75,7 @@ describe('StringArrayRotateFunctionTransformer', function () { code, { ...NO_ADDITIONAL_NODES_PRESET, - rotateStringArray: true, + stringArrayRotate: true, stringArray: true, stringArrayThreshold: 0.00001 } @@ -97,7 +97,7 @@ describe('StringArrayRotateFunctionTransformer', function () { code, { ...NO_ADDITIONAL_NODES_PRESET, - rotateStringArray: true, + stringArrayRotate: true, stringArray: true, stringArrayThreshold: 0 } @@ -119,7 +119,7 @@ describe('StringArrayRotateFunctionTransformer', function () { code, { ...NO_ADDITIONAL_NODES_PRESET, - rotateStringArray: true, + stringArrayRotate: true, stringArray: true, stringArrayThreshold: 1 } @@ -155,7 +155,7 @@ describe('StringArrayRotateFunctionTransformer', function () { numbersToExpressions: true, simplify: true, renameProperties: true, - rotateStringArray: true, + stringArrayRotate: true, selfDefending: true, splitStrings: true, splitStringsChunkLength: 3, @@ -227,8 +227,8 @@ describe('StringArrayRotateFunctionTransformer', function () { code, { seed: i, - rotateStringArray: true, - shuffleStringArray: true, + stringArrayRotate: true, + stringArrayShuffle: true, stringArray: true, stringArrayThreshold: 1 } diff --git a/test/functional-tests/node-transformers/string-array-transformers/string-array-transformer/StringArrayTransformer.spec.ts b/test/functional-tests/node-transformers/string-array-transformers/string-array-transformer/StringArrayTransformer.spec.ts index 7c2764ca..8646325a 100644 --- a/test/functional-tests/node-transformers/string-array-transformers/string-array-transformer/StringArrayTransformer.spec.ts +++ b/test/functional-tests/node-transformers/string-array-transformers/string-array-transformer/StringArrayTransformer.spec.ts @@ -233,7 +233,7 @@ describe('StringArrayTransformer', function () { }); }); - describe('Variant #2: `rotateStringArray` option is enabled', () => { + describe('Variant #2: `stringArrayRotate` option is enabled', () => { before(() => { const code: string = readFileAsString(__dirname + '/fixtures/string-array-index-shift.js'); @@ -244,7 +244,7 @@ describe('StringArrayTransformer', function () { stringArray: true, stringArrayThreshold: 1, stringArrayIndexShift: true, - rotateStringArray: true + stringArrayRotate: true } ).getObfuscatedCode(); @@ -265,7 +265,7 @@ describe('StringArrayTransformer', function () { }); }); - describe('Variant #3: `shuffleStringArray` option is enabled', () => { + describe('Variant #3: `stringArrayShuffle` option is enabled', () => { before(() => { const code: string = readFileAsString(__dirname + '/fixtures/string-array-index-shift.js'); @@ -276,7 +276,7 @@ describe('StringArrayTransformer', function () { stringArray: true, stringArrayThreshold: 1, stringArrayIndexShift: true, - shuffleStringArray: true + stringArrayShuffle: true } ).getObfuscatedCode(); @@ -328,8 +328,8 @@ describe('StringArrayTransformer', function () { code, { ...NO_ADDITIONAL_NODES_PRESET, - rotateStringArray: true, - shuffleStringArray: true, + stringArrayRotate: true, + stringArrayShuffle: true, stringArray: true, stringArrayEncoding: [ StringArrayEncoding.Rc4 diff --git a/test/functional-tests/options/OptionsNormalizer.spec.ts b/test/functional-tests/options/OptionsNormalizer.spec.ts index de6d72c2..5ace148b 100644 --- a/test/functional-tests/options/OptionsNormalizer.spec.ts +++ b/test/functional-tests/options/OptionsNormalizer.spec.ts @@ -739,26 +739,26 @@ describe('OptionsNormalizer', () => { before(() => { optionsPreset = getNormalizedOptions({ ...getDefaultOptions(), - shuffleStringArray: true, stringArray: false, stringArrayEncoding: [StringArrayEncoding.Rc4], stringArrayIndexShift: true, + stringArrayRotate: true, + stringArrayShuffle: true, stringArrayWrappersChainedCalls: true, stringArrayWrappersCount: 5, - stringArrayThreshold: 0.5, - rotateStringArray: true + stringArrayThreshold: 0.5 }); expectedOptionsPreset = { ...getDefaultOptions(), - shuffleStringArray: false, stringArray: false, stringArrayEncoding: [StringArrayEncoding.None], stringArrayIndexShift: false, + stringArrayRotate: false, + stringArrayShuffle: false, stringArrayWrappersChainedCalls: false, stringArrayWrappersCount: 0, - stringArrayThreshold: 0, - rotateStringArray: false + stringArrayThreshold: 0 }; }); diff --git a/test/functional-tests/storages/string-array-transformers/string-array-storage/StringArrayStorage.spec.ts b/test/functional-tests/storages/string-array-transformers/string-array-storage/StringArrayStorage.spec.ts index 72714c4a..4ac2960a 100644 --- a/test/functional-tests/storages/string-array-transformers/string-array-storage/StringArrayStorage.spec.ts +++ b/test/functional-tests/storages/string-array-transformers/string-array-storage/StringArrayStorage.spec.ts @@ -33,7 +33,7 @@ describe('StringArrayStorage', () => { code, { ...NO_ADDITIONAL_NODES_PRESET, - rotateStringArray: true, + stringArrayRotate: true, stringArray: true, stringArrayThreshold: 1 } @@ -100,7 +100,7 @@ describe('StringArrayStorage', () => { code, { ...NO_ADDITIONAL_NODES_PRESET, - rotateStringArray: true, + stringArrayRotate: true, stringArray: true, stringArrayThreshold: 1 } @@ -173,7 +173,7 @@ describe('StringArrayStorage', () => { code, { ...NO_ADDITIONAL_NODES_PRESET, - shuffleStringArray: true, + stringArrayShuffle: true, stringArray: true, stringArrayThreshold: 1 } @@ -268,7 +268,7 @@ describe('StringArrayStorage', () => { code, { ...NO_ADDITIONAL_NODES_PRESET, - shuffleStringArray: true, + stringArrayShuffle: true, stringArray: true, stringArrayThreshold: 1 } diff --git a/test/performance-tests/JavaScriptObfuscatorMemory.spec.ts b/test/performance-tests/JavaScriptObfuscatorMemory.spec.ts index 0859948e..87cb2634 100644 --- a/test/performance-tests/JavaScriptObfuscatorMemory.spec.ts +++ b/test/performance-tests/JavaScriptObfuscatorMemory.spec.ts @@ -37,9 +37,9 @@ describe('JavaScriptObfuscator memory', function () { identifierNamesGenerator: 'mangled', log: false, renameGlobals: false, - rotateStringArray: true, + stringArrayRotate: true, selfDefending: true, - shuffleStringArray: true, + stringArrayShuffle: true, splitStrings: true, splitStringsChunkLength: 2, stringArray: true, diff --git a/test/runtime-tests/JavaScriptObfuscatorRuntime.spec.ts b/test/runtime-tests/JavaScriptObfuscatorRuntime.spec.ts index 1f49ae5c..120aa484 100644 --- a/test/runtime-tests/JavaScriptObfuscatorRuntime.spec.ts +++ b/test/runtime-tests/JavaScriptObfuscatorRuntime.spec.ts @@ -33,7 +33,7 @@ describe('JavaScriptObfuscator runtime eval', function () { simplify: true, renameProperties: true, renamePropertiesMode: RenamePropertiesMode.Unsafe, - rotateStringArray: true, + stringArrayRotate: true, selfDefending: true, splitStrings: true, splitStringsChunkLength: 3,