sanex 3 роки тому
батько
коміт
ec1c90a27f
21 змінених файлів з 102 додано та 99 видалено
  1. 3 0
      CHANGELOG.md
  2. 27 27
      README.md
  3. 8 8
      src/cli/JavaScriptObfuscatorCLI.ts
  4. 2 2
      src/interfaces/options/IOptions.ts
  5. 1 1
      src/node-transformers/string-array-transformers/StringArrayRotateFunctionTransformer.ts
  6. 2 2
      src/node-transformers/string-array-transformers/StringArrayTransformer.ts
  7. 12 12
      src/options/Options.ts
  8. 2 2
      src/options/normalizer-rules/StringArrayRule.ts
  9. 2 2
      src/options/presets/Default.ts
  10. 2 2
      src/options/presets/LowObfuscation.ts
  11. 2 2
      src/options/presets/NoCustomNodes.ts
  12. 1 1
      src/storages/string-array-transformers/StringArrayStorage.ts
  13. 4 4
      test/functional-tests/custom-code-helpers/string-array/StringArrayRotateFunctionCodeHelper.spec.ts
  14. 5 5
      test/functional-tests/custom-code-helpers/string-array/templates/string-array-rotate-function-template/StringArrayRotateFunctionTemplate.spec.ts
  15. 2 2
      test/functional-tests/javascript-obfuscator/JavaScriptObfuscator.spec.ts
  16. 8 8
      test/functional-tests/node-transformers/string-array-transformers/string-array-rotate-function-transformer/StringArrayRotateFunctionTransformer.spec.ts
  17. 6 6
      test/functional-tests/node-transformers/string-array-transformers/string-array-transformer/StringArrayTransformer.spec.ts
  18. 6 6
      test/functional-tests/options/OptionsNormalizer.spec.ts
  19. 4 4
      test/functional-tests/storages/string-array-transformers/string-array-storage/StringArrayStorage.spec.ts
  20. 2 2
      test/performance-tests/JavaScriptObfuscatorMemory.spec.ts
  21. 1 1
      test/runtime-tests/JavaScriptObfuscatorRuntime.spec.ts

+ 3 - 0
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
 ---

+ 27 - 27
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 <string> [safe, unsafe]
     --reserved-names '<list>' (comma separated)
     --reserved-strings '<list>' (comma separated)
-    --rotate-string-array <boolean>
     --seed <string|number>
     --self-defending <boolean>
-    --shuffle-string-array <boolean>
     --simplify <boolean>
     --source-map <boolean>
     --source-map-base-url <string>
@@ -446,6 +444,8 @@ Following options are available for the JS Obfuscator:
     --string-array-indexes-type '<list>' (comma separated) [hexadecimal-number, hexadecimal-numeric-string]
     --string-array-encoding '<list>' (comma separated) [none, base64, rc4]
     --string-array-index-shift <boolean>
+    --string-array-rotate <boolean>
+    --string-array-shuffle <boolean>
     --string-array-wrappers-count <number>
     --string-array-wrappers-chained-calls <boolean>
     --string-array-wrappers-parameters-max-count <number>
@@ -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,

+ 8 - 8
src/cli/JavaScriptObfuscatorCLI.ts

@@ -312,10 +312,6 @@ export class JavaScriptObfuscatorCLI implements IInitializable {
                 `Values: ${CLIUtils.stringifyOptionAvailableValues(RenamePropertiesMode)}. ` +
                 `Default: ${RenamePropertiesMode.Safe}`
             )
-            .option(
-                '--rotate-string-array <boolean>', 'Enable rotation of string array values during obfuscation',
-                BooleanSanitizer
-            )
             .option(
                 '--seed <string|number>',
                 '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 <boolean>', 'Randomly shuffles string array items',
-                BooleanSanitizer
-            )
             .option(
                 '--simplify <boolean>', '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 <boolean>', 'Enable rotation of string array values during obfuscation',
+                BooleanSanitizer
+            )
+            .option(
+                '--string-array-shuffle <boolean>', 'Randomly shuffles string array items',
+                BooleanSanitizer
+            )
             .option(
                 '--string-array-wrappers-count <number>',
                 'Sets the count of wrappers for the string array inside each root or function scope',

+ 2 - 2
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;

+ 1 - 1
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;
         }
 

+ 2 - 2
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();
         }
     }

+ 12 - 12
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}
      */

+ 2 - 2
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

+ 2 - 2
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: '',

+ 2 - 2
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
 });

+ 2 - 2
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: '',

+ 1 - 1
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

+ 4 - 4
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
                 }

+ 5 - 5
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
                     }
                 );
 

+ 2 - 2
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,

+ 8 - 8
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
                         }

+ 6 - 6
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

+ 6 - 6
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
                 };
             });
 

+ 4 - 4
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
                         }

+ 2 - 2
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,

+ 1 - 1
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,