Просмотр исходного кода

new option `unicodeEscapeSequence`
renamed following options `unicodeArray`, `unicodeArrayEncoding`, `rotateUnicodeArray`

sanex3339 8 лет назад
Родитель
Сommit
a7c329b7f5
51 измененных файлов с 770 добавлено и 721 удалено
  1. 5 2
      CHANGELOG.md
  2. 32 25
      README.md
  3. 196 189
      dist/index.js
  4. 3 3
      src/Obfuscator.ts
  5. 4 2
      src/StringsArray.ts
  6. 3 3
      src/Utils.ts
  7. 12 11
      src/cli/JavaScriptObfuscatorCLI.ts
  8. 38 38
      src/custom-nodes/strings-array-nodes/StringsArrayCallsWrapper.ts
  9. 27 27
      src/custom-nodes/strings-array-nodes/StringsArrayNode.ts
  10. 21 21
      src/custom-nodes/strings-array-nodes/StringsArrayRotateFunctionNode.ts
  11. 4 0
      src/enums/StringsArrayEncoding.ts
  12. 0 4
      src/enums/UnicodeArrayEncoding.ts
  13. 6 5
      src/interfaces/IObfuscatorOptions.d.ts
  14. 6 5
      src/interfaces/IOptions.d.ts
  15. 87 0
      src/node-groups/StringsArrayNodesGroup.ts
  16. 0 87
      src/node-groups/UnicodeArrayNodesGroup.ts
  17. 2 2
      src/node-obfuscators/ObjectExpressionObfuscator.ts
  18. 31 29
      src/node-obfuscators/replacers/StringLiteralReplacer.ts
  19. 12 6
      src/options/Options.ts
  20. 14 14
      src/options/OptionsNormalizer.ts
  21. 5 4
      src/preset-options/DefaultPreset.ts
  22. 5 4
      src/preset-options/NoCustomNodesPreset.ts
  23. 2 2
      src/templates/custom-nodes/self-defending-nodes/self-defending-unicode-node/SelfDefendingTemplate.ts
  24. 3 3
      src/templates/custom-nodes/strings-array-nodes/strings-array-calls-wrapper/SelfDefendingTemplate.ts
  25. 11 11
      src/templates/custom-nodes/strings-array-nodes/strings-array-calls-wrapper/StringsArrayBase64DecodeNodeTemplate.ts
  26. 3 3
      src/templates/custom-nodes/strings-array-nodes/strings-array-calls-wrapper/StringsArrayCallsWrapperTemplate.ts
  27. 35 0
      src/templates/custom-nodes/strings-array-nodes/strings-array-calls-wrapper/StringsArrayRC4DecodeNodeTemplate.ts
  28. 8 0
      src/templates/custom-nodes/strings-array-nodes/strings-array-node/StringsArrayTemplate.ts
  29. 1 1
      src/templates/custom-nodes/strings-array-nodes/strings-array-rotate-function-node/SelfDefendingTemplate.ts
  30. 2 2
      src/templates/custom-nodes/strings-array-nodes/strings-array-rotate-function-node/StringsArrayRotateFunctionTemplate.ts
  31. 0 35
      src/templates/custom-nodes/unicode-array-nodes/unicode-array-calls-wrapper/UnicodeArrayRC4DecodeNodeTemplate.ts
  32. 0 8
      src/templates/custom-nodes/unicode-array-nodes/unicode-array-node/UnicodeArrayTemplate.ts
  33. 1 0
      src/types/TStringsArrayEncoding.ts
  34. 0 1
      src/types/TUnicodeArrayEncoding.ts
  35. 1 1
      src/types/custom-nodes/TStringsArrayCallsWrapper.d.ts
  36. 1 1
      src/types/custom-nodes/TStringsArrayNode.d.ts
  37. 2 2
      test/dev/dev.ts
  38. 4 4
      test/functional-tests/JavaScriptObfuscator.spec.ts
  39. 3 3
      test/functional-tests/custom-nodes/console-output-nodes/ConsoleOutputDisableExpressionNode.spec.ts
  40. 2 2
      test/functional-tests/custom-nodes/domain-lock-nodes/DomainLockNode.spec.ts
  41. 5 5
      test/functional-tests/custom-nodes/strings-array-nodes/StringsArrayCallsWrapper.spec.ts
  42. 6 6
      test/functional-tests/custom-nodes/strings-array-nodes/StringsArrayNode.spec.ts
  43. 9 9
      test/functional-tests/custom-nodes/strings-array-nodes/StringsArrayRotateFunctionNode.spec.ts
  44. 33 16
      test/functional-tests/node-obfuscators/LiteralObfuscator.spec.ts
  45. 4 4
      test/functional-tests/node-obfuscators/MemberExpressionObfuscator.spec.ts
  46. 2 2
      test/functional-tests/node-obfuscators/MethodDefinitionObfuscator.spec.ts
  47. 93 0
      test/functional-tests/templates/custom-nodes/strings-array-nodes/StringsArrayCallsWrapperNodeTemplate.spec.ts
  48. 0 93
      test/functional-tests/templates/custom-nodes/unicode-array-nodes/UnicodeArrayCallsWrapperNodeTemplate.spec.ts
  49. 4 4
      test/index.spec.ts
  50. 18 18
      test/unit-tests/OptionsNormalizer.spec.ts
  51. 4 4
      test/unit-tests/Utils.spec.ts

+ 5 - 2
CHANGELOG.md

@@ -2,8 +2,11 @@ Change Log
 ===
 ===
 v0.8.0
 v0.8.0
 ---
 ---
-* **Breaking options change:** `encodeUnicodeArray` has been renamed to `unicodeArrayEncoding` and now accepts following values: `true|false|'base64'|'rc4'`.
-* **Breaking change:** option `wrapUnicodeArrayCalls` was removed and now all calls to `unicodeArray` are always wrapped by special wrapper function.
+* **Breaking options change:** `unicodeArray` option has been renamed to `stringsArray`.
+* **Breaking options change:** `unicodeArrayThreshold` option has been renamed to `stringsArrayThreshold`.
+* **Breaking options change:** `encodeUnicodeArray` option has been renamed to `stringsArrayEncoding` and now accepts following values: `true|false|'base64'|'rc4'`.
+* **Breaking change:** option `wrapUnicodeArrayCalls` was removed and now all calls to `stringsArray` are always wrapped by special wrapper function.
+* New option `unicodeEscapeSequence` allows to enable/disable strings conversion to unicode escape sequence.
 * New option `domainLock` locks the obfuscated source code so it only runs on specific domains and/or sub-domains.
 * New option `domainLock` locks the obfuscated source code so it only runs on specific domains and/or sub-domains.
 * New option `sourceMapBaseUrl` sets base url to the source map import url when `sourceMapMode: 'separate'`.
 * New option `sourceMapBaseUrl` sets base url to the source map import url when `sourceMapMode: 'separate'`.
 * Custom nodes like `selfDefendingNode` or `consoleOutputNode` now inserted into deepest stack trace function call.
 * Custom nodes like `selfDefendingNode` or `consoleOutputNode` now inserted into deepest stack trace function call.

+ 32 - 25
README.md

@@ -51,7 +51,7 @@ var obfuscationResult = JavaScriptObfuscator.obfuscate(
     })();
     })();
     `,
     `,
     {
     {
-        rotateUnicodeArray: false
+        rotateStringsArray: false
     }
     }
 );
 );
 
 
@@ -117,15 +117,15 @@ Following options available for the JS Obfuscator:
     debugProtectionInterval: false,
     debugProtectionInterval: false,
     disableConsoleOutput: true,
     disableConsoleOutput: true,
     reservedNames: [],
     reservedNames: [],
-    rotateUnicodeArray: true,
+    rotateStringsArray: true,
     selfDefending: true,
     selfDefending: true,
     sourceMap: false,
     sourceMap: false,
     sourceMapBaseUrl: '',
     sourceMapBaseUrl: '',
     sourceMapFileName: '',
     sourceMapFileName: '',
     sourceMapMode: 'separate',
     sourceMapMode: 'separate',
-    unicodeArray: true,
-    unicodeArrayEncoding: false,
-    unicodeArrayThreshold: 0.8
+    stringsArray: true,
+    stringsArrayEncoding: false,
+    stringsArrayThreshold: 0.8
 }
 }
 ```
 ```
 
 
@@ -141,15 +141,15 @@ Following options available for the JS Obfuscator:
     --debugProtectionInterval <boolean>
     --debugProtectionInterval <boolean>
     --disableConsoleOutput <boolean>
     --disableConsoleOutput <boolean>
     --reservedNames <list> (comma separated)
     --reservedNames <list> (comma separated)
-    --rotateUnicodeArray <boolean>
+    --rotateStringsArray <boolean>
     --selfDefending <boolean>
     --selfDefending <boolean>
     --sourceMap <boolean>
     --sourceMap <boolean>
     --sourceMapBaseUrl <string>
     --sourceMapBaseUrl <string>
     --sourceMapFileName <string>
     --sourceMapFileName <string>
     --sourceMapMode <string> [inline, separate]
     --sourceMapMode <string> [inline, separate]
-    --unicodeArray <boolean>
-    --unicodeArrayEncoding <boolean|string> [true, false, base64, rc4]
-    --unicodeArrayThreshold <number>
+    --stringsArray <boolean>
+    --stringsArrayEncoding <boolean|string> [true, false, base64, rc4]
+    --stringsArrayThreshold <number>
 ```
 ```
 
 
 ### `compact`
 ### `compact`
@@ -202,12 +202,12 @@ Example:
 	}
 	}
 ```
 ```
 
 
-### `rotateUnicodeArray`
+### `rotateStringsArray`
 Type: `boolean` Default: `true`
 Type: `boolean` Default: `true`
 
 
-##### :warning: `unicodeArray` must be enabled
+##### :warning: `stringsArray` must be enabled
 
 
-Shift the `unicodeArray` 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.
+Shift the `stringsArray` 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.
 
 
 This option is recommended if your original source code isn't small, as the helper function can attract attention.
 This option is recommended if your original source code isn't small, as the helper function can attract attention.
 
 
@@ -263,36 +263,43 @@ Specifies source map generation mode:
 * `inline` - emit a single file with source maps instead of having a separate file;
 * `inline` - emit a single file with source maps instead of having a separate file;
 * `separate` - generates corresponding '.map' file with source map. If obfuscator run through CLI - adds link to source map file to the end of file with obfuscated code `//# sourceMappingUrl=file.js.map`.
 * `separate` - generates corresponding '.map' file with source map. If obfuscator run through CLI - adds link to source map file to the end of file with obfuscated code `//# sourceMappingUrl=file.js.map`.
 
 
-### `unicodeArray`
+### `stringsArray`
 Type: `boolean` Default: `true`
 Type: `boolean` Default: `true`
 
 
 Removes string literals and place them in a special array. For instance the string `"Hello World"` in `var m = "Hello World";` will be replaced with something like `var m = _0x12c456[0x1];`
 Removes string literals and place them in a special array. For instance the string `"Hello World"` in `var m = "Hello World";` will be replaced with something like `var m = _0x12c456[0x1];`
     
     
-### `unicodeArrayEncoding`
+### `stringsArrayEncoding`
 Type: `boolean|string` Default: `false`
 Type: `boolean|string` Default: `false`
 
 
-##### :warning: `unicodeArray` option must be enabled
+##### :warning: `stringsArray` option must be enabled
 
 
 This option can slightly slow down your script.
 This option can slightly slow down your script.
 
 
-Encode all string literals of the `unicodeArray` using `base64` or `rc4` and inserts a special code that used to decode it back at runtime.
+Encode all string literals of the `stringsArray` using `base64` or `rc4` and inserts a special code that used to decode it back at runtime.
 
 
 Available values:
 Available values:
-* `true` (`boolean`): encode `unicodeArray` values using `base64`
-* `false` (`boolean`): don't encode `unicodeArray` values
-* `'base64'` (`string`): encode `unicodeArray` values using `base64`
-* `'rc4'` (`string`): encode `unicodeArray` values using `rc4`. **About 30-35% slower then `base64`, but more harder to get initial values**
+* `true` (`boolean`): encode `stringsArray` values using `base64`
+* `false` (`boolean`): don't encode `stringsArray` values
+* `'base64'` (`string`): encode `stringsArray` values using `base64`
+* `'rc4'` (`string`): encode `stringsArray` values using `rc4`. **About 30-35% slower then `base64`, but more harder to get initial values**
     
     
-### `unicodeArrayThreshold`
+### `stringsArrayThreshold`
 Type: `number` Default: `0.8` Min: `0` Max: `1`
 Type: `number` Default: `0.8` Min: `0` Max: `1`
 
 
-##### :warning: `unicodeArray` option must be enabled
+##### :warning: `stringsArray` option must be enabled
 
 
-You can use this setting to adjust the probability (from 0 to 1) that a string literal will be inserted into the `unicodeArray`.
+You can use this setting to adjust the probability (from 0 to 1) that a string literal will be inserted into the `stringsArray`.
 
 
-This setting is useful with large code size because repeatdely calls to the `Unicode Array` function can slow down your code.
+This setting is useful with large code size because repeatdely calls to the `stringsArray` array can slightly slow down your code.
 
 
-`unicodeArrayThreshold: 0` equals to `unicodeArray: false`.
+`stringsArrayThreshold: 0` equals to `stringsArray: false`.
+
+### `unicodeEscapeSequence`
+Type: `boolean` Default: `true`
+
+Allows to enable/disable strings conversion to unicode escape sequence.
+
+Unicode escape sequence greatly increases code size. Recommended to disable this option when using `stringArrayEncoding` (especially with `rc4` encoding).
 
 
 ## License
 ## License
 Copyright (C) 2016 [Timofey Kachalov](http://github.com/sanex3339).
 Copyright (C) 2016 [Timofey Kachalov](http://github.com/sanex3339).

Разница между файлами не показана из-за своего большого размера
+ 196 - 189
dist/index.js


+ 3 - 3
src/Obfuscator.ts

@@ -25,9 +25,9 @@ import { Node } from './node/Node';
 import { NodeUtils } from './node/NodeUtils';
 import { NodeUtils } from './node/NodeUtils';
 import { ObjectExpressionObfuscator } from './node-obfuscators/ObjectExpressionObfuscator';
 import { ObjectExpressionObfuscator } from './node-obfuscators/ObjectExpressionObfuscator';
 import { SelfDefendingNodesGroup } from './node-groups/SelfDefendingNodesGroup';
 import { SelfDefendingNodesGroup } from './node-groups/SelfDefendingNodesGroup';
-import { UnicodeArrayNodesGroup } from './node-groups/UnicodeArrayNodesGroup';
-import { VariableDeclarationObfuscator } from './node-obfuscators/VariableDeclarationObfuscator';
 import { StackTraceAnalyzer } from './stack-trace-analyzer/StackTraceAnalyzer';
 import { StackTraceAnalyzer } from './stack-trace-analyzer/StackTraceAnalyzer';
+import { StringsArrayNodesGroup } from './node-groups/StringsArrayNodesGroup';
+import { VariableDeclarationObfuscator } from './node-obfuscators/VariableDeclarationObfuscator';
 
 
 export class Obfuscator implements IObfuscator {
 export class Obfuscator implements IObfuscator {
     /**
     /**
@@ -38,7 +38,7 @@ export class Obfuscator implements IObfuscator {
         SelfDefendingNodesGroup,
         SelfDefendingNodesGroup,
         ConsoleOutputNodesGroup,
         ConsoleOutputNodesGroup,
         DebugProtectionNodesGroup,
         DebugProtectionNodesGroup,
-        UnicodeArrayNodesGroup
+        StringsArrayNodesGroup
     ];
     ];
 
 
     /**
     /**

+ 4 - 2
src/UnicodeArray.ts → src/StringsArray.ts

@@ -1,6 +1,6 @@
 import { Utils } from './Utils';
 import { Utils } from './Utils';
 
 
-export class UnicodeArray {
+export class StringsArray {
     /**
     /**
      * @type {string[]}
      * @type {string[]}
      */
      */
@@ -46,6 +46,8 @@ export class UnicodeArray {
      * @returns {string}
      * @returns {string}
      */
      */
     public toString (): string {
     public toString (): string {
-        return this.array.toString();
+        return this.array.map((value: string) => {
+            return `'${value}'`;
+        }).toString()
     }
     }
 }
 }

+ 3 - 3
src/Utils.ts

@@ -238,14 +238,14 @@ export class Utils {
      * @param string
      * @param string
      * @returns {string}
      * @returns {string}
      */
      */
-    public static stringToUnicode (string: string): string {
+    public static stringToUnicodeEscapeSequence (string: string): string {
         const radix: number = 16;
         const radix: number = 16;
 
 
         let prefix: string,
         let prefix: string,
             regexp: RegExp = new RegExp('[\x00-\x7F]'),
             regexp: RegExp = new RegExp('[\x00-\x7F]'),
             template: string;
             template: string;
 
 
-        return `'${string.replace(/[\s\S]/g, (escape: string): string => {
+        return `${string.replace(/[\s\S]/g, (escape: string): string => {
             if (regexp.test(escape)) {
             if (regexp.test(escape)) {
                 prefix = '\\x';
                 prefix = '\\x';
                 template = '0'.repeat(2);
                 template = '0'.repeat(2);
@@ -255,6 +255,6 @@ export class Utils {
             }
             }
 
 
             return `${prefix}${(template + escape.charCodeAt(0).toString(radix)).slice(-template.length)}`;
             return `${prefix}${(template + escape.charCodeAt(0).toString(radix)).slice(-template.length)}`;
-        })}'`;
+        })}`;
     }
     }
 }
 }

+ 12 - 11
src/cli/JavaScriptObfuscatorCLI.ts

@@ -1,13 +1,13 @@
 import * as commander from 'commander';
 import * as commander from 'commander';
 import * as path from 'path';
 import * as path from 'path';
 
 
-import { TUnicodeArrayEncoding } from '../types/TUnicodeArrayEncoding';
+import { TStringsArrayEncoding } from '../types/TStringsArrayEncoding';
 
 
 import { IObfuscationResult } from '../interfaces/IObfuscationResult';
 import { IObfuscationResult } from '../interfaces/IObfuscationResult';
 import { IObfuscatorOptions } from '../interfaces/IObfuscatorOptions';
 import { IObfuscatorOptions } from '../interfaces/IObfuscatorOptions';
 
 
 import { SourceMapMode } from '../enums/SourceMapMode';
 import { SourceMapMode } from '../enums/SourceMapMode';
-import { UnicodeArrayEncoding } from '../enums/UnicodeArrayEncoding';
+import { StringsArrayEncoding } from '../enums/StringsArrayEncoding';
 
 
 import { DEFAULT_PRESET } from '../preset-options/DefaultPreset';
 import { DEFAULT_PRESET } from '../preset-options/DefaultPreset';
 
 
@@ -84,17 +84,17 @@ export class JavaScriptObfuscatorCLI {
 
 
     /**
     /**
      * @param value
      * @param value
-     * @returns {TUnicodeArrayEncoding}
+     * @returns {TStringsArrayEncoding}
      */
      */
-    private static parseUnicodeArrayEncoding (value: string): TUnicodeArrayEncoding {
+    private static parseStringsArrayEncoding (value: string): TStringsArrayEncoding {
         switch (value) {
         switch (value) {
             case 'true':
             case 'true':
             case '1':
             case '1':
-            case UnicodeArrayEncoding.base64:
+            case StringsArrayEncoding.base64:
                 return true;
                 return true;
 
 
-            case UnicodeArrayEncoding.rc4:
-                return UnicodeArrayEncoding.rc4;
+            case StringsArrayEncoding.rc4:
+                return StringsArrayEncoding.rc4;
 
 
             default:
             default:
                 return false;
                 return false;
@@ -150,7 +150,7 @@ export class JavaScriptObfuscatorCLI {
             .option('--disableConsoleOutput <boolean>', 'Allow console.log, console.info, console.error and console.warn messages output into browser console', JavaScriptObfuscatorCLI.parseBoolean)
             .option('--disableConsoleOutput <boolean>', 'Allow console.log, console.info, console.error and console.warn messages output into browser console', JavaScriptObfuscatorCLI.parseBoolean)
             .option('--domainLock <list>', 'Blocks the execution of the code in domains that do not match the passed RegExp patterns (comma separated)', (val: string) => val.split(','))
             .option('--domainLock <list>', 'Blocks the execution of the code in domains that do not match the passed RegExp patterns (comma separated)', (val: string) => val.split(','))
             .option('--reservedNames <list>', 'Disable obfuscation of variable names, function names and names of function parameters that match the passed RegExp patterns (comma separated)', (val: string) => val.split(','))
             .option('--reservedNames <list>', 'Disable obfuscation of variable names, function names and names of function parameters that match the passed RegExp patterns (comma separated)', (val: string) => val.split(','))
-            .option('--rotateUnicodeArray <boolean>', 'Disable rotation of unicode array values during obfuscation', JavaScriptObfuscatorCLI.parseBoolean)
+            .option('--rotateStringsArray <boolean>', 'Disable rotation of unicode array values during obfuscation', JavaScriptObfuscatorCLI.parseBoolean)
             .option('--selfDefending <boolean>', 'Disables self-defending for obfuscated code', JavaScriptObfuscatorCLI.parseBoolean)
             .option('--selfDefending <boolean>', 'Disables self-defending for obfuscated code', JavaScriptObfuscatorCLI.parseBoolean)
             .option('--sourceMap <boolean>', 'Enables source map generation', JavaScriptObfuscatorCLI.parseBoolean)
             .option('--sourceMap <boolean>', 'Enables source map generation', JavaScriptObfuscatorCLI.parseBoolean)
             .option('--sourceMapBaseUrl <string>', 'Sets base url to the source map import url when `--sourceMapMode=separate`')
             .option('--sourceMapBaseUrl <string>', 'Sets base url to the source map import url when `--sourceMapMode=separate`')
@@ -160,9 +160,10 @@ export class JavaScriptObfuscatorCLI {
                 'Specify source map output mode',
                 'Specify source map output mode',
                 JavaScriptObfuscatorCLI.parseSourceMapMode
                 JavaScriptObfuscatorCLI.parseSourceMapMode
             )
             )
-            .option('--unicodeArray <boolean>', 'Disables gathering of all literal strings into an array and replacing every literal string with an array call', JavaScriptObfuscatorCLI.parseBoolean)
-            .option('--unicodeArrayEncoding <boolean|string> [true, false, base64, rc4]', 'All literals in Unicode array become encoded in using base64 or rc4 (this option can slightly slow down your code speed', JavaScriptObfuscatorCLI.parseUnicodeArrayEncoding)
-            .option('--unicodeArrayThreshold <number>', 'The probability that the literal string will be inserted into unicodeArray (Default: 0.8, Min: 0, Max: 1)', parseFloat)
+            .option('--stringsArray <boolean>', 'Disables gathering of all literal strings into an array and replacing every literal string with an array call', JavaScriptObfuscatorCLI.parseBoolean)
+            .option('--stringsArrayEncoding <boolean|string> [true, false, base64, rc4]', 'Encodes all strings in strings array using base64 or rc4 (this option can slow down your code speed', JavaScriptObfuscatorCLI.parseStringsArrayEncoding)
+            .option('--stringsArrayThreshold <number>', 'The probability that the literal string will be inserted into stringsArray (Default: 0.8, Min: 0, Max: 1)', parseFloat)
+            .option('--unicodeEscapeSequence <boolean>', 'Allows to enable/disable strings conversion to unicode escape sequence', JavaScriptObfuscatorCLI.parseBoolean)
             .parse(this.rawArguments);
             .parse(this.rawArguments);
 
 
         this.commands.on('--help', () => {
         this.commands.on('--help', () => {

+ 38 - 38
src/custom-nodes/unicode-array-nodes/UnicodeArrayCallsWrapper.ts → src/custom-nodes/strings-array-nodes/StringsArrayCallsWrapper.ts

@@ -6,68 +6,68 @@ import { TStatement } from '../../types/TStatement';
 import { IOptions } from '../../interfaces/IOptions';
 import { IOptions } from '../../interfaces/IOptions';
 
 
 import { AppendState } from '../../enums/AppendState';
 import { AppendState } from '../../enums/AppendState';
-import { UnicodeArrayEncoding } from '../../enums/UnicodeArrayEncoding';
+import { StringsArrayEncoding } from '../../enums/StringsArrayEncoding';
 
 
 import { NO_CUSTOM_NODES_PRESET } from '../../preset-options/NoCustomNodesPreset';
 import { NO_CUSTOM_NODES_PRESET } from '../../preset-options/NoCustomNodesPreset';
 
 
 import { AtobTemplate } from '../../templates/custom-nodes/AtobTemplate';
 import { AtobTemplate } from '../../templates/custom-nodes/AtobTemplate';
 import { Rc4Template } from '../../templates/custom-nodes/Rc4Template';
 import { Rc4Template } from '../../templates/custom-nodes/Rc4Template';
-import { SelfDefendingTemplate } from '../../templates/custom-nodes/unicode-array-nodes/unicode-array-calls-wrapper/SelfDefendingTemplate';
-import { UnicodeArrayBase64DecodeNodeTemplate } from '../../templates/custom-nodes/unicode-array-nodes/unicode-array-calls-wrapper/UnicodeArrayBase64DecodeNodeTemplate';
-import { UnicodeArrayCallsWrapperTemplate } from '../../templates/custom-nodes/unicode-array-nodes/unicode-array-calls-wrapper/UnicodeArrayCallsWrapperTemplate';
-import { UnicodeArrayRc4DecodeNodeTemplate } from '../../templates/custom-nodes/unicode-array-nodes/unicode-array-calls-wrapper/UnicodeArrayRC4DecodeNodeTemplate';
+import { SelfDefendingTemplate } from '../../templates/custom-nodes/strings-array-nodes/strings-array-calls-wrapper/SelfDefendingTemplate';
+import { StringsArrayBase64DecodeNodeTemplate } from '../../templates/custom-nodes/strings-array-nodes/strings-array-calls-wrapper/StringsArrayBase64DecodeNodeTemplate';
+import { StringsArrayCallsWrapperTemplate } from '../../templates/custom-nodes/strings-array-nodes/strings-array-calls-wrapper/StringsArrayCallsWrapperTemplate';
+import { StringsArrayRc4DecodeNodeTemplate } from '../../templates/custom-nodes/strings-array-nodes/strings-array-calls-wrapper/StringsArrayRC4DecodeNodeTemplate';
 
 
 import { AbstractCustomNode } from '../AbstractCustomNode';
 import { AbstractCustomNode } from '../AbstractCustomNode';
 import { JavaScriptObfuscator } from '../../JavaScriptObfuscator';
 import { JavaScriptObfuscator } from '../../JavaScriptObfuscator';
 import { NodeAppender } from '../../node/NodeAppender';
 import { NodeAppender } from '../../node/NodeAppender';
 import { NodeUtils } from '../../node/NodeUtils';
 import { NodeUtils } from '../../node/NodeUtils';
-import { UnicodeArray } from '../../UnicodeArray';
+import { StringsArray } from '../../StringsArray';
 
 
-export class UnicodeArrayCallsWrapper extends AbstractCustomNode {
+export class StringsArrayCallsWrapper extends AbstractCustomNode {
     /**
     /**
      * @type {AppendState}
      * @type {AppendState}
      */
      */
     protected appendState: AppendState = AppendState.AfterObfuscation;
     protected appendState: AppendState = AppendState.AfterObfuscation;
 
 
     /**
     /**
-     * @type {UnicodeArray}
+     * @type {StringsArray}
      */
      */
-    private unicodeArray: UnicodeArray;
+    private stringsArray: StringsArray;
 
 
     /**
     /**
      * @type {string}
      * @type {string}
      */
      */
-    private unicodeArrayName: string;
+    private stringsArrayName: string;
 
 
     /**
     /**
      * @type {string}
      * @type {string}
      */
      */
-    private unicodeArrayCallsWrapperName: string;
+    private stringsArrayCallsWrapperName: string;
 
 
     /**
     /**
-     * @param unicodeArrayCallsWrapperName
-     * @param unicodeArrayName
-     * @param unicodeArray
+     * @param stringsArrayCallsWrapperName
+     * @param stringsArrayName
+     * @param stringsArray
      * @param options
      * @param options
      */
      */
     constructor (
     constructor (
-        unicodeArrayCallsWrapperName: string,
-        unicodeArrayName: string,
-        unicodeArray: UnicodeArray,
+        stringsArrayCallsWrapperName: string,
+        stringsArrayName: string,
+        stringsArray: StringsArray,
         options: IOptions
         options: IOptions
     ) {
     ) {
         super(options);
         super(options);
 
 
-        this.unicodeArrayCallsWrapperName = unicodeArrayCallsWrapperName;
-        this.unicodeArrayName = unicodeArrayName;
-        this.unicodeArray = unicodeArray;
+        this.stringsArrayCallsWrapperName = stringsArrayCallsWrapperName;
+        this.stringsArrayName = stringsArrayName;
+        this.stringsArray = stringsArray;
     }
     }
 
 
     /**
     /**
      * @param blockScopeNode
      * @param blockScopeNode
      */
      */
     public appendNode (blockScopeNode: TNodeWithBlockStatement): void {
     public appendNode (blockScopeNode: TNodeWithBlockStatement): void {
-        if (!this.unicodeArray.getLength()) {
+        if (!this.stringsArray.getLength()) {
             return;
             return;
         }
         }
 
 
@@ -78,7 +78,7 @@ export class UnicodeArrayCallsWrapper extends AbstractCustomNode {
      * @returns {string}
      * @returns {string}
      */
      */
     public getNodeIdentifier (): string {
     public getNodeIdentifier (): string {
-        return this.unicodeArrayCallsWrapperName;
+        return this.stringsArrayCallsWrapperName;
     };
     };
 
 
     /**
     /**
@@ -91,53 +91,53 @@ export class UnicodeArrayCallsWrapper extends AbstractCustomNode {
     /**
     /**
      * @returns {string}
      * @returns {string}
      */
      */
-    protected getDecodeUnicodeArrayTemplate (): string {
-        let decodeUnicodeArrayTemplate: string = '',
+    protected getDecodeStringsArrayTemplate (): string {
+        let decodeStringsArrayTemplate: string = '',
             selfDefendingCode: string = '';
             selfDefendingCode: string = '';
 
 
         if (this.options.selfDefending) {
         if (this.options.selfDefending) {
             selfDefendingCode = SelfDefendingTemplate().formatUnicorn({
             selfDefendingCode = SelfDefendingTemplate().formatUnicorn({
-                unicodeArrayCallsWrapperName: this.unicodeArrayCallsWrapperName,
-                unicodeArrayName: this.unicodeArrayName
+                stringsArrayCallsWrapperName: this.stringsArrayCallsWrapperName,
+                stringsArrayName: this.stringsArrayName
             });
             });
         }
         }
 
 
-        switch (this.options.unicodeArrayEncoding) {
-            case UnicodeArrayEncoding.base64:
-                decodeUnicodeArrayTemplate = UnicodeArrayBase64DecodeNodeTemplate().formatUnicorn({
+        switch (this.options.stringsArrayEncoding) {
+            case StringsArrayEncoding.base64:
+                decodeStringsArrayTemplate = StringsArrayBase64DecodeNodeTemplate().formatUnicorn({
                     atobPolyfill: AtobTemplate(),
                     atobPolyfill: AtobTemplate(),
                     selfDefendingCode,
                     selfDefendingCode,
-                    unicodeArrayCallsWrapperName: this.unicodeArrayCallsWrapperName
+                    stringsArrayCallsWrapperName: this.stringsArrayCallsWrapperName
                 });
                 });
 
 
                 break;
                 break;
 
 
-            case UnicodeArrayEncoding.rc4:
-                decodeUnicodeArrayTemplate = UnicodeArrayRc4DecodeNodeTemplate().formatUnicorn({
+            case StringsArrayEncoding.rc4:
+                decodeStringsArrayTemplate = StringsArrayRc4DecodeNodeTemplate().formatUnicorn({
                     atobPolyfill: AtobTemplate(),
                     atobPolyfill: AtobTemplate(),
                     rc4Polyfill: Rc4Template(),
                     rc4Polyfill: Rc4Template(),
                     selfDefendingCode,
                     selfDefendingCode,
-                    unicodeArrayCallsWrapperName: this.unicodeArrayCallsWrapperName
+                    stringsArrayCallsWrapperName: this.stringsArrayCallsWrapperName
                 });
                 });
 
 
                 break;
                 break;
         }
         }
 
 
-        return decodeUnicodeArrayTemplate;
+        return decodeStringsArrayTemplate;
     }
     }
 
 
     /**
     /**
      * @returns {TStatement[]}
      * @returns {TStatement[]}
      */
      */
     protected getNodeStructure (): TStatement[] {
     protected getNodeStructure (): TStatement[] {
-        const decodeNodeTemplate: string = this.getDecodeUnicodeArrayTemplate();
+        const decodeNodeTemplate: string = this.getDecodeStringsArrayTemplate();
 
 
         return NodeUtils.convertCodeToStructure(
         return NodeUtils.convertCodeToStructure(
             JavaScriptObfuscator.obfuscate(
             JavaScriptObfuscator.obfuscate(
-                UnicodeArrayCallsWrapperTemplate().formatUnicorn({
+                StringsArrayCallsWrapperTemplate().formatUnicorn({
                     decodeNodeTemplate,
                     decodeNodeTemplate,
-                    unicodeArrayCallsWrapperName: this.unicodeArrayCallsWrapperName,
-                    unicodeArrayName: this.unicodeArrayName
+                    stringsArrayCallsWrapperName: this.stringsArrayCallsWrapperName,
+                    stringsArrayName: this.stringsArrayName
                 }),
                 }),
                 NO_CUSTOM_NODES_PRESET
                 NO_CUSTOM_NODES_PRESET
             ).getObfuscatedCode()
             ).getObfuscatedCode()

+ 27 - 27
src/custom-nodes/unicode-array-nodes/UnicodeArrayNode.ts → src/custom-nodes/strings-array-nodes/StringsArrayNode.ts

@@ -7,19 +7,19 @@ import { IOptions } from '../../interfaces/IOptions';
 
 
 import { AppendState } from '../../enums/AppendState';
 import { AppendState } from '../../enums/AppendState';
 
 
-import { UnicodeArray } from '../../UnicodeArray';
+import { StringsArray } from '../../StringsArray';
 
 
-import { UnicodeArrayTemplate } from '../../templates/custom-nodes/unicode-array-nodes/unicode-array-node/UnicodeArrayTemplate';
+import { StringsArrayTemplate } from '../../templates/custom-nodes/strings-array-nodes/strings-array-node/StringsArrayTemplate';
 
 
 import { AbstractCustomNode } from '../AbstractCustomNode';
 import { AbstractCustomNode } from '../AbstractCustomNode';
 import { NodeAppender } from '../../node/NodeAppender';
 import { NodeAppender } from '../../node/NodeAppender';
 import { NodeUtils } from '../../node/NodeUtils';
 import { NodeUtils } from '../../node/NodeUtils';
 
 
-export class UnicodeArrayNode extends AbstractCustomNode {
+export class StringsArrayNode extends AbstractCustomNode {
     /**
     /**
      * @type {number}
      * @type {number}
      */
      */
-    public static UNICODE_ARRAY_RANDOM_LENGTH: number = 4;
+    public static ARRAY_RANDOM_LENGTH: number = 4;
 
 
     /**
     /**
      * @type {AppendState}
      * @type {AppendState}
@@ -27,44 +27,44 @@ export class UnicodeArrayNode extends AbstractCustomNode {
     protected appendState: AppendState = AppendState.AfterObfuscation;
     protected appendState: AppendState = AppendState.AfterObfuscation;
 
 
     /**
     /**
-     * @type {UnicodeArray}
+     * @type {StringsArray}
      */
      */
-    private unicodeArray: UnicodeArray;
+    private stringsArray: StringsArray;
 
 
     /**
     /**
      * @type {string}
      * @type {string}
      */
      */
-    private unicodeArrayName: string;
+    private stringsArrayName: string;
 
 
     /**
     /**
      * @type {number}
      * @type {number}
      */
      */
-    private unicodeArrayRotateValue: number;
+    private stringsArrayRotateValue: number;
 
 
     /**
     /**
-     * @param unicodeArray
-     * @param unicodeArrayName
-     * @param unicodeArrayRotateValue
+     * @param stringsArray
+     * @param stringsArrayName
+     * @param stringsArrayRotateValue
      * @param options
      * @param options
      */
      */
     constructor (
     constructor (
-        unicodeArray: UnicodeArray,
-        unicodeArrayName: string,
-        unicodeArrayRotateValue: number = 0,
+        stringsArray: StringsArray,
+        stringsArrayName: string,
+        stringsArrayRotateValue: number = 0,
         options: IOptions
         options: IOptions
     ) {
     ) {
         super(options);
         super(options);
 
 
-        this.unicodeArray = unicodeArray;
-        this.unicodeArrayName = unicodeArrayName;
-        this.unicodeArrayRotateValue = unicodeArrayRotateValue;
+        this.stringsArray = stringsArray;
+        this.stringsArrayName = stringsArrayName;
+        this.stringsArrayRotateValue = stringsArrayRotateValue;
     }
     }
 
 
     /**
     /**
      * @param blockScopeNode
      * @param blockScopeNode
      */
      */
     public appendNode (blockScopeNode: TNodeWithBlockStatement): void {
     public appendNode (blockScopeNode: TNodeWithBlockStatement): void {
-        if (!this.unicodeArray.getLength()) {
+        if (!this.stringsArray.getLength()) {
             return;
             return;
         }
         }
 
 
@@ -75,21 +75,21 @@ export class UnicodeArrayNode extends AbstractCustomNode {
      * @returns {string}
      * @returns {string}
      */
      */
     public getNodeIdentifier (): string {
     public getNodeIdentifier (): string {
-        return this.unicodeArrayName;
+        return this.stringsArrayName;
     }
     }
 
 
     /**
     /**
-     * @returns {UnicodeArray}
+     * @returns {StringsArray}
      */
      */
-    public getNodeData (): UnicodeArray {
-        return this.unicodeArray;
+    public getNodeData (): StringsArray {
+        return this.stringsArray;
     }
     }
 
 
     /**
     /**
      * @returns {TStatement[]}
      * @returns {TStatement[]}
      */
      */
     public getNode (): TStatement[] {
     public getNode (): TStatement[] {
-        this.unicodeArray.rotateArray(this.unicodeArrayRotateValue);
+        this.stringsArray.rotateArray(this.stringsArrayRotateValue);
 
 
         return super.getNode();
         return super.getNode();
     }
     }
@@ -98,7 +98,7 @@ export class UnicodeArrayNode extends AbstractCustomNode {
      * @param data
      * @param data
      */
      */
     public updateNodeData (data: string): void {
     public updateNodeData (data: string): void {
-        this.unicodeArray.addToArray(data);
+        this.stringsArray.addToArray(data);
     }
     }
 
 
     /**
     /**
@@ -106,9 +106,9 @@ export class UnicodeArrayNode extends AbstractCustomNode {
      */
      */
     protected getNodeStructure (): TStatement[] {
     protected getNodeStructure (): TStatement[] {
         return NodeUtils.convertCodeToStructure(
         return NodeUtils.convertCodeToStructure(
-            UnicodeArrayTemplate().formatUnicorn({
-                unicodeArrayName: this.unicodeArrayName,
-                unicodeArray: this.unicodeArray.toString()
+            StringsArrayTemplate().formatUnicorn({
+                stringsArrayName: this.stringsArrayName,
+                stringsArray: this.stringsArray.toString()
             })
             })
         );
         );
     }
     }

+ 21 - 21
src/custom-nodes/unicode-array-nodes/UnicodeArrayRotateFunctionNode.ts → src/custom-nodes/strings-array-nodes/StringsArrayRotateFunctionNode.ts

@@ -9,61 +9,61 @@ import { AppendState } from '../../enums/AppendState';
 
 
 import { NO_CUSTOM_NODES_PRESET } from '../../preset-options/NoCustomNodesPreset';
 import { NO_CUSTOM_NODES_PRESET } from '../../preset-options/NoCustomNodesPreset';
 
 
-import { SelfDefendingTemplate } from '../../templates/custom-nodes/unicode-array-nodes/unicode-array-rotate-function-node/SelfDefendingTemplate';
-import { UnicodeArrayRotateFunctionTemplate } from '../../templates/custom-nodes/unicode-array-nodes/unicode-array-rotate-function-node/UnicodeArrayRotateFunctionTemplate';
+import { SelfDefendingTemplate } from '../../templates/custom-nodes/strings-array-nodes/strings-array-rotate-function-node/SelfDefendingTemplate';
+import { StringsArrayRotateFunctionTemplate } from '../../templates/custom-nodes/strings-array-nodes/strings-array-rotate-function-node/StringsArrayRotateFunctionTemplate';
 
 
 import { AbstractCustomNode } from '../AbstractCustomNode';
 import { AbstractCustomNode } from '../AbstractCustomNode';
 import { JavaScriptObfuscator } from '../../JavaScriptObfuscator';
 import { JavaScriptObfuscator } from '../../JavaScriptObfuscator';
 import { NodeAppender } from '../../node/NodeAppender';
 import { NodeAppender } from '../../node/NodeAppender';
 import { NodeUtils } from '../../node/NodeUtils';
 import { NodeUtils } from '../../node/NodeUtils';
-import { UnicodeArray } from '../../UnicodeArray';
+import { StringsArray } from '../../StringsArray';
 import { Utils } from '../../Utils';
 import { Utils } from '../../Utils';
 
 
-export class UnicodeArrayRotateFunctionNode extends AbstractCustomNode {
+export class StringsArrayRotateFunctionNode extends AbstractCustomNode {
     /**
     /**
      * @type {AppendState}
      * @type {AppendState}
      */
      */
     protected appendState: AppendState = AppendState.AfterObfuscation;
     protected appendState: AppendState = AppendState.AfterObfuscation;
 
 
     /**
     /**
-     * @type {UnicodeArray}
+     * @type {StringsArray}
      */
      */
-    private unicodeArray: UnicodeArray;
+    private stringsArray: StringsArray;
 
 
     /**
     /**
      * @type {string}
      * @type {string}
      */
      */
-    private unicodeArrayName: string;
+    private stringsArrayName: string;
 
 
     /**
     /**
      * @param {number}
      * @param {number}
      */
      */
-    private unicodeArrayRotateValue: number;
+    private stringsArrayRotateValue: number;
 
 
     /**
     /**
-     * @param unicodeArrayName
-     * @param unicodeArray
-     * @param unicodeArrayRotateValue
+     * @param stringsArrayName
+     * @param stringsArray
+     * @param stringsArrayRotateValue
      * @param options
      * @param options
      */
      */
     constructor (
     constructor (
-        unicodeArrayName: string,
-        unicodeArray: UnicodeArray,
-        unicodeArrayRotateValue: number,
+        stringsArrayName: string,
+        stringsArray: StringsArray,
+        stringsArrayRotateValue: number,
         options: IOptions
         options: IOptions
     ) {
     ) {
         super(options);
         super(options);
 
 
-        this.unicodeArrayName = unicodeArrayName;
-        this.unicodeArray = unicodeArray;
-        this.unicodeArrayRotateValue = unicodeArrayRotateValue;
+        this.stringsArrayName = stringsArrayName;
+        this.stringsArray = stringsArray;
+        this.stringsArrayRotateValue = stringsArrayRotateValue;
     }
     }
 
 
     /**
     /**
      * @param blockScopeNode
      * @param blockScopeNode
      */
      */
     public appendNode (blockScopeNode: TNodeWithBlockStatement): void {
     public appendNode (blockScopeNode: TNodeWithBlockStatement): void {
-        if (!this.unicodeArray.getLength()) {
+        if (!this.stringsArray.getLength()) {
             return;
             return;
         }
         }
 
 
@@ -96,11 +96,11 @@ export class UnicodeArrayRotateFunctionNode extends AbstractCustomNode {
 
 
         return NodeUtils.convertCodeToStructure(
         return NodeUtils.convertCodeToStructure(
             JavaScriptObfuscator.obfuscate(
             JavaScriptObfuscator.obfuscate(
-                UnicodeArrayRotateFunctionTemplate().formatUnicorn({
+                StringsArrayRotateFunctionTemplate().formatUnicorn({
                     code,
                     code,
                     timesName,
                     timesName,
-                    unicodeArrayName: this.unicodeArrayName,
-                    unicodeArrayRotateValue: Utils.decToHex(this.unicodeArrayRotateValue),
+                    stringsArrayName: this.stringsArrayName,
+                    stringsArrayRotateValue: Utils.decToHex(this.stringsArrayRotateValue),
                     whileFunctionName
                     whileFunctionName
                 }),
                 }),
                 NO_CUSTOM_NODES_PRESET
                 NO_CUSTOM_NODES_PRESET

+ 4 - 0
src/enums/StringsArrayEncoding.ts

@@ -0,0 +1,4 @@
+export const StringsArrayEncoding: any = {
+    base64: 'base64',
+    rc4: 'rc4'
+};

+ 0 - 4
src/enums/UnicodeArrayEncoding.ts

@@ -1,4 +0,0 @@
-export const UnicodeArrayEncoding: any = {
-    base64: 'base64',
-    rc4: 'rc4'
-};

+ 6 - 5
src/interfaces/IObfuscatorOptions.d.ts

@@ -1,5 +1,5 @@
 import { TSourceMapMode } from '../types/TSourceMapMode';
 import { TSourceMapMode } from '../types/TSourceMapMode';
-import { TUnicodeArrayEncoding } from '../types/TUnicodeArrayEncoding';
+import { TStringsArrayEncoding } from '../types/TStringsArrayEncoding';
 
 
 export interface IObfuscatorOptions {
 export interface IObfuscatorOptions {
     compact?: boolean;
     compact?: boolean;
@@ -8,14 +8,15 @@ export interface IObfuscatorOptions {
     disableConsoleOutput?: boolean;
     disableConsoleOutput?: boolean;
     domainLock?: string[];
     domainLock?: string[];
     reservedNames?: string[];
     reservedNames?: string[];
-    rotateUnicodeArray?: boolean;
+    rotateStringsArray?: boolean;
     selfDefending?: boolean;
     selfDefending?: boolean;
     sourceMap?: boolean;
     sourceMap?: boolean;
     sourceMapBaseUrl?: string;
     sourceMapBaseUrl?: string;
     sourceMapFileName?: string;
     sourceMapFileName?: string;
     sourceMapMode?: TSourceMapMode;
     sourceMapMode?: TSourceMapMode;
-    unicodeArray?: boolean;
-    unicodeArrayEncoding?: TUnicodeArrayEncoding;
-    unicodeArrayThreshold?: number;
+    stringsArray?: boolean;
+    stringsArrayEncoding?: TStringsArrayEncoding;
+    stringsArrayThreshold?: number;
+    unicodeEscapeSequence?: boolean;
     [key: string]: any;
     [key: string]: any;
 }
 }

+ 6 - 5
src/interfaces/IOptions.d.ts

@@ -1,5 +1,5 @@
 import { TSourceMapMode } from '../types/TSourceMapMode';
 import { TSourceMapMode } from '../types/TSourceMapMode';
-import { TUnicodeArrayEncoding } from '../types/TUnicodeArrayEncoding';
+import { TStringsArrayEncoding } from '../types/TStringsArrayEncoding';
 
 
 export interface IOptions {
 export interface IOptions {
     readonly compact: boolean;
     readonly compact: boolean;
@@ -8,13 +8,14 @@ export interface IOptions {
     readonly disableConsoleOutput: boolean;
     readonly disableConsoleOutput: boolean;
     readonly domainLock: string[];
     readonly domainLock: string[];
     readonly reservedNames: string[];
     readonly reservedNames: string[];
-    readonly rotateUnicodeArray: boolean;
+    readonly rotateStringsArray: boolean;
     readonly selfDefending: boolean;
     readonly selfDefending: boolean;
     readonly sourceMap: boolean;
     readonly sourceMap: boolean;
     readonly sourceMapBaseUrl: string;
     readonly sourceMapBaseUrl: string;
     readonly sourceMapFileName: string;
     readonly sourceMapFileName: string;
     readonly sourceMapMode: TSourceMapMode;
     readonly sourceMapMode: TSourceMapMode;
-    readonly unicodeArray: boolean;
-    readonly unicodeArrayEncoding: TUnicodeArrayEncoding;
-    readonly unicodeArrayThreshold: number;
+    readonly stringsArray: boolean;
+    readonly stringsArrayEncoding: TStringsArrayEncoding;
+    readonly stringsArrayThreshold: number;
+    readonly unicodeEscapeSequence: boolean;
 }
 }

+ 87 - 0
src/node-groups/StringsArrayNodesGroup.ts

@@ -0,0 +1,87 @@
+import { ICustomNode } from '../interfaces/custom-nodes/ICustomNode';
+
+import { AppendState } from '../enums/AppendState';
+
+import { StringsArrayCallsWrapper } from '../custom-nodes/strings-array-nodes/StringsArrayCallsWrapper';
+import { StringsArrayNode } from '../custom-nodes/strings-array-nodes/StringsArrayNode';
+import { StringsArrayRotateFunctionNode } from '../custom-nodes/strings-array-nodes/StringsArrayRotateFunctionNode';
+
+import { AbstractNodesGroup } from './AbstractNodesGroup';
+import { StringsArray } from '../StringsArray';
+import { Utils } from '../Utils';
+
+export class StringsArrayNodesGroup extends AbstractNodesGroup {
+    /**
+     * @type {AppendState}
+     */
+    protected appendState: AppendState = AppendState.AfterObfuscation;
+
+    /**
+     * @type {string}
+     */
+    private stringsArrayName: string = Utils.getRandomVariableName(StringsArrayNode.ARRAY_RANDOM_LENGTH);
+
+    /**
+     * @type {string}
+     */
+    private stringsArrayCallsWrapper: string = Utils.getRandomVariableName(StringsArrayNode.ARRAY_RANDOM_LENGTH);
+
+    /**
+     * @type {number}
+     */
+    private stringsArrayRotateValue: number;
+
+    /**
+     * @returns {Map<string, ICustomNode> | undefined}
+     */
+    public getNodes (): Map <string, ICustomNode> | undefined {
+        if (!this.options.stringsArray) {
+            return;
+        }
+
+        if (this.options.rotateStringsArray) {
+            this.stringsArrayRotateValue = Utils.getRandomGenerator().integer({
+                min: 100,
+                max: 500
+            });
+        } else {
+            this.stringsArrayRotateValue = 0;
+        }
+
+        const stringsArray: StringsArray = new StringsArray();
+        const stringsArrayNode: ICustomNode = new StringsArrayNode(
+            stringsArray,
+            this.stringsArrayName,
+            this.stringsArrayRotateValue,
+            this.options
+        );
+        const customNodes: Map <string, ICustomNode> = new Map <string, ICustomNode> ([
+            [
+                'stringsArrayNode', stringsArrayNode,
+            ],
+            [
+                'stringsArrayCallsWrapper',
+                new StringsArrayCallsWrapper(
+                    this.stringsArrayCallsWrapper,
+                    this.stringsArrayName,
+                    stringsArray,
+                    this.options
+                )
+            ]
+        ]);
+
+        if (this.options.rotateStringsArray) {
+            customNodes.set(
+                'stringsArrayRotateFunctionNode',
+                new StringsArrayRotateFunctionNode(
+                    this.stringsArrayName,
+                    stringsArray,
+                    this.stringsArrayRotateValue,
+                    this.options
+                )
+            );
+        }
+
+        return this.syncCustomNodesWithNodesGroup(customNodes);
+    }
+}

+ 0 - 87
src/node-groups/UnicodeArrayNodesGroup.ts

@@ -1,87 +0,0 @@
-import { ICustomNode } from '../interfaces/custom-nodes/ICustomNode';
-
-import { AppendState } from '../enums/AppendState';
-
-import { UnicodeArrayCallsWrapper } from '../custom-nodes/unicode-array-nodes/UnicodeArrayCallsWrapper';
-import { UnicodeArrayNode } from '../custom-nodes/unicode-array-nodes/UnicodeArrayNode';
-import { UnicodeArrayRotateFunctionNode } from '../custom-nodes/unicode-array-nodes/UnicodeArrayRotateFunctionNode';
-
-import { AbstractNodesGroup } from './AbstractNodesGroup';
-import { UnicodeArray } from '../UnicodeArray';
-import { Utils } from '../Utils';
-
-export class UnicodeArrayNodesGroup extends AbstractNodesGroup {
-    /**
-     * @type {AppendState}
-     */
-    protected appendState: AppendState = AppendState.AfterObfuscation;
-
-    /**
-     * @type {string}
-     */
-    private unicodeArrayName: string = Utils.getRandomVariableName(UnicodeArrayNode.UNICODE_ARRAY_RANDOM_LENGTH);
-
-    /**
-     * @type {string}
-     */
-    private unicodeArrayCallsWrapper: string = Utils.getRandomVariableName(UnicodeArrayNode.UNICODE_ARRAY_RANDOM_LENGTH);
-
-    /**
-     * @type {number}
-     */
-    private unicodeArrayRotateValue: number;
-
-    /**
-     * @returns {Map<string, ICustomNode> | undefined}
-     */
-    public getNodes (): Map <string, ICustomNode> | undefined {
-        if (!this.options.unicodeArray) {
-            return;
-        }
-
-        if (this.options.rotateUnicodeArray) {
-            this.unicodeArrayRotateValue = Utils.getRandomGenerator().integer({
-                min: 100,
-                max: 500
-            });
-        } else {
-            this.unicodeArrayRotateValue = 0;
-        }
-
-        const unicodeArray: UnicodeArray = new UnicodeArray();
-        const unicodeArrayNode: ICustomNode = new UnicodeArrayNode(
-            unicodeArray,
-            this.unicodeArrayName,
-            this.unicodeArrayRotateValue,
-            this.options
-        );
-        const customNodes: Map <string, ICustomNode> = new Map <string, ICustomNode> ([
-            [
-                'unicodeArrayNode', unicodeArrayNode,
-            ],
-            [
-                'unicodeArrayCallsWrapper',
-                new UnicodeArrayCallsWrapper(
-                    this.unicodeArrayCallsWrapper,
-                    this.unicodeArrayName,
-                    unicodeArray,
-                    this.options
-                )
-            ]
-        ]);
-
-        if (this.options.rotateUnicodeArray) {
-            customNodes.set(
-                'unicodeArrayRotateFunctionNode',
-                new UnicodeArrayRotateFunctionNode(
-                    this.unicodeArrayName,
-                    unicodeArray,
-                    this.unicodeArrayRotateValue,
-                    this.options
-                )
-            );
-        }
-
-        return this.syncCustomNodesWithNodesGroup(customNodes);
-    }
-}

+ 2 - 2
src/node-obfuscators/ObjectExpressionObfuscator.ts

@@ -51,7 +51,7 @@ export class ObjectExpressionObfuscator extends AbstractNodeObfuscator {
     private obfuscateLiteralPropertyKey (node: ESTree.Literal): void {
     private obfuscateLiteralPropertyKey (node: ESTree.Literal): void {
         if (typeof node.value === 'string' && !node['x-verbatim-property']) {
         if (typeof node.value === 'string' && !node['x-verbatim-property']) {
             node['x-verbatim-property'] = {
             node['x-verbatim-property'] = {
-                content : Utils.stringToUnicode(node.value),
+                content : `'${Utils.stringToUnicodeEscapeSequence(node.value)}'`,
                 precedence: escodegen.Precedence.Primary
                 precedence: escodegen.Precedence.Primary
             };
             };
         }
         }
@@ -65,7 +65,7 @@ export class ObjectExpressionObfuscator extends AbstractNodeObfuscator {
             literalNode: ESTree.Literal = {
             literalNode: ESTree.Literal = {
                 raw: `'${nodeValue}'`,
                 raw: `'${nodeValue}'`,
                 'x-verbatim-property': {
                 'x-verbatim-property': {
-                    content : Utils.stringToUnicode(nodeValue),
+                    content : `'${Utils.stringToUnicodeEscapeSequence(nodeValue)}'`,
                     precedence: escodegen.Precedence.Primary
                     precedence: escodegen.Precedence.Primary
                 },
                 },
                 type: NodeType.Literal,
                 type: NodeType.Literal,

+ 31 - 29
src/node-obfuscators/replacers/StringLiteralReplacer.ts

@@ -1,18 +1,18 @@
-import { TUnicodeArrayCallsWrapper } from '../../types/custom-nodes/TUnicodeArrayCallsWrapper';
-import { TUnicodeArrayNode } from '../../types/custom-nodes/TUnicodeArrayNode';
+import { TStringsArrayCallsWrapper } from '../../types/custom-nodes/TStringsArrayCallsWrapper';
+import { TStringsArrayNode } from '../../types/custom-nodes/TStringsArrayNode';
 
 
-import { UnicodeArrayEncoding } from '../../enums/UnicodeArrayEncoding';
+import { StringsArrayEncoding } from '../../enums/StringsArrayEncoding';
 
 
 import { AbstractReplacer } from './AbstractReplacer';
 import { AbstractReplacer } from './AbstractReplacer';
 import { NumberLiteralReplacer } from './NumberLiteralReplacer';
 import { NumberLiteralReplacer } from './NumberLiteralReplacer';
-import { UnicodeArray } from '../../UnicodeArray';
+import { StringsArray } from '../../StringsArray';
 import { Utils } from '../../Utils';
 import { Utils } from '../../Utils';
 
 
 export class StringLiteralReplacer extends AbstractReplacer {
 export class StringLiteralReplacer extends AbstractReplacer {
     /**
     /**
      * @type {number}
      * @type {number}
      */
      */
-    private static minimumLengthForUnicodeArray: number = 3;
+    private static minimumLengthForStringsArray: number = 3;
 
 
     /**
     /**
      * @type {string[]}
      * @type {string[]}
@@ -25,71 +25,73 @@ export class StringLiteralReplacer extends AbstractReplacer {
      * @returns {string}
      * @returns {string}
      */
      */
     public replace (nodeValue: string): string {
     public replace (nodeValue: string): string {
-        const replaceWithUnicodeArrayFlag: boolean = (
-            nodeValue.length >= StringLiteralReplacer.minimumLengthForUnicodeArray
-            && Math.random() <= this.options.unicodeArrayThreshold
+        const replaceWithStringsArrayFlag: boolean = (
+            nodeValue.length >= StringLiteralReplacer.minimumLengthForStringsArray
+            && Math.random() <= this.options.stringsArrayThreshold
         );
         );
 
 
-        if (this.options.unicodeArray && replaceWithUnicodeArrayFlag) {
-            return this.replaceStringLiteralWithUnicodeArrayCall(nodeValue);
+        if (this.options.stringsArray && replaceWithStringsArrayFlag) {
+            return this.replaceStringLiteralWithStringsArrayCall(nodeValue);
         }
         }
 
 
-        return Utils.stringToUnicode(nodeValue);
+        return `'${Utils.stringToUnicodeEscapeSequence(nodeValue)}'`;
     }
     }
 
 
     /**
     /**
      * @param value
      * @param value
      * @returns {string}
      * @returns {string}
      */
      */
-    private replaceStringLiteralWithUnicodeArrayCall (value: string): string {
-        const unicodeArrayNode: TUnicodeArrayNode = <TUnicodeArrayNode>this.nodes.get('unicodeArrayNode');
+    private replaceStringLiteralWithStringsArrayCall (value: string): string {
+        const stringsArrayNode: TStringsArrayNode = <TStringsArrayNode>this.nodes.get('stringsArrayNode');
 
 
-        if (!unicodeArrayNode) {
-            throw new ReferenceError('`unicodeArrayNode` node is not found in Map with custom node.');
+        if (!stringsArrayNode) {
+            throw new ReferenceError('`stringsArrayNode` node is not found in Map with custom node.');
         }
         }
 
 
         let rc4Key: string = '';
         let rc4Key: string = '';
 
 
-        switch (this.options.unicodeArrayEncoding) {
-            case UnicodeArrayEncoding.base64:
+        switch (this.options.stringsArrayEncoding) {
+            case StringsArrayEncoding.base64:
                 value = Utils.btoa(value);
                 value = Utils.btoa(value);
 
 
                 break;
                 break;
 
 
-            case UnicodeArrayEncoding.rc4:
+            case StringsArrayEncoding.rc4:
                 rc4Key = Utils.getRandomGenerator().pickone(StringLiteralReplacer.rc4Keys);
                 rc4Key = Utils.getRandomGenerator().pickone(StringLiteralReplacer.rc4Keys);
                 value = Utils.btoa(Utils.rc4(value, rc4Key));
                 value = Utils.btoa(Utils.rc4(value, rc4Key));
 
 
                 break;
                 break;
         }
         }
 
 
-        value = Utils.stringToUnicode(value);
+        if (this.options.unicodeEscapeSequence) {
+            value = Utils.stringToUnicodeEscapeSequence(value);
+        }
 
 
-        let unicodeArray: UnicodeArray = unicodeArrayNode.getNodeData(),
-            indexOfExistingValue: number = unicodeArray.getIndexOf(value),
+        let stringsArray: StringsArray = stringsArrayNode.getNodeData(),
+            indexOfExistingValue: number = stringsArray.getIndexOf(value),
             indexOfValue: number,
             indexOfValue: number,
             hexadecimalIndex: string;
             hexadecimalIndex: string;
 
 
         if (indexOfExistingValue >= 0) {
         if (indexOfExistingValue >= 0) {
             indexOfValue = indexOfExistingValue;
             indexOfValue = indexOfExistingValue;
         } else {
         } else {
-            indexOfValue = unicodeArray.getLength();
-            unicodeArrayNode.updateNodeData(value);
+            indexOfValue = stringsArray.getLength();
+            stringsArrayNode.updateNodeData(value);
         }
         }
 
 
         hexadecimalIndex = new NumberLiteralReplacer(this.nodes, this.options)
         hexadecimalIndex = new NumberLiteralReplacer(this.nodes, this.options)
             .replace(indexOfValue);
             .replace(indexOfValue);
 
 
-        const unicodeArrayCallsWrapper: TUnicodeArrayCallsWrapper = <TUnicodeArrayCallsWrapper>this.nodes.get('unicodeArrayCallsWrapper');
+        const stringsArrayCallsWrapper: TStringsArrayCallsWrapper = <TStringsArrayCallsWrapper>this.nodes.get('stringsArrayCallsWrapper');
 
 
-        if (!unicodeArrayCallsWrapper) {
-            throw new ReferenceError('`unicodeArrayCallsWrapper` node is not found in Map with custom node.');
+        if (!stringsArrayCallsWrapper) {
+            throw new ReferenceError('`stringsArrayCallsWrapper` node is not found in Map with custom node.');
         }
         }
 
 
-        if (this.options.unicodeArrayEncoding === UnicodeArrayEncoding.rc4) {
-            return `${unicodeArrayCallsWrapper.getNodeIdentifier()}('${hexadecimalIndex}', ${Utils.stringToUnicode(rc4Key)})`;
+        if (this.options.stringsArrayEncoding === StringsArrayEncoding.rc4) {
+            return `${stringsArrayCallsWrapper.getNodeIdentifier()}('${hexadecimalIndex}', '${Utils.stringToUnicodeEscapeSequence(rc4Key)}')`;
         }
         }
 
 
-        return `${unicodeArrayCallsWrapper.getNodeIdentifier()}('${hexadecimalIndex}')`;
+        return `${stringsArrayCallsWrapper.getNodeIdentifier()}('${hexadecimalIndex}')`;
     }
     }
 }
 }

+ 12 - 6
src/options/Options.ts

@@ -18,7 +18,7 @@ import { IObfuscatorOptions } from '../interfaces/IObfuscatorOptions';
 import { IOptions } from '../interfaces/IOptions';
 import { IOptions } from '../interfaces/IOptions';
 
 
 import { TSourceMapMode } from '../types/TSourceMapMode';
 import { TSourceMapMode } from '../types/TSourceMapMode';
-import { TUnicodeArrayEncoding } from '../types/TUnicodeArrayEncoding';
+import { TStringsArrayEncoding } from '../types/TStringsArrayEncoding';
 
 
 import { DEFAULT_PRESET } from '../preset-options/DefaultPreset';
 import { DEFAULT_PRESET } from '../preset-options/DefaultPreset';
 
 
@@ -83,7 +83,7 @@ export class Options implements IOptions {
      * @type {boolean}
      * @type {boolean}
      */
      */
     @IsBoolean()
     @IsBoolean()
-    public readonly rotateUnicodeArray: boolean;
+    public readonly rotateStringsArray: boolean;
 
 
     /**
     /**
      * @type {boolean}
      * @type {boolean}
@@ -124,13 +124,13 @@ export class Options implements IOptions {
      * @type {boolean}
      * @type {boolean}
      */
      */
     @IsBoolean()
     @IsBoolean()
-    public readonly unicodeArray: boolean;
+    public readonly stringsArray: boolean;
 
 
     /**
     /**
-     * @type {TUnicodeArrayEncoding}
+     * @type {TStringsArrayEncoding}
      */
      */
     @IsIn([true, false, 'base64', 'rc4'])
     @IsIn([true, false, 'base64', 'rc4'])
-    public readonly unicodeArrayEncoding: TUnicodeArrayEncoding;
+    public readonly stringsArrayEncoding: TStringsArrayEncoding;
 
 
     /**
     /**
      * @type {number}
      * @type {number}
@@ -138,7 +138,13 @@ export class Options implements IOptions {
     @IsNumber()
     @IsNumber()
     @Min(0)
     @Min(0)
     @Max(1)
     @Max(1)
-    public readonly unicodeArrayThreshold: number;
+    public readonly stringsArrayThreshold: number;
+
+    /**
+     * @type {boolean}
+     */
+    @IsBoolean()
+    public readonly unicodeEscapeSequence: boolean;
 
 
     /**
     /**
      * @param obfuscatorOptions
      * @param obfuscatorOptions

+ 14 - 14
src/options/OptionsNormalizer.ts

@@ -10,10 +10,10 @@ export class OptionsNormalizer {
      * @type {IObfuscatorOptions}
      * @type {IObfuscatorOptions}
      */
      */
     private static DISABLED_UNICODE_ARRAY_OPTIONS: IObfuscatorOptions = {
     private static DISABLED_UNICODE_ARRAY_OPTIONS: IObfuscatorOptions = {
-        rotateUnicodeArray: false,
-        unicodeArray: false,
-        unicodeArrayEncoding: false,
-        unicodeArrayThreshold: 0
+        rotateStringsArray: false,
+        stringsArray: false,
+        stringsArrayEncoding: false,
+        stringsArrayThreshold: 0
     };
     };
 
 
     /**
     /**
@@ -28,7 +28,7 @@ export class OptionsNormalizer {
      * @type {IObfuscatorOptions}
      * @type {IObfuscatorOptions}
      */
      */
     private static UNICODE_ARRAY_ENCODING_OPTIONS: IObfuscatorOptions = {
     private static UNICODE_ARRAY_ENCODING_OPTIONS: IObfuscatorOptions = {
-        unicodeArrayEncoding: 'base64'
+        stringsArrayEncoding: 'base64'
     };
     };
 
 
     /**
     /**
@@ -39,9 +39,9 @@ export class OptionsNormalizer {
         OptionsNormalizer.selfDefendingRule,
         OptionsNormalizer.selfDefendingRule,
         OptionsNormalizer.sourceMapBaseUrl,
         OptionsNormalizer.sourceMapBaseUrl,
         OptionsNormalizer.sourceMapFileName,
         OptionsNormalizer.sourceMapFileName,
-        OptionsNormalizer.unicodeArrayRule,
-        OptionsNormalizer.unicodeArrayEncodingRule,
-        OptionsNormalizer.unicodeArrayThresholdRule,
+        OptionsNormalizer.stringsArrayRule,
+        OptionsNormalizer.stringsArrayEncodingRule,
+        OptionsNormalizer.stringsArrayThresholdRule,
     ];
     ];
 
 
     /**
     /**
@@ -138,8 +138,8 @@ export class OptionsNormalizer {
      * @param options
      * @param options
      * @returns {IOptions}
      * @returns {IOptions}
      */
      */
-    private static unicodeArrayRule (options: IOptions): IOptions {
-        if (!options.unicodeArray) {
+    private static stringsArrayRule (options: IOptions): IOptions {
+        if (!options.stringsArray) {
             Object.assign(options, OptionsNormalizer.DISABLED_UNICODE_ARRAY_OPTIONS);
             Object.assign(options, OptionsNormalizer.DISABLED_UNICODE_ARRAY_OPTIONS);
         }
         }
 
 
@@ -150,8 +150,8 @@ export class OptionsNormalizer {
      * @param options
      * @param options
      * @returns {IOptions}
      * @returns {IOptions}
      */
      */
-    private static unicodeArrayEncodingRule (options: IOptions): IOptions {
-        if (options.unicodeArrayEncoding === true) {
+    private static stringsArrayEncodingRule (options: IOptions): IOptions {
+        if (options.stringsArrayEncoding === true) {
             Object.assign(options, OptionsNormalizer.UNICODE_ARRAY_ENCODING_OPTIONS);
             Object.assign(options, OptionsNormalizer.UNICODE_ARRAY_ENCODING_OPTIONS);
         }
         }
 
 
@@ -162,8 +162,8 @@ export class OptionsNormalizer {
      * @param options
      * @param options
      * @returns {IOptions}
      * @returns {IOptions}
      */
      */
-    private static unicodeArrayThresholdRule (options: IOptions): IOptions {
-        if (options.unicodeArrayThreshold === 0) {
+    private static stringsArrayThresholdRule (options: IOptions): IOptions {
+        if (options.stringsArrayThreshold === 0) {
             Object.assign(options, OptionsNormalizer.DISABLED_UNICODE_ARRAY_OPTIONS);
             Object.assign(options, OptionsNormalizer.DISABLED_UNICODE_ARRAY_OPTIONS);
         }
         }
 
 

+ 5 - 4
src/preset-options/DefaultPreset.ts

@@ -9,13 +9,14 @@ export const DEFAULT_PRESET: IObfuscatorOptions = Object.freeze({
     disableConsoleOutput: true,
     disableConsoleOutput: true,
     domainLock: [],
     domainLock: [],
     reservedNames: [],
     reservedNames: [],
-    rotateUnicodeArray: true,
+    rotateStringsArray: true,
     selfDefending: true,
     selfDefending: true,
     sourceMap: false,
     sourceMap: false,
     sourceMapBaseUrl: '',
     sourceMapBaseUrl: '',
     sourceMapFileName: '',
     sourceMapFileName: '',
     sourceMapMode: SourceMapMode.Separate,
     sourceMapMode: SourceMapMode.Separate,
-    unicodeArray: true,
-    unicodeArrayEncoding: false,
-    unicodeArrayThreshold: 0.8
+    stringsArray: true,
+    stringsArrayEncoding: false,
+    stringsArrayThreshold: 0.8,
+    unicodeEscapeSequence: true
 });
 });

+ 5 - 4
src/preset-options/NoCustomNodesPreset.ts

@@ -9,13 +9,14 @@ export const NO_CUSTOM_NODES_PRESET: IObfuscatorOptions = Object.freeze({
     disableConsoleOutput: false,
     disableConsoleOutput: false,
     domainLock: [],
     domainLock: [],
     reservedNames: [],
     reservedNames: [],
-    rotateUnicodeArray: false,
+    rotateStringsArray: false,
     selfDefending: false,
     selfDefending: false,
     sourceMap: false,
     sourceMap: false,
     sourceMapBaseUrl: '',
     sourceMapBaseUrl: '',
     sourceMapFileName: '',
     sourceMapFileName: '',
     sourceMapMode: SourceMapMode.Separate,
     sourceMapMode: SourceMapMode.Separate,
-    unicodeArray: false,
-    unicodeArrayEncoding: false,
-    unicodeArrayThreshold: 0
+    stringsArray: false,
+    stringsArrayEncoding: false,
+    stringsArrayThreshold: 0,
+    unicodeEscapeSequence: true
 });
 });

+ 2 - 2
src/templates/custom-nodes/self-defending-nodes/self-defending-unicode-node/SelfDefendingTemplate.ts

@@ -15,13 +15,13 @@ export function SelfDefendingTemplate (): string {
                 };
                 };
                 
                 
             var test1 = function () {
             var test1 = function () {
-                var regExp = new RegExp(${Utils.stringToUnicode(`\\w+ *\\(\\) *{\\w+ *['|"].+['|"];? *}`)});
+                var regExp = new RegExp('${Utils.stringToUnicodeEscapeSequence(`\\w+ *\\(\\) *{\\w+ *['|"].+['|"];? *}`)}');
                 
                 
                 return !regExp.test(func1.toString());
                 return !regExp.test(func1.toString());
             };
             };
             
             
             var test2 = function () {
             var test2 = function () {
-                var regExp = new RegExp(${Utils.stringToUnicode(`(\\\\[x|u](\\w){2,4})+`)});
+                var regExp = new RegExp('${Utils.stringToUnicodeEscapeSequence(`(\\\\[x|u](\\w){2,4})+`)}');
                 
                 
                 return regExp.test(func2.toString());
                 return regExp.test(func2.toString());
             };
             };

+ 3 - 3
src/templates/custom-nodes/unicode-array-nodes/unicode-array-calls-wrapper/SelfDefendingTemplate.ts → src/templates/custom-nodes/strings-array-nodes/strings-array-calls-wrapper/SelfDefendingTemplate.ts

@@ -9,8 +9,8 @@ export function SelfDefendingTemplate (): string {
             this.rc4Bytes = rc4Bytes;
             this.rc4Bytes = rc4Bytes;
             this.states = [1, 0, 0];
             this.states = [1, 0, 0];
             this.newState = function(){return 'newState';};
             this.newState = function(){return 'newState';};
-            this.firstState = ${Utils.stringToUnicode(`\\w+ *\\(\\) *{\\w+ *`)};
-            this.secondState = ${Utils.stringToUnicode(`['|"].+['|"];? *}`)};
+            this.firstState = '${Utils.stringToUnicodeEscapeSequence(`\\w+ *\\(\\) *{\\w+ *`)}';
+            this.secondState = '${Utils.stringToUnicodeEscapeSequence(`['|"].+['|"];? *}`)}';
         };
         };
         
         
         StatesClass.prototype.checkState = function () {
         StatesClass.prototype.checkState = function () {
@@ -36,6 +36,6 @@ export function SelfDefendingTemplate (): string {
             return rc4Bytes(this.states[0]);
             return rc4Bytes(this.states[0]);
         };
         };
 
 
-        new StatesClass({unicodeArrayCallsWrapperName}).checkState();
+        new StatesClass({stringsArrayCallsWrapperName}).checkState();
     `;
     `;
 }
 }

+ 11 - 11
src/templates/custom-nodes/unicode-array-nodes/unicode-array-calls-wrapper/UnicodeArrayBase64DecodeNodeTemplate.ts → src/templates/custom-nodes/strings-array-nodes/strings-array-calls-wrapper/StringsArrayBase64DecodeNodeTemplate.ts

@@ -1,16 +1,16 @@
 /**
 /**
  * @returns {string}
  * @returns {string}
  */
  */
-export function UnicodeArrayBase64DecodeNodeTemplate (): string {
+export function StringsArrayBase64DecodeNodeTemplate (): string {
     return `      
     return `      
-        if (!{unicodeArrayCallsWrapperName}.atobPolyfillAppended) {
+        if (!{stringsArrayCallsWrapperName}.atobPolyfillAppended) {
             {atobPolyfill}
             {atobPolyfill}
             
             
-            {unicodeArrayCallsWrapperName}.atobPolyfillAppended = true;
+            {stringsArrayCallsWrapperName}.atobPolyfillAppended = true;
         }
         }
         
         
-        if (!{unicodeArrayCallsWrapperName}.base64DecodeUnicode) {                
-            {unicodeArrayCallsWrapperName}.base64DecodeUnicode = function (str) {
+        if (!{stringsArrayCallsWrapperName}.base64DecodeUnicode) {                
+            {stringsArrayCallsWrapperName}.base64DecodeUnicode = function (str) {
                 var string = atob(str);
                 var string = atob(str);
                 var newStringChars = [];
                 var newStringChars = [];
                 
                 
@@ -22,17 +22,17 @@ export function UnicodeArrayBase64DecodeNodeTemplate (): string {
             };
             };
         }
         }
         
         
-        if (!{unicodeArrayCallsWrapperName}.data) {
-            {unicodeArrayCallsWrapperName}.data = {};
+        if (!{stringsArrayCallsWrapperName}.data) {
+            {stringsArrayCallsWrapperName}.data = {};
         }
         }
                         
                         
-        if (!{unicodeArrayCallsWrapperName}.data[index]) {
+        if (!{stringsArrayCallsWrapperName}.data[index]) {
             {selfDefendingCode}
             {selfDefendingCode}
             
             
-            value = {unicodeArrayCallsWrapperName}.base64DecodeUnicode(value);
-            {unicodeArrayCallsWrapperName}.data[index] = value;
+            value = {stringsArrayCallsWrapperName}.base64DecodeUnicode(value);
+            {stringsArrayCallsWrapperName}.data[index] = value;
         } else {
         } else {
-            value = {unicodeArrayCallsWrapperName}.data[index];
+            value = {stringsArrayCallsWrapperName}.data[index];
         }  
         }  
     `;
     `;
 }
 }

+ 3 - 3
src/templates/custom-nodes/unicode-array-nodes/unicode-array-calls-wrapper/UnicodeArrayCallsWrapperTemplate.ts → src/templates/custom-nodes/strings-array-nodes/strings-array-calls-wrapper/StringsArrayCallsWrapperTemplate.ts

@@ -1,11 +1,11 @@
 /**
 /**
  * @returns {string}
  * @returns {string}
  */
  */
-export function UnicodeArrayCallsWrapperTemplate (): string {
+export function StringsArrayCallsWrapperTemplate (): string {
     return `
     return `
-        var {unicodeArrayCallsWrapperName} = function (index, key) {
+        var {stringsArrayCallsWrapperName} = function (index, key) {
             var index = parseInt(index, 0x10);
             var index = parseInt(index, 0x10);
-            var value = {unicodeArrayName}[index];
+            var value = {stringsArrayName}[index];
             
             
             {decodeNodeTemplate}
             {decodeNodeTemplate}
         
         

+ 35 - 0
src/templates/custom-nodes/strings-array-nodes/strings-array-calls-wrapper/StringsArrayRC4DecodeNodeTemplate.ts

@@ -0,0 +1,35 @@
+/**
+ * @returns {string}
+ */
+export function StringsArrayRc4DecodeNodeTemplate (): string {
+    return `
+        if (!{stringsArrayCallsWrapperName}.atobPolyfillAppended) {            
+            {atobPolyfill}
+            
+            {stringsArrayCallsWrapperName}.atobPolyfillAppended = true;
+        }
+        
+        if (!{stringsArrayCallsWrapperName}.rc4) {            
+            {rc4Polyfill}
+            
+            {stringsArrayCallsWrapperName}.rc4 = rc4;
+        }
+                        
+        if (!{stringsArrayCallsWrapperName}.data) {
+            {stringsArrayCallsWrapperName}.data = {};
+        }
+
+        if ({stringsArrayCallsWrapperName}.data[index] === undefined) {
+            if (!{stringsArrayCallsWrapperName}.once) {
+                {selfDefendingCode}
+                
+                {stringsArrayCallsWrapperName}.once = true;
+            }
+            
+            value = {stringsArrayCallsWrapperName}.rc4(value, key);
+            {stringsArrayCallsWrapperName}.data[index] = value;
+        } else {
+            value = {stringsArrayCallsWrapperName}.data[index];
+        }
+    `;
+}

+ 8 - 0
src/templates/custom-nodes/strings-array-nodes/strings-array-node/StringsArrayTemplate.ts

@@ -0,0 +1,8 @@
+/**
+ * @returns {string}
+ */
+export function StringsArrayTemplate (): string {
+    return `
+        var {stringsArrayName} = [{stringsArray}];
+    `;
+}

+ 1 - 1
src/templates/custom-nodes/unicode-array-nodes/unicode-array-rotate-function-node/SelfDefendingTemplate.ts → src/templates/custom-nodes/strings-array-nodes/strings-array-rotate-function-node/SelfDefendingTemplate.ts

@@ -55,7 +55,7 @@ export function SelfDefendingTemplate (): string {
             };
             };
             
             
             var test1 = function () {
             var test1 = function () {
-                var regExp = new RegExp(${Utils.stringToUnicode(`\\w+ *\\(\\) *{\\w+ *['|"].+['|"];? *}`)});
+                var regExp = new RegExp('${Utils.stringToUnicodeEscapeSequence(`\\w+ *\\(\\) *{\\w+ *['|"].+['|"];? *}`)}');
                 
                 
                 return regExp.test(object.removeCookie.toString());
                 return regExp.test(object.removeCookie.toString());
             };
             };

+ 2 - 2
src/templates/custom-nodes/unicode-array-nodes/unicode-array-rotate-function-node/UnicodeArrayRotateFunctionTemplate.ts → src/templates/custom-nodes/strings-array-nodes/strings-array-rotate-function-node/StringsArrayRotateFunctionTemplate.ts

@@ -1,7 +1,7 @@
 /**
 /**
  * @returns {string}
  * @returns {string}
  */
  */
-export function UnicodeArrayRotateFunctionTemplate (): string {
+export function StringsArrayRotateFunctionTemplate (): string {
     return `
     return `
         (function (array, {timesName}) {
         (function (array, {timesName}) {
             var {whileFunctionName} = function (times) {
             var {whileFunctionName} = function (times) {
@@ -11,6 +11,6 @@ export function UnicodeArrayRotateFunctionTemplate (): string {
             };
             };
             
             
             {code}
             {code}
-        })({unicodeArrayName}, 0x{unicodeArrayRotateValue});
+        })({stringsArrayName}, 0x{stringsArrayRotateValue});
     `;
     `;
 }
 }

+ 0 - 35
src/templates/custom-nodes/unicode-array-nodes/unicode-array-calls-wrapper/UnicodeArrayRC4DecodeNodeTemplate.ts

@@ -1,35 +0,0 @@
-/**
- * @returns {string}
- */
-export function UnicodeArrayRc4DecodeNodeTemplate (): string {
-    return `
-        if (!{unicodeArrayCallsWrapperName}.atobPolyfillAppended) {            
-            {atobPolyfill}
-            
-            {unicodeArrayCallsWrapperName}.atobPolyfillAppended = true;
-        }
-        
-        if (!{unicodeArrayCallsWrapperName}.rc4) {            
-            {rc4Polyfill}
-            
-            {unicodeArrayCallsWrapperName}.rc4 = rc4;
-        }
-                        
-        if (!{unicodeArrayCallsWrapperName}.data) {
-            {unicodeArrayCallsWrapperName}.data = {};
-        }
-
-        if ({unicodeArrayCallsWrapperName}.data[index] === undefined) {
-            if (!{unicodeArrayCallsWrapperName}.once) {
-                {selfDefendingCode}
-                
-                {unicodeArrayCallsWrapperName}.once = true;
-            }
-            
-            value = {unicodeArrayCallsWrapperName}.rc4(value, key);
-            {unicodeArrayCallsWrapperName}.data[index] = value;
-        } else {
-            value = {unicodeArrayCallsWrapperName}.data[index];
-        }
-    `;
-}

+ 0 - 8
src/templates/custom-nodes/unicode-array-nodes/unicode-array-node/UnicodeArrayTemplate.ts

@@ -1,8 +0,0 @@
-/**
- * @returns {string}
- */
-export function UnicodeArrayTemplate (): string {
-    return `
-        var {unicodeArrayName} = [{unicodeArray}];
-    `;
-}

+ 1 - 0
src/types/TStringsArrayEncoding.ts

@@ -0,0 +1 @@
+export type TStringsArrayEncoding = boolean|'base64'|'rc4';

+ 0 - 1
src/types/TUnicodeArrayEncoding.ts

@@ -1 +0,0 @@
-export type TUnicodeArrayEncoding = boolean|'base64'|'rc4';

+ 1 - 1
src/types/custom-nodes/TUnicodeArrayCallsWrapper.d.ts → src/types/custom-nodes/TStringsArrayCallsWrapper.d.ts

@@ -1,3 +1,3 @@
 import { ICustomNodeWithIdentifier } from '../../interfaces/custom-nodes/ICustomNodeWithIdentifier';
 import { ICustomNodeWithIdentifier } from '../../interfaces/custom-nodes/ICustomNodeWithIdentifier';
 
 
-export type TUnicodeArrayCallsWrapper = ICustomNodeWithIdentifier;
+export type TStringsArrayCallsWrapper = ICustomNodeWithIdentifier;

+ 1 - 1
src/types/custom-nodes/TUnicodeArrayNode.d.ts → src/types/custom-nodes/TStringsArrayNode.d.ts

@@ -1,4 +1,4 @@
 import { ICustomNodeWithData } from '../../interfaces/custom-nodes/ICustomNodeWithData';
 import { ICustomNodeWithData } from '../../interfaces/custom-nodes/ICustomNodeWithData';
 import { ICustomNodeWithIdentifier } from '../../interfaces/custom-nodes/ICustomNodeWithIdentifier';
 import { ICustomNodeWithIdentifier } from '../../interfaces/custom-nodes/ICustomNodeWithIdentifier';
 
 
-export type TUnicodeArrayNode = ICustomNodeWithData & ICustomNodeWithIdentifier;
+export type TStringsArrayNode = ICustomNodeWithData & ICustomNodeWithIdentifier;

+ 2 - 2
test/dev/dev.ts

@@ -70,8 +70,8 @@ if (!(<any>global)._babelPolyfill) {
     `,
     `,
         {
         {
             disableConsoleOutput: false,
             disableConsoleOutput: false,
-            unicodeArrayEncoding: 'rc4',
-            selfDefending: true
+            selfDefending: true,
+            stringsArrayEncoding: 'rc4'
         }
         }
     ).getObfuscatedCode();
     ).getObfuscatedCode();
 
 

+ 4 - 4
test/functional-tests/JavaScriptObfuscator.spec.ts

@@ -107,15 +107,15 @@ describe('JavaScriptObfuscator', () => {
                 obfuscatedCode1: string = JavaScriptObfuscator.obfuscate(
                 obfuscatedCode1: string = JavaScriptObfuscator.obfuscate(
                     `var test = 'abc';`,
                     `var test = 'abc';`,
                     Object.assign({}, NO_CUSTOM_NODES_PRESET, {
                     Object.assign({}, NO_CUSTOM_NODES_PRESET, {
-                        unicodeArray: true,
-                        unicodeArrayThreshold: 1
+                        stringsArray: true,
+                        stringsArrayThreshold: 1
                     })
                     })
                 ).getObfuscatedCode(),
                 ).getObfuscatedCode(),
                 obfuscatedCode2: string = JavaScriptObfuscator.obfuscate(
                 obfuscatedCode2: string = JavaScriptObfuscator.obfuscate(
                     `var test = 'абц';`,
                     `var test = 'абц';`,
                     Object.assign({}, NO_CUSTOM_NODES_PRESET, {
                     Object.assign({}, NO_CUSTOM_NODES_PRESET, {
-                        unicodeArray: true,
-                        unicodeArrayThreshold: 1
+                        stringsArray: true,
+                        stringsArrayThreshold: 1
                     })
                     })
                 ).getObfuscatedCode();
                 ).getObfuscatedCode();
 
 

+ 3 - 3
test/functional-tests/custom-nodes/console-output-nodes/ConsoleOutputDisableExpressionNode.spec.ts

@@ -9,7 +9,7 @@ const assert: Chai.AssertStatic = require('chai').assert;
 describe('ConsoleOutputDisableExpressionNode', () => {
 describe('ConsoleOutputDisableExpressionNode', () => {
     const regExp = /(_0x([a-z0-9]){4,6}\['(\\x[a-f0-9]*)*'\]\['(\\x[a-f0-9]*)*'\] *= *_0x([a-z0-9]){4,6};){4}/;
     const regExp = /(_0x([a-z0-9]){4,6}\['(\\x[a-f0-9]*)*'\]\['(\\x[a-f0-9]*)*'\] *= *_0x([a-z0-9]){4,6};){4}/;
 
 
-    it('should correctly appendNodeToOptimalBlockScope `ConsoleOutputDisableExpressionNode` custom node into the obfuscated code if `disableConsoleOutput` option is set', () => {
+    it('should correctly append `ConsoleOutputDisableExpressionNode` custom node into the obfuscated code if `disableConsoleOutput` option is set', () => {
         let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
         let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
             `var test = 'test';`,
             `var test = 'test';`,
             Object.assign({}, NO_CUSTOM_NODES_PRESET, {
             Object.assign({}, NO_CUSTOM_NODES_PRESET, {
@@ -20,12 +20,12 @@ describe('ConsoleOutputDisableExpressionNode', () => {
         assert.match(obfuscationResult.getObfuscatedCode(), regExp);
         assert.match(obfuscationResult.getObfuscatedCode(), regExp);
     });
     });
 
 
-    it('should\'t appendNodeToOptimalBlockScope `ConsoleOutputDisableExpressionNode` custom node into the obfuscated code if `disableConsoleOutput` option is not set', () => {
+    it('should\'t append `ConsoleOutputDisableExpressionNode` custom node into the obfuscated code if `disableConsoleOutput` option is not set', () => {
         let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
         let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
             `var test = 'test';`,
             `var test = 'test';`,
             Object.assign({}, NO_CUSTOM_NODES_PRESET, {
             Object.assign({}, NO_CUSTOM_NODES_PRESET, {
                 disableConsoleOutput: false,
                 disableConsoleOutput: false,
-                unicodeArrayThreshold: 1
+                stringsArrayThreshold: 1
             })
             })
         );
         );
 
 

+ 2 - 2
test/functional-tests/custom-nodes/domain-lock-nodes/DomainLockNode.spec.ts

@@ -7,7 +7,7 @@ import { JavaScriptObfuscator } from '../../../../src/JavaScriptObfuscator';
 const assert: Chai.AssertStatic = require('chai').assert;
 const assert: Chai.AssertStatic = require('chai').assert;
 
 
 describe('DomainLockNode', () => {
 describe('DomainLockNode', () => {
-    it('should correctly appendNodeToOptimalBlockScope `DomainLockNode` custom node into the obfuscated code if `domainLock` option is set', () => {
+    it('should correctly append `DomainLockNode` custom node into the obfuscated code if `domainLock` option is set', () => {
         let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
         let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
             `var test = 'test';`,
             `var test = 'test';`,
             Object.assign({}, NO_CUSTOM_NODES_PRESET, {
             Object.assign({}, NO_CUSTOM_NODES_PRESET, {
@@ -18,7 +18,7 @@ describe('DomainLockNode', () => {
         assert.match(obfuscationResult.getObfuscatedCode(), /var _0x([a-z0-9]){4,6} *= *new RegExp/);
         assert.match(obfuscationResult.getObfuscatedCode(), /var _0x([a-z0-9]){4,6} *= *new RegExp/);
     });
     });
 
 
-    it('should\'t appendNodeToOptimalBlockScope `DomainLockNode` custom node into the obfuscated code if `domainLock` option is not set', () => {
+    it('should\'t append `DomainLockNode` custom node into the obfuscated code if `domainLock` option is not set', () => {
         let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
         let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
             `var test = 'test';`,
             `var test = 'test';`,
             Object.assign({}, NO_CUSTOM_NODES_PRESET, {
             Object.assign({}, NO_CUSTOM_NODES_PRESET, {

+ 5 - 5
test/functional-tests/custom-nodes/unicode-array-nodes/UnicodeArrayCallsWrapper.spec.ts → test/functional-tests/custom-nodes/strings-array-nodes/StringsArrayCallsWrapper.spec.ts

@@ -6,14 +6,14 @@ import { JavaScriptObfuscator } from '../../../../src/JavaScriptObfuscator';
 
 
 const assert: Chai.AssertStatic = require('chai').assert;
 const assert: Chai.AssertStatic = require('chai').assert;
 
 
-describe('UnicodeArrayCallsWrapper', () => {
-    it('should correctly appendNodeToOptimalBlockScope `UnicodeArrayCallsWrapper` custom node into the obfuscated code', () => {
+describe('StringsArrayCallsWrapper', () => {
+    it('should correctly append `StringsArrayCallsWrapper` custom node into the obfuscated code', () => {
         let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
         let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
             `var test = 'test';`,
             `var test = 'test';`,
             Object.assign({}, NO_CUSTOM_NODES_PRESET, {
             Object.assign({}, NO_CUSTOM_NODES_PRESET, {
-                unicodeArray: true,
-                unicodeArrayThreshold: 1,
-                wrapUnicodeArrayCalls: true
+                stringsArray: true,
+                stringsArrayThreshold: 1,
+                wrapStringsArrayCalls: true
             })
             })
         );
         );
 
 

+ 6 - 6
test/functional-tests/custom-nodes/unicode-array-nodes/UnicodeArrayNode.spec.ts → test/functional-tests/custom-nodes/strings-array-nodes/StringsArrayNode.spec.ts

@@ -6,24 +6,24 @@ import { JavaScriptObfuscator } from '../../../../src/JavaScriptObfuscator';
 
 
 const assert: Chai.AssertStatic = require('chai').assert;
 const assert: Chai.AssertStatic = require('chai').assert;
 
 
-describe('UnicodeArrayNode', () => {
-    it('should correctly appendNodeToOptimalBlockScope `UnicodeArrayNode` custom node into the obfuscated code if `unicodeArray` option is set', () => {
+describe('StringsArrayNode', () => {
+    it('should correctly append `StringsArrayNode` custom node into the obfuscated code if `stringsArray` option is set', () => {
         let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
         let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
             `var test = 'test';`,
             `var test = 'test';`,
             Object.assign({}, NO_CUSTOM_NODES_PRESET, {
             Object.assign({}, NO_CUSTOM_NODES_PRESET, {
-                unicodeArray: true,
-                unicodeArrayThreshold: 1
+                stringsArray: true,
+                stringsArrayThreshold: 1
             })
             })
         );
         );
 
 
         assert.match(obfuscationResult.getObfuscatedCode(), /^var _0x([a-z0-9]){4} *= *\[/);
         assert.match(obfuscationResult.getObfuscatedCode(), /^var _0x([a-z0-9]){4} *= *\[/);
     });
     });
 
 
-    it('should\'t appendNodeToOptimalBlockScope `UnicodeArrayNode` custom node into the obfuscated code if `unicodeArray` option is not set', () => {
+    it('should\'t append `StringsArrayNode` custom node into the obfuscated code if `stringsArray` option is not set', () => {
         let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
         let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
             `var test = 'test';`,
             `var test = 'test';`,
             Object.assign({}, NO_CUSTOM_NODES_PRESET, {
             Object.assign({}, NO_CUSTOM_NODES_PRESET, {
-                unicodeArray: false
+                stringsArray: false
             })
             })
         );
         );
 
 

+ 9 - 9
test/functional-tests/custom-nodes/unicode-array-nodes/UnicodeArrayRotateFunctionNode.spec.ts → test/functional-tests/custom-nodes/strings-array-nodes/StringsArrayRotateFunctionNode.spec.ts

@@ -6,27 +6,27 @@ import { JavaScriptObfuscator } from '../../../../src/JavaScriptObfuscator';
 
 
 const assert: Chai.AssertStatic = require('chai').assert;
 const assert: Chai.AssertStatic = require('chai').assert;
 
 
-describe('UnicodeArrayRotateFunctionNode', () => {
-    it('should correctly appendNodeToOptimalBlockScope `UnicodeArrayRotateFunctionNode` custom node into the obfuscated code if `rotateUnicodeArray` option is set', () => {
+describe('StringsArrayRotateFunctionNode', () => {
+    it('should correctly append `StringsArrayRotateFunctionNode` custom node into the obfuscated code if `rotateStringsArray` option is set', () => {
         let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
         let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
             `var test = 'test';`,
             `var test = 'test';`,
             Object.assign({}, NO_CUSTOM_NODES_PRESET, {
             Object.assign({}, NO_CUSTOM_NODES_PRESET, {
-                rotateUnicodeArray: true,
-                unicodeArray: true,
-                unicodeArrayThreshold: 1
+                rotateStringsArray: true,
+                stringsArray: true,
+                stringsArrayThreshold: 1
             })
             })
         );
         );
 
 
         assert.match(obfuscationResult.getObfuscatedCode(), /while *\(-- *_0x([a-z0-9]){4,6}\) *\{/);
         assert.match(obfuscationResult.getObfuscatedCode(), /while *\(-- *_0x([a-z0-9]){4,6}\) *\{/);
     });
     });
 
 
-    it('should\'t appendNodeToOptimalBlockScope `UnicodeArrayRotateFunctionNode` custom node into the obfuscated code if `rotateUnicodeArray` option is not set', () => {
+    it('should\'t append `StringsArrayRotateFunctionNode` custom node into the obfuscated code if `rotateStringsArray` option is not set', () => {
         let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
         let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
             `var test = 'test';`,
             `var test = 'test';`,
             Object.assign({}, NO_CUSTOM_NODES_PRESET, {
             Object.assign({}, NO_CUSTOM_NODES_PRESET, {
-                rotateUnicodeArray: false,
-                unicodeArray: true,
-                unicodeArrayThreshold: 1
+                rotateStringsArray: false,
+                stringsArray: true,
+                stringsArrayThreshold: 1
             })
             })
         );
         );
 
 

+ 33 - 16
test/functional-tests/node-obfuscators/LiteralObfuscator.spec.ts

@@ -8,7 +8,7 @@ const assert: Chai.AssertStatic = require('chai').assert;
 
 
 describe('LiteralObfuscator', () => {
 describe('LiteralObfuscator', () => {
     describe('obfuscation of literal node with string value', () => {
     describe('obfuscation of literal node with string value', () => {
-        it('should replace literal node value with unicode value without encoding', () => {
+        it('should replace literal node value with unicode escape sequence', () => {
             let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
             let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
                 `var test = 'test';`,
                 `var test = 'test';`,
                 Object.assign({}, NO_CUSTOM_NODES_PRESET)
                 Object.assign({}, NO_CUSTOM_NODES_PRESET)
@@ -17,12 +17,12 @@ describe('LiteralObfuscator', () => {
             assert.match(obfuscationResult.getObfuscatedCode(),  /^var *test *= *'\\x74\\x65\\x73\\x74';$/);
             assert.match(obfuscationResult.getObfuscatedCode(),  /^var *test *= *'\\x74\\x65\\x73\\x74';$/);
         });
         });
 
 
-        it('should replace literal node value with unicode array value', () => {
+        it('should replace literal node value with unicode escape sequence from unicode array', () => {
             let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
             let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
                 `var test = 'test';`,
                 `var test = 'test';`,
                 Object.assign({}, NO_CUSTOM_NODES_PRESET, {
                 Object.assign({}, NO_CUSTOM_NODES_PRESET, {
-                    unicodeArray: true,
-                    unicodeArrayThreshold: 1
+                    stringsArray: true,
+                    stringsArrayThreshold: 1
                 })
                 })
             );
             );
 
 
@@ -33,12 +33,29 @@ describe('LiteralObfuscator', () => {
             assert.match(obfuscationResult.getObfuscatedCode(),  /var *test *= *_0x([a-z0-9]){4}\('0x0'\);/);
             assert.match(obfuscationResult.getObfuscatedCode(),  /var *test *= *_0x([a-z0-9]){4}\('0x0'\);/);
         });
         });
 
 
+        it('should replace literal node value with raw value from unicode array if `unicodeEscapeSequence` is disabled', () => {
+            let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
+                `var test = 'test';`,
+                Object.assign({}, NO_CUSTOM_NODES_PRESET, {
+                    stringsArray: true,
+                    stringsArrayThreshold: 1,
+                    unicodeEscapeSequence: false
+                })
+            );
+
+            assert.match(
+                obfuscationResult.getObfuscatedCode(),
+                /^var *_0x([a-z0-9]){4} *= *\['test'\];/
+            );
+            assert.match(obfuscationResult.getObfuscatedCode(),  /var *test *= *_0x([a-z0-9]){4}\('0x0'\);/);
+        });
+
         it('shouldn\'t replace short literal node value with unicode array value', () => {
         it('shouldn\'t replace short literal node value with unicode array value', () => {
             let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
             let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
                 `var test = 'te';`,
                 `var test = 'te';`,
                 Object.assign({}, NO_CUSTOM_NODES_PRESET, {
                 Object.assign({}, NO_CUSTOM_NODES_PRESET, {
-                    unicodeArray: true,
-                    unicodeArrayThreshold: 1
+                    stringsArray: true,
+                    stringsArrayThreshold: 1
                 })
                 })
             );
             );
 
 
@@ -49,9 +66,9 @@ describe('LiteralObfuscator', () => {
             let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
             let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
                 `var test = 'test';`,
                 `var test = 'test';`,
                 Object.assign({}, NO_CUSTOM_NODES_PRESET, {
                 Object.assign({}, NO_CUSTOM_NODES_PRESET, {
-                    unicodeArray: true,
-                    unicodeArrayEncoding: 'base64',
-                    unicodeArrayThreshold: 1
+                    stringsArray: true,
+                    stringsArrayEncoding: 'base64',
+                    stringsArrayThreshold: 1
                 })
                 })
             );
             );
 
 
@@ -66,9 +83,9 @@ describe('LiteralObfuscator', () => {
             let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
             let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
                 `var test = 'test';`,
                 `var test = 'test';`,
                 Object.assign({}, NO_CUSTOM_NODES_PRESET, {
                 Object.assign({}, NO_CUSTOM_NODES_PRESET, {
-                    unicodeArray: true,
-                    unicodeArrayEncoding: 'rc4',
-                    unicodeArrayThreshold: 1
+                    stringsArray: true,
+                    stringsArrayEncoding: 'rc4',
+                    stringsArrayThreshold: 1
                 })
                 })
             );
             );
 
 
@@ -83,8 +100,8 @@ describe('LiteralObfuscator', () => {
         let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
         let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
             `var test = true;`,
             `var test = true;`,
             Object.assign({}, NO_CUSTOM_NODES_PRESET, {
             Object.assign({}, NO_CUSTOM_NODES_PRESET, {
-                unicodeArray: true,
-                unicodeArrayThreshold: 1
+                stringsArray: true,
+                stringsArrayThreshold: 1
             })
             })
         );
         );
 
 
@@ -95,8 +112,8 @@ describe('LiteralObfuscator', () => {
         let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
         let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
             `var test = 0;`,
             `var test = 0;`,
             Object.assign({}, NO_CUSTOM_NODES_PRESET, {
             Object.assign({}, NO_CUSTOM_NODES_PRESET, {
-                unicodeArray: true,
-                unicodeArrayThreshold: 1
+                stringsArray: true,
+                stringsArrayThreshold: 1
             })
             })
         );
         );
 
 

+ 4 - 4
test/functional-tests/node-obfuscators/MemberExpressionObfuscator.spec.ts

@@ -21,8 +21,8 @@ describe('MemberExpressionObfuscator', () => {
             let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
             let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
                 `var test = console.log;`,
                 `var test = console.log;`,
                 Object.assign({}, NO_CUSTOM_NODES_PRESET, {
                 Object.assign({}, NO_CUSTOM_NODES_PRESET, {
-                    unicodeArray: true,
-                    unicodeArrayThreshold: 1
+                    stringsArray: true,
+                    stringsArrayThreshold: 1
                 })
                 })
             );
             );
 
 
@@ -36,8 +36,8 @@ describe('MemberExpressionObfuscator', () => {
             let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
             let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
                 `var test = console['log'];`,
                 `var test = console['log'];`,
                 Object.assign({}, NO_CUSTOM_NODES_PRESET, {
                 Object.assign({}, NO_CUSTOM_NODES_PRESET, {
-                    unicodeArray: true,
-                    unicodeArrayThreshold: 1
+                    stringsArray: true,
+                    stringsArrayThreshold: 1
                 })
                 })
             );
             );
 
 

+ 2 - 2
test/functional-tests/node-obfuscators/MethodDefinitionObfuscator.spec.ts

@@ -27,8 +27,8 @@ describe('MethodDefinitionObfuscator', () => {
         let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
         let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
             code,
             code,
             Object.assign({}, NO_CUSTOM_NODES_PRESET, {
             Object.assign({}, NO_CUSTOM_NODES_PRESET, {
-                unicodeArray: true,
-                unicodeArrayThreshold: 1
+                stringsArray: true,
+                stringsArrayThreshold: 1
             })
             })
         );
         );
 
 

+ 93 - 0
test/functional-tests/templates/custom-nodes/strings-array-nodes/StringsArrayCallsWrapperNodeTemplate.spec.ts

@@ -0,0 +1,93 @@
+import 'format-unicorn';
+
+import { AtobTemplate } from '../../../../../src/templates/custom-nodes/AtobTemplate';
+import { Rc4Template } from '../../../../../src/templates/custom-nodes/Rc4Template';
+import { StringsArrayBase64DecodeNodeTemplate } from '../../../../../src/templates/custom-nodes/strings-array-nodes/strings-array-calls-wrapper/StringsArrayBase64DecodeNodeTemplate';
+import { StringsArrayCallsWrapperTemplate } from '../../../../../src/templates/custom-nodes/strings-array-nodes/strings-array-calls-wrapper/StringsArrayCallsWrapperTemplate';
+import { StringsArrayRc4DecodeNodeTemplate } from '../../../../../src/templates/custom-nodes/strings-array-nodes/strings-array-calls-wrapper/StringsArrayRC4DecodeNodeTemplate';
+
+import { Utils } from '../../../../../src/Utils';
+
+const assert: Chai.AssertStatic = require('chai').assert;
+
+/**
+ * @param templateData
+ * @param stringsArrayName
+ * @param stringsArrayCallsWrapperName
+ * @param index
+ * @returns {Function}
+ */
+function getFunctionFromTemplateBase64Encoding (
+    templateData: any,
+    stringsArrayName: string,
+    stringsArrayCallsWrapperName: string,
+    index: string
+) {
+    let stringsArrayCallsWrapperTemplate: string = StringsArrayCallsWrapperTemplate().formatUnicorn(templateData);
+
+    return Function(`
+        var ${stringsArrayName} = ['${Utils.btoa('test1')}'];
+    
+        ${stringsArrayCallsWrapperTemplate}
+        
+        return ${stringsArrayCallsWrapperName}(${index});
+    `)();
+}
+
+/**
+ * @param templateData
+ * @param stringsArrayName
+ * @param stringsArrayCallsWrapperName
+ * @param index
+ * @param key
+ * @returns {Function}
+ */
+function getFunctionFromTemplateRc4Encoding (
+    templateData: any,
+    stringsArrayName: string,
+    stringsArrayCallsWrapperName: string,
+    index: string,
+    key: string
+) {
+    let stringsArrayCallsWrapperTemplate: string = StringsArrayCallsWrapperTemplate().formatUnicorn(templateData);
+
+    return Function(`
+        var ${stringsArrayName} = ['${Utils.btoa(Utils.rc4('test1', key))}'];
+    
+        ${stringsArrayCallsWrapperTemplate}
+        
+        return ${stringsArrayCallsWrapperName}('${index}', '${key}');
+    `)();
+}
+
+describe('StringsArrayCallsWrapperNodeTemplate (): string', () => {
+    let stringsArrayName: string = 'stringsArrayName',
+        stringsArrayCallsWrapperName: string = 'stringsArrayCallsWrapperName',
+        atobDecodeNodeTemplate: string = StringsArrayBase64DecodeNodeTemplate().formatUnicorn({
+            atobPolyfill: AtobTemplate(),
+            selfDefendingCode: '',
+            stringsArrayCallsWrapperName
+        }),
+        rc4DecodeNodeTemplate: string = StringsArrayRc4DecodeNodeTemplate().formatUnicorn({
+            atobPolyfill: AtobTemplate(),
+            rc4Polyfill: Rc4Template(),
+            selfDefendingCode: '',
+            stringsArrayCallsWrapperName
+        });
+
+    it('should correctly returns decoded value with base64 encoding', () => {
+        assert.deepEqual(getFunctionFromTemplateBase64Encoding({
+            decodeNodeTemplate: atobDecodeNodeTemplate,
+            stringsArrayCallsWrapperName,
+            stringsArrayName
+        }, stringsArrayName, stringsArrayCallsWrapperName, '0x0'), 'test1');
+    });
+
+    it('should correctly returns decoded value with rc4 encoding', () => {
+        assert.deepEqual(getFunctionFromTemplateRc4Encoding({
+            decodeNodeTemplate: rc4DecodeNodeTemplate,
+            stringsArrayCallsWrapperName,
+            stringsArrayName
+        }, stringsArrayName, stringsArrayCallsWrapperName, '0x0', 'key'), 'test1');
+    });
+});

+ 0 - 93
test/functional-tests/templates/custom-nodes/unicode-array-nodes/UnicodeArrayCallsWrapperNodeTemplate.spec.ts

@@ -1,93 +0,0 @@
-import 'format-unicorn';
-
-import { AtobTemplate } from '../../../../../src/templates/custom-nodes/AtobTemplate';
-import { Rc4Template } from '../../../../../src/templates/custom-nodes/Rc4Template';
-import { UnicodeArrayBase64DecodeNodeTemplate } from '../../../../../src/templates/custom-nodes/unicode-array-nodes/unicode-array-calls-wrapper/UnicodeArrayBase64DecodeNodeTemplate';
-import { UnicodeArrayCallsWrapperTemplate } from '../../../../../src/templates/custom-nodes/unicode-array-nodes/unicode-array-calls-wrapper/UnicodeArrayCallsWrapperTemplate';
-import { UnicodeArrayRc4DecodeNodeTemplate } from '../../../../../src/templates/custom-nodes/unicode-array-nodes/unicode-array-calls-wrapper/UnicodeArrayRC4DecodeNodeTemplate';
-
-import { Utils } from '../../../../../src/Utils';
-
-const assert: Chai.AssertStatic = require('chai').assert;
-
-/**
- * @param templateData
- * @param unicodeArrayName
- * @param unicodeArrayCallsWrapperName
- * @param index
- * @returns {Function}
- */
-function getFunctionFromTemplateBase64Encoding (
-    templateData: any,
-    unicodeArrayName: string,
-    unicodeArrayCallsWrapperName: string,
-    index: string
-) {
-    let unicodeArrayCallsWrapperTemplate: string = UnicodeArrayCallsWrapperTemplate().formatUnicorn(templateData);
-
-    return Function(`
-        var ${unicodeArrayName} = ['${Utils.btoa('test1')}'];
-    
-        ${unicodeArrayCallsWrapperTemplate}
-        
-        return ${unicodeArrayCallsWrapperName}(${index});
-    `)();
-}
-
-/**
- * @param templateData
- * @param unicodeArrayName
- * @param unicodeArrayCallsWrapperName
- * @param index
- * @param key
- * @returns {Function}
- */
-function getFunctionFromTemplateRc4Encoding (
-    templateData: any,
-    unicodeArrayName: string,
-    unicodeArrayCallsWrapperName: string,
-    index: string,
-    key: string
-) {
-    let unicodeArrayCallsWrapperTemplate: string = UnicodeArrayCallsWrapperTemplate().formatUnicorn(templateData);
-
-    return Function(`
-        var ${unicodeArrayName} = ['${Utils.btoa(Utils.rc4('test1', key))}'];
-    
-        ${unicodeArrayCallsWrapperTemplate}
-        
-        return ${unicodeArrayCallsWrapperName}('${index}', '${key}');
-    `)();
-}
-
-describe('UnicodeArrayCallsWrapperNodeTemplate (): string', () => {
-    let unicodeArrayName: string = 'unicodeArrayName',
-        unicodeArrayCallsWrapperName: string = 'unicodeArrayCallsWrapperName',
-        atobDecodeNodeTemplate: string = UnicodeArrayBase64DecodeNodeTemplate().formatUnicorn({
-            atobPolyfill: AtobTemplate(),
-            selfDefendingCode: '',
-            unicodeArrayCallsWrapperName
-        }),
-        rc4DecodeNodeTemplate: string = UnicodeArrayRc4DecodeNodeTemplate().formatUnicorn({
-            atobPolyfill: AtobTemplate(),
-            rc4Polyfill: Rc4Template(),
-            selfDefendingCode: '',
-            unicodeArrayCallsWrapperName
-        });
-
-    it('should correctly returns decoded value with base64 encoding', () => {
-        assert.deepEqual(getFunctionFromTemplateBase64Encoding({
-            decodeNodeTemplate: atobDecodeNodeTemplate,
-            unicodeArrayCallsWrapperName,
-            unicodeArrayName
-        }, unicodeArrayName, unicodeArrayCallsWrapperName, '0x0'), 'test1');
-    });
-
-    it('should correctly returns decoded value with rc4 encoding', () => {
-        assert.deepEqual(getFunctionFromTemplateRc4Encoding({
-            decodeNodeTemplate: rc4DecodeNodeTemplate,
-            unicodeArrayCallsWrapperName,
-            unicodeArrayName
-        }, unicodeArrayName, unicodeArrayCallsWrapperName, '0x0', 'key'), 'test1');
-    });
-});

+ 4 - 4
test/index.spec.ts

@@ -27,9 +27,9 @@ import './functional-tests/JavaScriptObfuscatorCLI.spec';
 import './functional-tests/JavaScriptObfuscatorInternal.spec';
 import './functional-tests/JavaScriptObfuscatorInternal.spec';
 import './functional-tests/custom-nodes/console-output-nodes/ConsoleOutputDisableExpressionNode.spec';
 import './functional-tests/custom-nodes/console-output-nodes/ConsoleOutputDisableExpressionNode.spec';
 import './functional-tests/custom-nodes/domain-lock-nodes/DomainLockNode.spec';
 import './functional-tests/custom-nodes/domain-lock-nodes/DomainLockNode.spec';
-import './functional-tests/custom-nodes/unicode-array-nodes/UnicodeArrayCallsWrapper.spec';
-import './functional-tests/custom-nodes/unicode-array-nodes/UnicodeArrayRotateFunctionNode.spec';
-import './functional-tests/custom-nodes/unicode-array-nodes/UnicodeArrayNode.spec';
+import './functional-tests/custom-nodes/strings-array-nodes/StringsArrayCallsWrapper.spec';
+import './functional-tests/custom-nodes/strings-array-nodes/StringsArrayRotateFunctionNode.spec';
+import './functional-tests/custom-nodes/strings-array-nodes/StringsArrayNode.spec';
 import './functional-tests/node-obfuscators/FunctionObfuscator.spec';
 import './functional-tests/node-obfuscators/FunctionObfuscator.spec';
 import './functional-tests/node-obfuscators/LiteralObfuscator.spec';
 import './functional-tests/node-obfuscators/LiteralObfuscator.spec';
 import './functional-tests/node-obfuscators/MemberExpressionObfuscator.spec';
 import './functional-tests/node-obfuscators/MemberExpressionObfuscator.spec';
@@ -38,7 +38,7 @@ import './functional-tests/node-obfuscators/ObjectExpressionObfuscator.spec';
 import './functional-tests/node-obfuscators/VariableDeclarationObfuscator.spec';
 import './functional-tests/node-obfuscators/VariableDeclarationObfuscator.spec';
 import './functional-tests/stack-trace-analyzer/StackTraceAnalyzer.spec';
 import './functional-tests/stack-trace-analyzer/StackTraceAnalyzer.spec';
 import './functional-tests/templates/custom-nodes/domain-lock-nodes/DomainLockNodeTemplate.spec';
 import './functional-tests/templates/custom-nodes/domain-lock-nodes/DomainLockNodeTemplate.spec';
-import './functional-tests/templates/custom-nodes/unicode-array-nodes/UnicodeArrayCallsWrapperNodeTemplate.spec';
+import './functional-tests/templates/custom-nodes/strings-array-nodes/StringsArrayCallsWrapperNodeTemplate.spec';
 
 
 /**
 /**
  * Performance tests
  * Performance tests

+ 18 - 18
test/unit-tests/OptionsNormalizer.spec.ts

@@ -23,46 +23,46 @@ describe('OptionsNormalizer', () => {
         beforeEach(() => {
         beforeEach(() => {
             optionsPreset1 = Object.assign({}, DEFAULT_PRESET, {
             optionsPreset1 = Object.assign({}, DEFAULT_PRESET, {
                 compact: false,
                 compact: false,
-                rotateUnicodeArray: true,
+                rotateStringsArray: true,
                 sourceMapBaseUrl: 'http://localhost:9000',
                 sourceMapBaseUrl: 'http://localhost:9000',
-                unicodeArray: false,
-                unicodeArrayEncoding: 'rc4',
-                unicodeArrayThreshold: 0.5
+                stringsArray: false,
+                stringsArrayEncoding: 'rc4',
+                stringsArrayThreshold: 0.5
             });
             });
             optionsPreset2 = Object.assign({}, DEFAULT_PRESET, {
             optionsPreset2 = Object.assign({}, DEFAULT_PRESET, {
-                rotateUnicodeArray: true,
+                rotateStringsArray: true,
                 sourceMapBaseUrl: 'http://localhost:9000',
                 sourceMapBaseUrl: 'http://localhost:9000',
                 sourceMapFileName: '//outputSourceMapName',
                 sourceMapFileName: '//outputSourceMapName',
-                unicodeArray: true,
-                unicodeArrayThreshold: 0
+                stringsArray: true,
+                stringsArrayThreshold: 0
             });
             });
             optionsPreset3 = Object.assign({}, DEFAULT_PRESET, {
             optionsPreset3 = Object.assign({}, DEFAULT_PRESET, {
                 domainLock: ['//localhost:9000', 'https://google.ru/abc?cde=fgh'],
                 domainLock: ['//localhost:9000', 'https://google.ru/abc?cde=fgh'],
                 sourceMapFileName: '/outputSourceMapName.map',
                 sourceMapFileName: '/outputSourceMapName.map',
-                unicodeArray: true,
-                unicodeArrayEncoding: true
+                stringsArray: true,
+                stringsArrayEncoding: true
             });
             });
 
 
             expectedOptionsPreset1 = Object.assign({}, DEFAULT_PRESET, {
             expectedOptionsPreset1 = Object.assign({}, DEFAULT_PRESET, {
                 compact: true,
                 compact: true,
-                rotateUnicodeArray: false,
+                rotateStringsArray: false,
                 sourceMapBaseUrl: '',
                 sourceMapBaseUrl: '',
-                unicodeArray: false,
-                unicodeArrayEncoding: false,
-                unicodeArrayThreshold: 0
+                stringsArray: false,
+                stringsArrayEncoding: false,
+                stringsArrayThreshold: 0
             });
             });
             expectedOptionsPreset2 = Object.assign({}, DEFAULT_PRESET, {
             expectedOptionsPreset2 = Object.assign({}, DEFAULT_PRESET, {
-                rotateUnicodeArray: false,
+                rotateStringsArray: false,
                 sourceMapBaseUrl: 'http://localhost:9000/',
                 sourceMapBaseUrl: 'http://localhost:9000/',
                 sourceMapFileName: 'outputSourceMapName.js.map',
                 sourceMapFileName: 'outputSourceMapName.js.map',
-                unicodeArray: false,
-                unicodeArrayThreshold: 0
+                stringsArray: false,
+                stringsArrayThreshold: 0
             });
             });
             expectedOptionsPreset3 = Object.assign({}, DEFAULT_PRESET, {
             expectedOptionsPreset3 = Object.assign({}, DEFAULT_PRESET, {
                 domainLock: ['localhost', 'google.ru'],
                 domainLock: ['localhost', 'google.ru'],
                 sourceMapFileName: 'outputSourceMapName.js.map',
                 sourceMapFileName: 'outputSourceMapName.js.map',
-                unicodeArray: true,
-                unicodeArrayEncoding: 'base64'
+                stringsArray: true,
+                stringsArrayEncoding: 'base64'
             });
             });
 
 
             options1 = new Options(optionsPreset1);
             options1 = new Options(optionsPreset1);

+ 4 - 4
test/unit-tests/Utils.spec.ts

@@ -83,11 +83,11 @@ describe('Utils', () => {
         });
         });
     });
     });
 
 
-    describe('stringToUnicode (string: string): string', () => {
-        let expected: string = `'\\x73\\x74\\x72\\x69\\x6e\\x67'`;
+    describe('stringToUnicodeEscapeSequence (string: string): string', () => {
+        let expected: string = '\\x73\\x74\\x72\\x69\\x6e\\x67';
 
 
-        it('should return a unicode encoded string from a given string', () => {
-            assert.equal(Utils.stringToUnicode('string'), expected);
+        it('should return a unicode escape sequence based on a given string', () => {
+            assert.equal(Utils.stringToUnicodeEscapeSequence('string'), expected);
         });
         });
     });
     });
 
 

Некоторые файлы не были показаны из-за большого количества измененных файлов