Browse Source

Merge pull request #1010 from javascript-obfuscator/options-rename

Timofey Kachalov 3 years ago
parent
commit
4b5da457c4
29 changed files with 157 additions and 133 deletions
  1. 7 0
      CHANGELOG.md
  2. 28 28
      README.md
  3. 1 1
      package.json
  4. 9 9
      src/cli/JavaScriptObfuscatorCLI.ts
  5. 3 3
      src/container/modules/node-transformers/PreparingTransformersModule.ts
  6. 1 1
      src/enums/node-transformers/preparing-transformers/obfuscating-guards/ObfuscatingGuard.ts
  7. 3 3
      src/interfaces/options/IOptions.ts
  8. 1 1
      src/node-transformers/preparing-transformers/ObfuscatingGuardsTransformer.ts
  9. 26 10
      src/node-transformers/preparing-transformers/obfuscating-guards/IgnoredImportObfuscatingGuard.ts
  10. 1 1
      src/node-transformers/string-array-transformers/StringArrayRotateFunctionTransformer.ts
  11. 2 2
      src/node-transformers/string-array-transformers/StringArrayTransformer.ts
  12. 13 13
      src/options/Options.ts
  13. 2 2
      src/options/normalizer-rules/StringArrayRule.ts
  14. 3 3
      src/options/presets/Default.ts
  15. 2 2
      src/options/presets/LowObfuscation.ts
  16. 3 3
      src/options/presets/NoCustomNodes.ts
  17. 1 1
      src/storages/string-array-transformers/StringArrayStorage.ts
  18. 4 4
      test/functional-tests/custom-code-helpers/string-array/StringArrayRotateFunctionCodeHelper.spec.ts
  19. 5 5
      test/functional-tests/custom-code-helpers/string-array/templates/string-array-rotate-function-template/StringArrayRotateFunctionTemplate.spec.ts
  20. 2 2
      test/functional-tests/javascript-obfuscator/JavaScriptObfuscator.spec.ts
  21. 11 10
      test/functional-tests/node-transformers/preparing-transformers/obfuscating-guards/ignored-import-obfuscating-guard/IgnoredImportObfuscatingGuard.spec.ts
  22. 1 1
      test/functional-tests/node-transformers/preparing-transformers/obfuscating-guards/ignored-import-obfuscating-guard/fixtures/base-behaviour.js
  23. 8 8
      test/functional-tests/node-transformers/string-array-transformers/string-array-rotate-function-transformer/StringArrayRotateFunctionTransformer.spec.ts
  24. 6 6
      test/functional-tests/node-transformers/string-array-transformers/string-array-transformer/StringArrayTransformer.spec.ts
  25. 6 6
      test/functional-tests/options/OptionsNormalizer.spec.ts
  26. 4 4
      test/functional-tests/storages/string-array-transformers/string-array-storage/StringArrayStorage.spec.ts
  27. 1 1
      test/index.spec.ts
  28. 2 2
      test/performance-tests/JavaScriptObfuscatorMemory.spec.ts
  29. 1 1
      test/runtime-tests/JavaScriptObfuscatorRuntime.spec.ts

+ 7 - 0
CHANGELOG.md

@@ -1,5 +1,12 @@
 Change Log
 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
 v2.19.1
 ---
 ---
 * Updated `@javascript-obfuscator/escodegen` with fixed parenthesis of `default export` IIFE
 * Updated `@javascript-obfuscator/escodegen` with fixed parenthesis of `default export` IIFE

+ 28 - 28
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,
@@ -421,7 +421,7 @@ Following options are available for the JS Obfuscator:
     --identifier-names-generator <string> [dictionary, hexadecimal, mangled, mangled-shuffled]
     --identifier-names-generator <string> [dictionary, hexadecimal, mangled, mangled-shuffled]
     --identifiers-dictionary '<list>' (comma separated)
     --identifiers-dictionary '<list>' (comma separated)
     --identifiers-prefix <string>
     --identifiers-prefix <string>
-    --ignore-require-imports <boolean>
+    --ignore-imports <boolean>
     --log <boolean>
     --log <boolean>
     --numbers-to-expressions <boolean>
     --numbers-to-expressions <boolean>
     --options-preset <string> [default, low-obfuscation, medium-obfuscation, high-obfuscation]
     --options-preset <string> [default, low-obfuscation, medium-obfuscation, high-obfuscation]
@@ -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,

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
 {
   "name": "javascript-obfuscator",
   "name": "javascript-obfuscator",
-  "version": "2.19.1",
+  "version": "3.0.0",
   "description": "JavaScript obfuscator",
   "description": "JavaScript obfuscator",
   "keywords": [
   "keywords": [
     "obfuscator",
     "obfuscator",

+ 9 - 9
src/cli/JavaScriptObfuscatorCLI.ts

@@ -271,7 +271,7 @@ export class JavaScriptObfuscatorCLI implements IInitializable {
                 ArraySanitizer
                 ArraySanitizer
             )
             )
             .option(
             .option(
-                '--ignore-require-imports <boolean>', 'Prevents obfuscation of `require` imports',
+                '--ignore-imports <boolean>', 'Prevents obfuscation of `require` and `dynamic` imports',
                 BooleanSanitizer
                 BooleanSanitizer
             )
             )
             .option(
             .option(
@@ -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',

+ 3 - 3
src/container/modules/node-transformers/PreparingTransformersModule.ts

@@ -13,7 +13,7 @@ import { ConditionalCommentObfuscatingGuard } from '../../../node-transformers/p
 import { CustomCodeHelpersTransformer } from '../../../node-transformers/preparing-transformers/CustomCodeHelpersTransformer';
 import { CustomCodeHelpersTransformer } from '../../../node-transformers/preparing-transformers/CustomCodeHelpersTransformer';
 import { EvalCallExpressionTransformer } from '../../../node-transformers/preparing-transformers/EvalCallExpressionTransformer';
 import { EvalCallExpressionTransformer } from '../../../node-transformers/preparing-transformers/EvalCallExpressionTransformer';
 import { ForceTransformStringObfuscatingGuard } from '../../../node-transformers/preparing-transformers/obfuscating-guards/ForceTransformStringObfuscatingGuard';
 import { ForceTransformStringObfuscatingGuard } from '../../../node-transformers/preparing-transformers/obfuscating-guards/ForceTransformStringObfuscatingGuard';
-import { IgnoredRequireImportObfuscatingGuard } from '../../../node-transformers/preparing-transformers/obfuscating-guards/IgnoredRequireImportObfuscatingGuard';
+import { IgnoredImportObfuscatingGuard } from '../../../node-transformers/preparing-transformers/obfuscating-guards/IgnoredImportObfuscatingGuard';
 import { MetadataTransformer } from '../../../node-transformers/preparing-transformers/MetadataTransformer';
 import { MetadataTransformer } from '../../../node-transformers/preparing-transformers/MetadataTransformer';
 import { ObfuscatingGuardsTransformer } from '../../../node-transformers/preparing-transformers/ObfuscatingGuardsTransformer';
 import { ObfuscatingGuardsTransformer } from '../../../node-transformers/preparing-transformers/ObfuscatingGuardsTransformer';
 import { ParentificationTransformer } from '../../../node-transformers/preparing-transformers/ParentificationTransformer';
 import { ParentificationTransformer } from '../../../node-transformers/preparing-transformers/ParentificationTransformer';
@@ -63,9 +63,9 @@ export const preparingTransformersModule: interfaces.ContainerModule = new Conta
         .whenTargetNamed(ObfuscatingGuard.ForceTransformStringObfuscatingGuard);
         .whenTargetNamed(ObfuscatingGuard.ForceTransformStringObfuscatingGuard);
 
 
     bind<IObfuscatingGuard>(ServiceIdentifiers.INodeGuard)
     bind<IObfuscatingGuard>(ServiceIdentifiers.INodeGuard)
-        .to(IgnoredRequireImportObfuscatingGuard)
+        .to(IgnoredImportObfuscatingGuard)
         .inSingletonScope()
         .inSingletonScope()
-        .whenTargetNamed(ObfuscatingGuard.IgnoredRequireImportObfuscatingGuard);
+        .whenTargetNamed(ObfuscatingGuard.IgnoredImportObfuscatingGuard);
 
 
     bind<IObfuscatingGuard>(ServiceIdentifiers.INodeGuard)
     bind<IObfuscatingGuard>(ServiceIdentifiers.INodeGuard)
         .to(ReservedStringObfuscatingGuard)
         .to(ReservedStringObfuscatingGuard)

+ 1 - 1
src/enums/node-transformers/preparing-transformers/obfuscating-guards/ObfuscatingGuard.ts

@@ -2,6 +2,6 @@ export enum ObfuscatingGuard {
     BlackListObfuscatingGuard = 'BlackListObfuscatingGuard',
     BlackListObfuscatingGuard = 'BlackListObfuscatingGuard',
     ConditionalCommentObfuscatingGuard = 'ConditionalCommentObfuscatingGuard',
     ConditionalCommentObfuscatingGuard = 'ConditionalCommentObfuscatingGuard',
     ForceTransformStringObfuscatingGuard = 'ForceTransformStringObfuscatingGuard',
     ForceTransformStringObfuscatingGuard = 'ForceTransformStringObfuscatingGuard',
-    IgnoredRequireImportObfuscatingGuard = 'IgnoredRequireImportObfuscatingGuard',
+    IgnoredImportObfuscatingGuard = 'IgnoredImportObfuscatingGuard',
     ReservedStringObfuscatingGuard = 'ReservedStringObfuscatingGuard'
     ReservedStringObfuscatingGuard = 'ReservedStringObfuscatingGuard'
 }
 }

+ 3 - 3
src/interfaces/options/IOptions.ts

@@ -27,7 +27,7 @@ export interface IOptions {
     readonly identifierNamesGenerator: TTypeFromEnum<typeof IdentifierNamesGenerator>;
     readonly identifierNamesGenerator: TTypeFromEnum<typeof IdentifierNamesGenerator>;
     readonly identifiersDictionary: string[];
     readonly identifiersDictionary: string[];
     readonly identifiersPrefix: string;
     readonly identifiersPrefix: string;
-    readonly ignoreRequireImports: boolean;
+    readonly ignoreImports: boolean;
     readonly inputFileName: string;
     readonly inputFileName: string;
     readonly log: boolean;
     readonly log: boolean;
     readonly numbersToExpressions: boolean;
     readonly numbersToExpressions: boolean;
@@ -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/preparing-transformers/ObfuscatingGuardsTransformer.ts

@@ -31,7 +31,7 @@ export class ObfuscatingGuardsTransformer extends AbstractNodeTransformer {
         ObfuscatingGuard.BlackListObfuscatingGuard,
         ObfuscatingGuard.BlackListObfuscatingGuard,
         ObfuscatingGuard.ConditionalCommentObfuscatingGuard,
         ObfuscatingGuard.ConditionalCommentObfuscatingGuard,
         ObfuscatingGuard.ForceTransformStringObfuscatingGuard,
         ObfuscatingGuard.ForceTransformStringObfuscatingGuard,
-        ObfuscatingGuard.IgnoredRequireImportObfuscatingGuard,
+        ObfuscatingGuard.IgnoredImportObfuscatingGuard,
         ObfuscatingGuard.ReservedStringObfuscatingGuard
         ObfuscatingGuard.ReservedStringObfuscatingGuard
     ];
     ];
 
 

+ 26 - 10
src/node-transformers/preparing-transformers/obfuscating-guards/IgnoredRequireImportObfuscatingGuard.ts → src/node-transformers/preparing-transformers/obfuscating-guards/IgnoredImportObfuscatingGuard.ts

@@ -12,7 +12,7 @@ import { ServiceIdentifiers } from '../../../container/ServiceIdentifiers';
 import { NodeGuards } from '../../../node/NodeGuards';
 import { NodeGuards } from '../../../node/NodeGuards';
 
 
 @injectable()
 @injectable()
-export class IgnoredRequireImportObfuscatingGuard implements IObfuscatingGuard {
+export class IgnoredImportObfuscatingGuard implements IObfuscatingGuard {
     /**
     /**
      * @type {IOptions}
      * @type {IOptions}
      */
      */
@@ -27,20 +27,36 @@ export class IgnoredRequireImportObfuscatingGuard implements IObfuscatingGuard {
         this.options = options;
         this.options = options;
     }
     }
 
 
+    /**
+     * @param {Node} node
+     * @returns {boolean}
+     */
+    private static isDynamicImport (node: ESTree.Node): boolean {
+        return NodeGuards.isImportExpressionNode(node);
+    }
+
+    /**
+     * @param {Node} node
+     * @returns {boolean}
+     */
+    private static isRequireImport (node: ESTree.Node): boolean {
+        return NodeGuards.isCallExpressionNode(node)
+            && NodeGuards.isIdentifierNode(node.callee)
+            && node.callee.name === 'require';
+    }
+
     /**
     /**
      * @param {Node} node
      * @param {Node} node
      * @returns {ObfuscatingGuardResult}
      * @returns {ObfuscatingGuardResult}
      */
      */
     public check (node: ESTree.Node): ObfuscatingGuardResult {
     public check (node: ESTree.Node): ObfuscatingGuardResult {
-        if (this.options.ignoreRequireImports) {
-            if (
-                NodeGuards.isCallExpressionNode(node)
-                && NodeGuards.isIdentifierNode(node.callee)
-                && node.callee.name === 'require'
-            ) { return ObfuscatingGuardResult.Ignore; }
-            if (
-                NodeGuards.isImportExpressionNode(node)
-            ) { return ObfuscatingGuardResult.Ignore; }
+        if (this.options.ignoreImports) {
+            const isIgnoredImport = IgnoredImportObfuscatingGuard.isDynamicImport(node)
+                || IgnoredImportObfuscatingGuard.isRequireImport(node);
+
+            if (isIgnoredImport) {
+                return ObfuscatingGuardResult.Ignore;
+            }
         }
         }
 
 
         return ObfuscatingGuardResult.Transform;
         return ObfuscatingGuardResult.Transform;

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

+ 13 - 13
src/options/Options.ts

@@ -191,7 +191,7 @@ export class Options implements IOptions {
      * @type {boolean}
      * @type {boolean}
      */
      */
     @IsBoolean()
     @IsBoolean()
-    public readonly ignoreRequireImports!: boolean;
+    public readonly ignoreImports!: boolean;
 
 
     /**
     /**
      * @type {string}
      * @type {string}
@@ -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

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

@@ -28,7 +28,7 @@ export const DEFAULT_PRESET: TInputOptions = Object.freeze({
     identifierNamesGenerator: IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,
     identifierNamesGenerator: IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,
     identifiersPrefix: '',
     identifiersPrefix: '',
     identifiersDictionary: [],
     identifiersDictionary: [],
-    ignoreRequireImports: false,
+    ignoreImports: false,
     inputFileName: '',
     inputFileName: '',
     log: false,
     log: false,
     numbersToExpressions: false,
     numbersToExpressions: false,
@@ -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
 });
 });

+ 3 - 3
src/options/presets/NoCustomNodes.ts

@@ -25,7 +25,7 @@ export const NO_ADDITIONAL_NODES_PRESET: TInputOptions = Object.freeze({
     identifierNamesGenerator: IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,
     identifierNamesGenerator: IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,
     identifiersPrefix: '',
     identifiersPrefix: '',
     identifiersDictionary: [],
     identifiersDictionary: [],
-    ignoreRequireImports: false,
+    ignoreImports: false,
     inputFileName: '',
     inputFileName: '',
     log: false,
     log: false,
     numbersToExpressions: false,
     numbersToExpressions: false,
@@ -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,

+ 11 - 10
test/functional-tests/node-transformers/preparing-transformers/obfuscating-guards/ignored-require-import-obfuscating-guard/IgnoredRequireImportObfuscatingGuard.spec.ts → test/functional-tests/node-transformers/preparing-transformers/obfuscating-guards/ignored-import-obfuscating-guard/IgnoredImportObfuscatingGuard.spec.ts

@@ -6,13 +6,14 @@ import { NO_ADDITIONAL_NODES_PRESET } from '../../../../../../src/options/preset
 
 
 import { readFileAsString } from '../../../../../helpers/readFileAsString';
 import { readFileAsString } from '../../../../../helpers/readFileAsString';
 
 
-describe('IgnoredRequireImportObfuscatingGuard', () => {
+describe('IgnoredImportObfuscatingGuard', () => {
     describe('check', () => {
     describe('check', () => {
-        describe('`ignoreRequireImports` option is enabled', () => {
+        describe('`ignoreImports` option is enabled', () => {
             const obfuscatingGuardRegExp: RegExp = new RegExp(
             const obfuscatingGuardRegExp: RegExp = new RegExp(
                 'const foo *= *require\\(\'\\./foo\'\\);.*' +
                 'const foo *= *require\\(\'\\./foo\'\\);.*' +
                 'import _0x(?:[a-f0-9]){4,6} from *\'\\./bar\';.*' +
                 'import _0x(?:[a-f0-9]){4,6} from *\'\\./bar\';.*' +
-                'const baz *= *_0x(?:[a-f0-9]){4,6}\\(0x0\\);'
+                'const baz *= *_0x(?:[a-f0-9]){4,6}\\(0x0\\);.*' +
+                'const bark *= *await import\\(\'\\./bark\'\\);'
             );
             );
 
 
             let obfuscatedCode: string;
             let obfuscatedCode: string;
@@ -24,24 +25,24 @@ describe('IgnoredRequireImportObfuscatingGuard', () => {
                     code,
                     code,
                     {
                     {
                         ...NO_ADDITIONAL_NODES_PRESET,
                         ...NO_ADDITIONAL_NODES_PRESET,
-                        ignoreRequireImports: true,
+                        ignoreImports: true,
                         stringArray: true,
                         stringArray: true,
                         stringArrayThreshold: 1
                         stringArrayThreshold: 1
                     }
                     }
                 ).getObfuscatedCode();
                 ).getObfuscatedCode();
             });
             });
 
 
-            it('match #1: shouldn\'t obfuscate require import', () => {
+            it('match #1: shouldn\'t obfuscate imports', () => {
                 assert.match(obfuscatedCode, obfuscatingGuardRegExp);
                 assert.match(obfuscatedCode, obfuscatingGuardRegExp);
             });
             });
         });
         });
 
 
-        describe('`ignoreRequireImports` option is disabled', () => {
+        describe('`ignoreImports` option is disabled', () => {
             const obfuscatingGuardRegExp: RegExp = new RegExp(
             const obfuscatingGuardRegExp: RegExp = new RegExp(
                 'const foo *= *require\\(_0x(?:[a-f0-9]){4,6}\\(0x0\\)\\);.*' +
                 'const foo *= *require\\(_0x(?:[a-f0-9]){4,6}\\(0x0\\)\\);.*' +
                 'import _0x(?:[a-f0-9]){4,6} from *\'\\./bar\';.*' +
                 'import _0x(?:[a-f0-9]){4,6} from *\'\\./bar\';.*' +
-                'const baz *= *_0x(?:[a-f0-9]){4,6}\\(0x1\\);' +
-                'const qux *= *import\\(_0x(?:[a-f0-9]){4,6}\\(0x0\\)\\);.*'
+                'const baz *= *_0x(?:[a-f0-9]){4,6}\\(0x1\\);.*' +
+                'const bark *= *await import\\(_0x(?:[a-f0-9]){4,6}\\(0x2\\)\\);'
             );
             );
 
 
             let obfuscatedCode: string;
             let obfuscatedCode: string;
@@ -53,14 +54,14 @@ describe('IgnoredRequireImportObfuscatingGuard', () => {
                     code,
                     code,
                     {
                     {
                         ...NO_ADDITIONAL_NODES_PRESET,
                         ...NO_ADDITIONAL_NODES_PRESET,
-                        ignoreRequireImports: false,
+                        ignoreImports: false,
                         stringArray: true,
                         stringArray: true,
                         stringArrayThreshold: 1
                         stringArrayThreshold: 1
                     }
                     }
                 ).getObfuscatedCode();
                 ).getObfuscatedCode();
             });
             });
 
 
-            it('match #1: should obfuscate require import', () => {
+            it('match #1: should obfuscate imports', () => {
                 assert.match(obfuscatedCode, obfuscatingGuardRegExp);
                 assert.match(obfuscatedCode, obfuscatingGuardRegExp);
             });
             });
         });
         });

+ 1 - 1
test/functional-tests/node-transformers/preparing-transformers/obfuscating-guards/ignored-require-import-obfuscating-guard/fixtures/base-behaviour.js → test/functional-tests/node-transformers/preparing-transformers/obfuscating-guards/ignored-import-obfuscating-guard/fixtures/base-behaviour.js

@@ -1,4 +1,4 @@
 const foo = require('./foo');
 const foo = require('./foo');
 import bar from './bar';
 import bar from './bar';
 const baz = 'baz';
 const baz = 'baz';
-const qux = await import('quux')
+const bark = await import('./bark');

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

+ 1 - 1
test/index.spec.ts

@@ -108,7 +108,7 @@ import './functional-tests/node-transformers/preparing-transformers/eval-call-ex
 import './functional-tests/node-transformers/preparing-transformers/obfuscating-guards/black-list-obfuscating-guard/BlackListObfuscatingGuard.spec';
 import './functional-tests/node-transformers/preparing-transformers/obfuscating-guards/black-list-obfuscating-guard/BlackListObfuscatingGuard.spec';
 import './functional-tests/node-transformers/preparing-transformers/obfuscating-guards/conditional-comment-obfuscating-guard/ConditionalCommentObfuscatingGuard.spec';
 import './functional-tests/node-transformers/preparing-transformers/obfuscating-guards/conditional-comment-obfuscating-guard/ConditionalCommentObfuscatingGuard.spec';
 import './functional-tests/node-transformers/preparing-transformers/obfuscating-guards/force-transform-string-obfuscating-guard/ForceTransformStringObfuscatingGuard.spec';
 import './functional-tests/node-transformers/preparing-transformers/obfuscating-guards/force-transform-string-obfuscating-guard/ForceTransformStringObfuscatingGuard.spec';
-import './functional-tests/node-transformers/preparing-transformers/obfuscating-guards/ignored-require-import-obfuscating-guard/IgnoredRequireImportObfuscatingGuard.spec';
+import './functional-tests/node-transformers/preparing-transformers/obfuscating-guards/ignored-import-obfuscating-guard/IgnoredImportObfuscatingGuard.spec';
 import './functional-tests/node-transformers/preparing-transformers/obfuscating-guards/reserved-string-obfuscating-guard/ReservedStringObfuscatingGuard.spec';
 import './functional-tests/node-transformers/preparing-transformers/obfuscating-guards/reserved-string-obfuscating-guard/ReservedStringObfuscatingGuard.spec';
 import './functional-tests/node-transformers/preparing-transformers/variable-preserve-transformer/VariablePreserveTransformer.spec';
 import './functional-tests/node-transformers/preparing-transformers/variable-preserve-transformer/VariablePreserveTransformer.spec';
 import './functional-tests/node-transformers/rename-identifiers-transformers/identifier-replacer/IdentifierReplacer.spec';
 import './functional-tests/node-transformers/rename-identifiers-transformers/identifier-replacer/IdentifierReplacer.spec';

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