浏览代码

Renamed options

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
 v3.0.0
 ---
 ---
 * **Breaking change:** `ignoreRequireImports` option renamed to `ignoreImports`
 * **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
 v2.19.1
 ---
 ---

+ 27 - 27
README.md

@@ -112,7 +112,7 @@ var obfuscationResult = JavaScriptObfuscator.obfuscate(
         controlFlowFlatteningThreshold: 1,
         controlFlowFlatteningThreshold: 1,
         numbersToExpressions: true,
         numbersToExpressions: true,
         simplify: true,
         simplify: true,
-        shuffleStringArray: true,
+        stringArrayShuffle: true,
         splitStrings: true,
         splitStrings: true,
         stringArrayThreshold: 1
         stringArrayThreshold: 1
     }
     }
@@ -368,10 +368,8 @@ Following options are available for the JS Obfuscator:
     renamePropertiesMode: 'safe',
     renamePropertiesMode: 'safe',
     reservedNames: [],
     reservedNames: [],
     reservedStrings: [],
     reservedStrings: [],
-    rotateStringArray: true,
     seed: 0,
     seed: 0,
     selfDefending: false,
     selfDefending: false,
-    shuffleStringArray: true,
     simplify: true,
     simplify: true,
     sourceMap: false,
     sourceMap: false,
     sourceMapBaseUrl: '',
     sourceMapBaseUrl: '',
@@ -386,6 +384,8 @@ Following options are available for the JS Obfuscator:
     ],
     ],
     stringArrayEncoding: [],
     stringArrayEncoding: [],
     stringArrayIndexShift: true,
     stringArrayIndexShift: true,
+    stringArrayRotate: true,
+    stringArrayShuffle: true,
     stringArrayWrappersCount: 1,
     stringArrayWrappersCount: 1,
     stringArrayWrappersChainedCalls: true,
     stringArrayWrappersChainedCalls: true,
     stringArrayWrappersParametersMaxCount: 2,
     stringArrayWrappersParametersMaxCount: 2,
@@ -430,10 +430,8 @@ Following options are available for the JS Obfuscator:
     --rename-properties-mode <string> [safe, unsafe]
     --rename-properties-mode <string> [safe, unsafe]
     --reserved-names '<list>' (comma separated)
     --reserved-names '<list>' (comma separated)
     --reserved-strings '<list>' (comma separated)
     --reserved-strings '<list>' (comma separated)
-    --rotate-string-array <boolean>
     --seed <string|number>
     --seed <string|number>
     --self-defending <boolean>
     --self-defending <boolean>
-    --shuffle-string-array <boolean>
     --simplify <boolean>
     --simplify <boolean>
     --source-map <boolean>
     --source-map <boolean>
     --source-map-base-url <string>
     --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-indexes-type '<list>' (comma separated) [hexadecimal-number, hexadecimal-numeric-string]
     --string-array-encoding '<list>' (comma separated) [none, base64, rc4]
     --string-array-encoding '<list>' (comma separated) [none, base64, rc4]
     --string-array-index-shift <boolean>
     --string-array-index-shift <boolean>
+    --string-array-rotate <boolean>
+    --string-array-shuffle <boolean>
     --string-array-wrappers-count <number>
     --string-array-wrappers-count <number>
     --string-array-wrappers-chained-calls <boolean>
     --string-array-wrappers-chained-calls <boolean>
     --string-array-wrappers-parameters-max-count <number>
     --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`
 ### `seed`
 Type: `string|number` Default: `0`
 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.
 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`
 ### `simplify`
 Type: `boolean` Default: `true`
 Type: `boolean` Default: `true`
 
 
@@ -1163,6 +1149,20 @@ Type: `boolean` Default: `true`
 
 
 Enables additional index shift for all string array calls
 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`
 ### `stringArrayWrappersCount`
 Type: `number` Default: `1`
 Type: `number` Default: `1`
 
 
@@ -1435,15 +1435,15 @@ Performance will 50-100% slower than without obfuscation
     log: false,
     log: false,
     numbersToExpressions: true,
     numbersToExpressions: true,
     renameGlobals: false,
     renameGlobals: false,
-    rotateStringArray: true,
     selfDefending: true,
     selfDefending: true,
-    shuffleStringArray: true,
     simplify: true,
     simplify: true,
     splitStrings: true,
     splitStrings: true,
     splitStringsChunkLength: 5,
     splitStringsChunkLength: 5,
     stringArray: true,
     stringArray: true,
     stringArrayEncoding: ['rc4'],
     stringArrayEncoding: ['rc4'],
     stringArrayIndexShift: true,
     stringArrayIndexShift: true,
+    stringArrayRotate: true,
+    stringArrayShuffle: true,
     stringArrayWrappersCount: 5,
     stringArrayWrappersCount: 5,
     stringArrayWrappersChainedCalls: true,    
     stringArrayWrappersChainedCalls: true,    
     stringArrayWrappersParametersMaxCount: 5,
     stringArrayWrappersParametersMaxCount: 5,
@@ -1472,15 +1472,15 @@ Performance will 30-35% slower than without obfuscation
     log: false,
     log: false,
     numbersToExpressions: true,
     numbersToExpressions: true,
     renameGlobals: false,
     renameGlobals: false,
-    rotateStringArray: true,
     selfDefending: true,
     selfDefending: true,
-    shuffleStringArray: true,
     simplify: true,
     simplify: true,
     splitStrings: true,
     splitStrings: true,
     splitStringsChunkLength: 10,
     splitStringsChunkLength: 10,
     stringArray: true,
     stringArray: true,
     stringArrayEncoding: ['base64'],
     stringArrayEncoding: ['base64'],
     stringArrayIndexShift: true,
     stringArrayIndexShift: true,
+    stringArrayRotate: true,
+    stringArrayShuffle: true,
     stringArrayWrappersCount: 2,
     stringArrayWrappersCount: 2,
     stringArrayWrappersChainedCalls: true,
     stringArrayWrappersChainedCalls: true,
     stringArrayWrappersParametersMaxCount: 4,
     stringArrayWrappersParametersMaxCount: 4,
@@ -1507,14 +1507,14 @@ Performance will slightly slower than without obfuscation
     log: false,
     log: false,
     numbersToExpressions: false,
     numbersToExpressions: false,
     renameGlobals: false,
     renameGlobals: false,
-    rotateStringArray: true,
     selfDefending: true,
     selfDefending: true,
-    shuffleStringArray: true,
     simplify: true,
     simplify: true,
     splitStrings: false,
     splitStrings: false,
     stringArray: true,
     stringArray: true,
     stringArrayEncoding: [],
     stringArrayEncoding: [],
     stringArrayIndexShift: true,
     stringArrayIndexShift: true,
+    stringArrayRotate: true,
+    stringArrayShuffle: true,
     stringArrayWrappersCount: 1,
     stringArrayWrappersCount: 1,
     stringArrayWrappersChainedCalls: true,
     stringArrayWrappersChainedCalls: true,
     stringArrayWrappersParametersMaxCount: 2,
     stringArrayWrappersParametersMaxCount: 2,
@@ -1538,14 +1538,14 @@ Performance will slightly slower than without obfuscation
     log: false,
     log: false,
     numbersToExpressions: false,
     numbersToExpressions: false,
     renameGlobals: false,
     renameGlobals: false,
-    rotateStringArray: true,
     selfDefending: false,
     selfDefending: false,
-    shuffleStringArray: true,
     simplify: true,
     simplify: true,
     splitStrings: false,
     splitStrings: false,
     stringArray: true,
     stringArray: true,
     stringArrayEncoding: [],
     stringArrayEncoding: [],
     stringArrayIndexShift: true,
     stringArrayIndexShift: true,
+    stringArrayRotate: true,
+    stringArrayShuffle: true,
     stringArrayWrappersCount: 1,
     stringArrayWrappersCount: 1,
     stringArrayWrappersChainedCalls: true,
     stringArrayWrappersChainedCalls: true,
     stringArrayWrappersParametersMaxCount: 2,
     stringArrayWrappersParametersMaxCount: 2,

+ 8 - 8
src/cli/JavaScriptObfuscatorCLI.ts

@@ -312,10 +312,6 @@ export class JavaScriptObfuscatorCLI implements IInitializable {
                 `Values: ${CLIUtils.stringifyOptionAvailableValues(RenamePropertiesMode)}. ` +
                 `Values: ${CLIUtils.stringifyOptionAvailableValues(RenamePropertiesMode)}. ` +
                 `Default: ${RenamePropertiesMode.Safe}`
                 `Default: ${RenamePropertiesMode.Safe}`
             )
             )
-            .option(
-                '--rotate-string-array <boolean>', 'Enable rotation of string array values during obfuscation',
-                BooleanSanitizer
-            )
             .option(
             .option(
                 '--seed <string|number>',
                 '--seed <string|number>',
                 'Sets seed for random generator. This is useful for creating repeatable results.',
                 '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',
                 'Disables self-defending for obfuscated code',
                 BooleanSanitizer
                 BooleanSanitizer
             )
             )
-            .option(
-                '--shuffle-string-array <boolean>', 'Randomly shuffles string array items',
-                BooleanSanitizer
-            )
             .option(
             .option(
                 '--simplify <boolean>', 'Enables additional code obfuscation through simplification',
                 '--simplify <boolean>', 'Enables additional code obfuscation through simplification',
                 BooleanSanitizer
                 BooleanSanitizer
@@ -393,6 +385,14 @@ export class JavaScriptObfuscatorCLI implements IInitializable {
                 'Enables additional index shift for all string array calls',
                 'Enables additional index shift for all string array calls',
                 BooleanSanitizer
                 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(
             .option(
                 '--string-array-wrappers-count <number>',
                 '--string-array-wrappers-count <number>',
                 'Sets the count of wrappers for the string array inside each root or function scope',
                 '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 renamePropertiesMode: TRenamePropertiesMode;
     readonly reservedNames: string[];
     readonly reservedNames: string[];
     readonly reservedStrings: string[];
     readonly reservedStrings: string[];
-    readonly rotateStringArray: boolean;
     readonly seed: string | number;
     readonly seed: string | number;
     readonly selfDefending: boolean;
     readonly selfDefending: boolean;
-    readonly shuffleStringArray: boolean;
     readonly simplify: boolean;
     readonly simplify: boolean;
     readonly sourceMap: boolean;
     readonly sourceMap: boolean;
     readonly sourceMapBaseUrl: string;
     readonly sourceMapBaseUrl: string;
@@ -53,6 +51,8 @@ export interface IOptions {
     readonly stringArrayEncoding: TStringArrayEncoding[];
     readonly stringArrayEncoding: TStringArrayEncoding[];
     readonly stringArrayIndexesType: TStringArrayIndexesType[];
     readonly stringArrayIndexesType: TStringArrayIndexesType[];
     readonly stringArrayIndexShift: boolean;
     readonly stringArrayIndexShift: boolean;
+    readonly stringArrayRotate: boolean;
+    readonly stringArrayShuffle: boolean;
     readonly stringArrayWrappersChainedCalls: boolean;
     readonly stringArrayWrappersChainedCalls: boolean;
     readonly stringArrayWrappersCount: number;
     readonly stringArrayWrappersCount: number;
     readonly stringArrayWrappersParametersMaxCount: 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}
      * @returns {IVisitor | null}
      */
      */
     public getVisitor (nodeTransformationStage: NodeTransformationStage): IVisitor | null {
     public getVisitor (nodeTransformationStage: NodeTransformationStage): IVisitor | null {
-        if (!this.options.rotateStringArray) {
+        if (!this.options.stringArrayRotate) {
             return null;
             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);
             this.stringArrayStorageAnalyzer.analyze(programNode);
         }
         }
 
 
-        if (this.options.shuffleStringArray) {
+        if (this.options.stringArrayShuffle) {
             this.stringArrayStorage.shuffleStorage();
             this.stringArrayStorage.shuffleStorage();
         }
         }
 
 
-        if (this.options.rotateStringArray) {
+        if (this.options.stringArrayRotate) {
             this.stringArrayStorage.rotateStorage();
             this.stringArrayStorage.rotateStorage();
         }
         }
     }
     }

+ 12 - 12
src/options/Options.ts

@@ -260,24 +260,12 @@ export class Options implements IOptions {
     })
     })
     public readonly reservedStrings!: string[];
     public readonly reservedStrings!: string[];
 
 
-    /**
-     * @type {boolean}
-     */
-    @IsBoolean()
-    public readonly rotateStringArray!: boolean;
-
     /**
     /**
      * @type {boolean}
      * @type {boolean}
      */
      */
     @IsBoolean()
     @IsBoolean()
     public readonly selfDefending!: boolean;
     public readonly selfDefending!: boolean;
 
 
-    /**
-     * @type {boolean}
-     */
-    @IsBoolean()
-    public readonly shuffleStringArray!: boolean;
-
     /**
     /**
      * @type {boolean}
      * @type {boolean}
      */
      */
@@ -363,6 +351,18 @@ export class Options implements IOptions {
     @IsBoolean()
     @IsBoolean()
     public readonly stringArrayIndexShift!: boolean;
     public readonly stringArrayIndexShift!: boolean;
 
 
+    /**
+     * @type {boolean}
+     */
+    @IsBoolean()
+    public readonly stringArrayRotate!: boolean;
+
+    /**
+     * @type {boolean}
+     */
+    @IsBoolean()
+    public readonly stringArrayShuffle!: boolean;
+
     /**
     /**
      * @type {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) {
     if (!options.stringArray) {
         options = {
         options = {
             ...options,
             ...options,
-            rotateStringArray: false,
-            shuffleStringArray: false,
             stringArray: false,
             stringArray: false,
             stringArrayEncoding: [
             stringArrayEncoding: [
                 StringArrayEncoding.None
                 StringArrayEncoding.None
             ],
             ],
             stringArrayIndexShift: false,
             stringArrayIndexShift: false,
+            stringArrayRotate: false,
+            stringArrayShuffle: false,
             stringArrayWrappersChainedCalls: false,
             stringArrayWrappersChainedCalls: false,
             stringArrayWrappersCount: 0,
             stringArrayWrappersCount: 0,
             stringArrayThreshold: 0
             stringArrayThreshold: 0

+ 2 - 2
src/options/presets/Default.ts

@@ -38,10 +38,10 @@ export const DEFAULT_PRESET: TInputOptions = Object.freeze({
     renamePropertiesMode: RenamePropertiesMode.Safe,
     renamePropertiesMode: RenamePropertiesMode.Safe,
     reservedNames: [],
     reservedNames: [],
     reservedStrings: [],
     reservedStrings: [],
-    rotateStringArray: true,
+    stringArrayRotate: true,
     seed: 0,
     seed: 0,
     selfDefending: false,
     selfDefending: false,
-    shuffleStringArray: true,
+    stringArrayShuffle: true,
     simplify: true,
     simplify: true,
     sourceMap: false,
     sourceMap: false,
     sourceMapBaseUrl: '',
     sourceMapBaseUrl: '',

+ 2 - 2
src/options/presets/LowObfuscation.ts

@@ -8,8 +8,8 @@ export const LOW_OBFUSCATION_PRESET: TInputOptions = Object.freeze({
     ...DEFAULT_PRESET,
     ...DEFAULT_PRESET,
     disableConsoleOutput: true,
     disableConsoleOutput: true,
     optionsPreset: OptionsPreset.LowObfuscation,
     optionsPreset: OptionsPreset.LowObfuscation,
-    rotateStringArray: true,
+    stringArrayRotate: true,
     selfDefending: true,
     selfDefending: true,
-    shuffleStringArray: true,
+    stringArrayShuffle: true,
     simplify: 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,
     renamePropertiesMode: RenamePropertiesMode.Safe,
     reservedNames: [],
     reservedNames: [],
     reservedStrings: [],
     reservedStrings: [],
-    rotateStringArray: false,
+    stringArrayRotate: false,
     seed: 0,
     seed: 0,
     selfDefending: false,
     selfDefending: false,
-    shuffleStringArray: false,
+    stringArrayShuffle: false,
     simplify: false,
     simplify: false,
     sourceMap: false,
     sourceMap: false,
     sourceMapBaseUrl: '',
     sourceMapBaseUrl: '',

+ 1 - 1
src/storages/string-array-transformers/StringArrayStorage.ts

@@ -139,7 +139,7 @@ export class StringArrayStorage extends MapStorage <`${string}-${TStringArrayEnc
                 StringArrayStorage.maximumIndexShiftAmount
                 StringArrayStorage.maximumIndexShiftAmount
             )
             )
             : 0;
             : 0;
-        this.rotationAmount = this.options.rotateStringArray
+        this.rotationAmount = this.options.stringArrayRotate
             ? this.randomGenerator.getRandomInteger(
             ? this.randomGenerator.getRandomInteger(
                 StringArrayStorage.minimumRotationAmount,
                 StringArrayStorage.minimumRotationAmount,
                 StringArrayStorage.maximumRotationAmount
                 StringArrayStorage.maximumRotationAmount

+ 4 - 4
test/functional-tests/custom-code-helpers/string-array/StringArrayRotateFunctionCodeHelper.spec.ts

@@ -22,7 +22,7 @@ describe('StringArrayRotateFunctionCodeHelper', () => {
                     code,
                     code,
                     {
                     {
                         ...NO_ADDITIONAL_NODES_PRESET,
                         ...NO_ADDITIONAL_NODES_PRESET,
-                        rotateStringArray: true,
+                        stringArrayRotate: true,
                         stringArray: true,
                         stringArray: true,
                         stringArrayThreshold: 1
                         stringArrayThreshold: 1
                     }
                     }
@@ -44,7 +44,7 @@ describe('StringArrayRotateFunctionCodeHelper', () => {
                     code,
                     code,
                     {
                     {
                         ...NO_ADDITIONAL_NODES_PRESET,
                         ...NO_ADDITIONAL_NODES_PRESET,
-                        rotateStringArray: false,
+                        stringArrayRotate: false,
                         stringArray: true,
                         stringArray: true,
                         stringArrayThreshold: 1
                         stringArrayThreshold: 1
                     }
                     }
@@ -70,7 +70,7 @@ describe('StringArrayRotateFunctionCodeHelper', () => {
                     code,
                     code,
                     {
                     {
                         ...NO_ADDITIONAL_NODES_PRESET,
                         ...NO_ADDITIONAL_NODES_PRESET,
-                        rotateStringArray: true,
+                        stringArrayRotate: true,
                         stringArray: true,
                         stringArray: true,
                         stringArrayThreshold: 1
                         stringArrayThreshold: 1
                     }
                     }
@@ -97,7 +97,7 @@ describe('StringArrayRotateFunctionCodeHelper', () => {
                 {
                 {
                     ...NO_ADDITIONAL_NODES_PRESET,
                     ...NO_ADDITIONAL_NODES_PRESET,
                     identifierNamesGenerator: IdentifierNamesGenerator.MangledIdentifierNamesGenerator,
                     identifierNamesGenerator: IdentifierNamesGenerator.MangledIdentifierNamesGenerator,
-                    rotateStringArray: true,
+                    stringArrayRotate: true,
                     stringArray: true,
                     stringArray: true,
                     stringArrayThreshold: 1
                     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,
                         ...NO_ADDITIONAL_NODES_PRESET,
                         stringArray: true,
                         stringArray: true,
                         stringArrayThreshold: 1,
                         stringArrayThreshold: 1,
-                        rotateStringArray: true
+                        stringArrayRotate: true
                     }
                     }
                 );
                 );
 
 
@@ -55,7 +55,7 @@ describe('StringArrayRotateFunctionTemplate', () => {
                         ...NO_ADDITIONAL_NODES_PRESET,
                         ...NO_ADDITIONAL_NODES_PRESET,
                         stringArray: true,
                         stringArray: true,
                         stringArrayThreshold: 1,
                         stringArrayThreshold: 1,
-                        rotateStringArray: true
+                        stringArrayRotate: true
                     }
                     }
                 );
                 );
 
 
@@ -85,7 +85,7 @@ describe('StringArrayRotateFunctionTemplate', () => {
                         ...NO_ADDITIONAL_NODES_PRESET,
                         ...NO_ADDITIONAL_NODES_PRESET,
                         stringArray: true,
                         stringArray: true,
                         stringArrayThreshold: 1,
                         stringArrayThreshold: 1,
-                        rotateStringArray: true
+                        stringArrayRotate: true
                     }
                     }
                 );
                 );
 
 
@@ -113,7 +113,7 @@ describe('StringArrayRotateFunctionTemplate', () => {
                         ...NO_ADDITIONAL_NODES_PRESET,
                         ...NO_ADDITIONAL_NODES_PRESET,
                         stringArray: true,
                         stringArray: true,
                         stringArrayThreshold: 1,
                         stringArrayThreshold: 1,
-                        rotateStringArray: true
+                        stringArrayRotate: true
                     }
                     }
                 );
                 );
 
 
@@ -141,7 +141,7 @@ describe('StringArrayRotateFunctionTemplate', () => {
                         ...NO_ADDITIONAL_NODES_PRESET,
                         ...NO_ADDITIONAL_NODES_PRESET,
                         stringArray: true,
                         stringArray: true,
                         stringArrayThreshold: 1,
                         stringArrayThreshold: 1,
-                        rotateStringArray: true
+                        stringArrayRotate: true
                     }
                     }
                 );
                 );
 
 

+ 2 - 2
test/functional-tests/javascript-obfuscator/JavaScriptObfuscator.spec.ts

@@ -1272,7 +1272,7 @@ describe('JavaScriptObfuscator', () => {
                         numbersToExpressions: true,
                         numbersToExpressions: true,
                         simplify: true,
                         simplify: true,
                         renameProperties: true,
                         renameProperties: true,
-                        rotateStringArray: true,
+                        stringArrayRotate: true,
                         stringArray: true,
                         stringArray: true,
                         stringArrayEncoding: [
                         stringArrayEncoding: [
                             StringArrayEncoding.Base64,
                             StringArrayEncoding.Base64,
@@ -1406,7 +1406,7 @@ describe('JavaScriptObfuscator', () => {
                 debugProtection: true,
                 debugProtection: true,
                 debugProtectionInterval: true,
                 debugProtectionInterval: true,
                 disableConsoleOutput: false,
                 disableConsoleOutput: false,
-                rotateStringArray: true,
+                stringArrayRotate: true,
                 selfDefending: true,
                 selfDefending: true,
                 stringArray: true,
                 stringArray: true,
                 stringArrayThreshold: 1,
                 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,
                     code,
                     {
                     {
                         ...NO_ADDITIONAL_NODES_PRESET,
                         ...NO_ADDITIONAL_NODES_PRESET,
-                        rotateStringArray: true,
+                        stringArrayRotate: true,
                         stringArray: true,
                         stringArray: true,
                         stringArrayThreshold: 1
                         stringArrayThreshold: 1
                     }
                     }
@@ -53,7 +53,7 @@ describe('StringArrayRotateFunctionTransformer', function () {
                     code,
                     code,
                     {
                     {
                         ...NO_ADDITIONAL_NODES_PRESET,
                         ...NO_ADDITIONAL_NODES_PRESET,
-                        rotateStringArray: false,
+                        stringArrayRotate: false,
                         stringArray: true,
                         stringArray: true,
                         stringArrayThreshold: 1
                         stringArrayThreshold: 1
                     }
                     }
@@ -75,7 +75,7 @@ describe('StringArrayRotateFunctionTransformer', function () {
                     code,
                     code,
                     {
                     {
                         ...NO_ADDITIONAL_NODES_PRESET,
                         ...NO_ADDITIONAL_NODES_PRESET,
-                        rotateStringArray: true,
+                        stringArrayRotate: true,
                         stringArray: true,
                         stringArray: true,
                         stringArrayThreshold: 0.00001
                         stringArrayThreshold: 0.00001
                     }
                     }
@@ -97,7 +97,7 @@ describe('StringArrayRotateFunctionTransformer', function () {
                     code,
                     code,
                     {
                     {
                         ...NO_ADDITIONAL_NODES_PRESET,
                         ...NO_ADDITIONAL_NODES_PRESET,
-                        rotateStringArray: true,
+                        stringArrayRotate: true,
                         stringArray: true,
                         stringArray: true,
                         stringArrayThreshold: 0
                         stringArrayThreshold: 0
                     }
                     }
@@ -119,7 +119,7 @@ describe('StringArrayRotateFunctionTransformer', function () {
                     code,
                     code,
                     {
                     {
                         ...NO_ADDITIONAL_NODES_PRESET,
                         ...NO_ADDITIONAL_NODES_PRESET,
-                        rotateStringArray: true,
+                        stringArrayRotate: true,
                         stringArray: true,
                         stringArray: true,
                         stringArrayThreshold: 1
                         stringArrayThreshold: 1
                     }
                     }
@@ -155,7 +155,7 @@ describe('StringArrayRotateFunctionTransformer', function () {
                             numbersToExpressions: true,
                             numbersToExpressions: true,
                             simplify: true,
                             simplify: true,
                             renameProperties: true,
                             renameProperties: true,
-                            rotateStringArray: true,
+                            stringArrayRotate: true,
                             selfDefending: true,
                             selfDefending: true,
                             splitStrings: true,
                             splitStrings: true,
                             splitStringsChunkLength: 3,
                             splitStringsChunkLength: 3,
@@ -227,8 +227,8 @@ describe('StringArrayRotateFunctionTransformer', function () {
                         code,
                         code,
                         {
                         {
                             seed: i,
                             seed: i,
-                            rotateStringArray: true,
-                            shuffleStringArray: true,
+                            stringArrayRotate: true,
+                            stringArrayShuffle: true,
                             stringArray: true,
                             stringArray: true,
                             stringArrayThreshold: 1
                             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(() => {
             before(() => {
                 const code: string = readFileAsString(__dirname + '/fixtures/string-array-index-shift.js');
                 const code: string = readFileAsString(__dirname + '/fixtures/string-array-index-shift.js');
 
 
@@ -244,7 +244,7 @@ describe('StringArrayTransformer', function () {
                         stringArray: true,
                         stringArray: true,
                         stringArrayThreshold: 1,
                         stringArrayThreshold: 1,
                         stringArrayIndexShift: true,
                         stringArrayIndexShift: true,
-                        rotateStringArray: true
+                        stringArrayRotate: true
                     }
                     }
                 ).getObfuscatedCode();
                 ).getObfuscatedCode();
 
 
@@ -265,7 +265,7 @@ describe('StringArrayTransformer', function () {
             });
             });
         });
         });
 
 
-        describe('Variant #3: `shuffleStringArray` option is enabled', () => {
+        describe('Variant #3: `stringArrayShuffle` option is enabled', () => {
             before(() => {
             before(() => {
                 const code: string = readFileAsString(__dirname + '/fixtures/string-array-index-shift.js');
                 const code: string = readFileAsString(__dirname + '/fixtures/string-array-index-shift.js');
 
 
@@ -276,7 +276,7 @@ describe('StringArrayTransformer', function () {
                         stringArray: true,
                         stringArray: true,
                         stringArrayThreshold: 1,
                         stringArrayThreshold: 1,
                         stringArrayIndexShift: true,
                         stringArrayIndexShift: true,
-                        shuffleStringArray: true
+                        stringArrayShuffle: true
                     }
                     }
                 ).getObfuscatedCode();
                 ).getObfuscatedCode();
 
 
@@ -328,8 +328,8 @@ describe('StringArrayTransformer', function () {
                     code,
                     code,
                     {
                     {
                         ...NO_ADDITIONAL_NODES_PRESET,
                         ...NO_ADDITIONAL_NODES_PRESET,
-                        rotateStringArray: true,
-                        shuffleStringArray: true,
+                        stringArrayRotate: true,
+                        stringArrayShuffle: true,
                         stringArray: true,
                         stringArray: true,
                         stringArrayEncoding: [
                         stringArrayEncoding: [
                             StringArrayEncoding.Rc4
                             StringArrayEncoding.Rc4

+ 6 - 6
test/functional-tests/options/OptionsNormalizer.spec.ts

@@ -739,26 +739,26 @@ describe('OptionsNormalizer', () => {
             before(() => {
             before(() => {
                 optionsPreset = getNormalizedOptions({
                 optionsPreset = getNormalizedOptions({
                     ...getDefaultOptions(),
                     ...getDefaultOptions(),
-                    shuffleStringArray: true,
                     stringArray: false,
                     stringArray: false,
                     stringArrayEncoding: [StringArrayEncoding.Rc4],
                     stringArrayEncoding: [StringArrayEncoding.Rc4],
                     stringArrayIndexShift: true,
                     stringArrayIndexShift: true,
+                    stringArrayRotate: true,
+                    stringArrayShuffle: true,
                     stringArrayWrappersChainedCalls: true,
                     stringArrayWrappersChainedCalls: true,
                     stringArrayWrappersCount: 5,
                     stringArrayWrappersCount: 5,
-                    stringArrayThreshold: 0.5,
-                    rotateStringArray: true
+                    stringArrayThreshold: 0.5
                 });
                 });
 
 
                 expectedOptionsPreset = {
                 expectedOptionsPreset = {
                     ...getDefaultOptions(),
                     ...getDefaultOptions(),
-                    shuffleStringArray: false,
                     stringArray: false,
                     stringArray: false,
                     stringArrayEncoding: [StringArrayEncoding.None],
                     stringArrayEncoding: [StringArrayEncoding.None],
                     stringArrayIndexShift: false,
                     stringArrayIndexShift: false,
+                    stringArrayRotate: false,
+                    stringArrayShuffle: false,
                     stringArrayWrappersChainedCalls: false,
                     stringArrayWrappersChainedCalls: false,
                     stringArrayWrappersCount: 0,
                     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,
                        code,
                        {
                        {
                            ...NO_ADDITIONAL_NODES_PRESET,
                            ...NO_ADDITIONAL_NODES_PRESET,
-                           rotateStringArray: true,
+                           stringArrayRotate: true,
                            stringArray: true,
                            stringArray: true,
                            stringArrayThreshold: 1
                            stringArrayThreshold: 1
                        }
                        }
@@ -100,7 +100,7 @@ describe('StringArrayStorage', () => {
                         code,
                         code,
                         {
                         {
                             ...NO_ADDITIONAL_NODES_PRESET,
                             ...NO_ADDITIONAL_NODES_PRESET,
-                            rotateStringArray: true,
+                            stringArrayRotate: true,
                             stringArray: true,
                             stringArray: true,
                             stringArrayThreshold: 1
                             stringArrayThreshold: 1
                         }
                         }
@@ -173,7 +173,7 @@ describe('StringArrayStorage', () => {
                         code,
                         code,
                         {
                         {
                             ...NO_ADDITIONAL_NODES_PRESET,
                             ...NO_ADDITIONAL_NODES_PRESET,
-                            shuffleStringArray: true,
+                            stringArrayShuffle: true,
                             stringArray: true,
                             stringArray: true,
                             stringArrayThreshold: 1
                             stringArrayThreshold: 1
                         }
                         }
@@ -268,7 +268,7 @@ describe('StringArrayStorage', () => {
                         code,
                         code,
                         {
                         {
                             ...NO_ADDITIONAL_NODES_PRESET,
                             ...NO_ADDITIONAL_NODES_PRESET,
-                            shuffleStringArray: true,
+                            stringArrayShuffle: true,
                             stringArray: true,
                             stringArray: true,
                             stringArrayThreshold: 1
                             stringArrayThreshold: 1
                         }
                         }

+ 2 - 2
test/performance-tests/JavaScriptObfuscatorMemory.spec.ts

@@ -37,9 +37,9 @@ describe('JavaScriptObfuscator memory', function () {
                         identifierNamesGenerator: 'mangled',
                         identifierNamesGenerator: 'mangled',
                         log: false,
                         log: false,
                         renameGlobals: false,
                         renameGlobals: false,
-                        rotateStringArray: true,
+                        stringArrayRotate: true,
                         selfDefending: true,
                         selfDefending: true,
-                        shuffleStringArray: true,
+                        stringArrayShuffle: true,
                         splitStrings: true,
                         splitStrings: true,
                         splitStringsChunkLength: 2,
                         splitStringsChunkLength: 2,
                         stringArray: true,
                         stringArray: true,

+ 1 - 1
test/runtime-tests/JavaScriptObfuscatorRuntime.spec.ts

@@ -33,7 +33,7 @@ describe('JavaScriptObfuscator runtime eval', function () {
         simplify: true,
         simplify: true,
         renameProperties: true,
         renameProperties: true,
         renamePropertiesMode: RenamePropertiesMode.Unsafe,
         renamePropertiesMode: RenamePropertiesMode.Unsafe,
-        rotateStringArray: true,
+        stringArrayRotate: true,
         selfDefending: true,
         selfDefending: true,
         splitStrings: true,
         splitStrings: true,
         splitStringsChunkLength: 3,
         splitStringsChunkLength: 3,