Browse Source

Enable `stringArrayWrappersCount` and `stringArrayWrappersChainedCalls` options by default

sanex 4 years ago
parent
commit
3d6f98c127

+ 2 - 2
CHANGELOG.md

@@ -2,8 +2,8 @@ Change Log
 
 v2.2.0
 ---
-* **New option:** `stringArrayWrappersCount` sets the count of wrappers for the `string array` inside each root or function scope
-* **New option:** `stringArrayWrappersChainedCalls` enables the chained calls between `string array` wrappers
+* **New option (enabled by default):** `stringArrayWrappersCount` sets the count of wrappers for the `string array` inside each root or function scope
+* **New option (enabled by default):** `stringArrayWrappersChainedCalls` enables the chained calls between `string array` wrappers
 
 v2.1.0
 ---

+ 8 - 7
README.md

@@ -360,7 +360,8 @@ Following options are available for the JS Obfuscator:
     splitStringsChunkLength: 10,
     stringArray: true,
     stringArrayEncoding: [],
-    stringArrayWrappersCount: true,
+    stringArrayWrappersCount: 1,
+    stringArrayWrappersChainedCalls: true,
     stringArrayThreshold: 0.75,
     target: 'browser',
     transformObjectKeys: false,
@@ -952,7 +953,7 @@ stringArrayEncoding: [
 ```
 
 ### `stringArrayWrappersCount`
-Type: `number` Default: `0`
+Type: `number` Default: `1`
 
 ##### :warning: [`stringArray`](#stringarray) option must be enabled
 
@@ -1004,7 +1005,7 @@ const eagle = _0x26ca42('0x5');
 ```
 
 ### `stringArrayWrappersChainedCalls`
-Type: `boolean` Default: `false`
+Type: `boolean` Default: `true`
 
 ##### :warning: [`stringArray`](#stringarray) and [`stringArrayWrappersCount`](#stringArrayWrappersCount) options must be enabled
 
@@ -1221,8 +1222,8 @@ Performance will slightly slower than without obfuscation
     splitStrings: false,
     stringArray: true,
     stringArrayEncoding: [],
-    stringArrayWrappersCount: 0,
-    stringArrayWrappersChainedCalls: false,
+    stringArrayWrappersCount: 1,
+    stringArrayWrappersChainedCalls: true,
     stringArrayThreshold: 0.75,
     unicodeEscapeSequence: false
 }
@@ -1249,8 +1250,8 @@ Performance will slightly slower than without obfuscation
     splitStrings: false,
     stringArray: true,
     stringArrayEncoding: [],
-    stringArrayWrappersCount: 0,
-    stringArrayWrappersChainedCalls: false,
+    stringArrayWrappersCount: 1,
+    stringArrayWrappersChainedCalls: true,
     stringArrayThreshold: 0.75,
     unicodeEscapeSequence: false
 }

File diff suppressed because it is too large
+ 0 - 0
dist/index.browser.js


File diff suppressed because it is too large
+ 0 - 0
dist/index.cli.js


File diff suppressed because it is too large
+ 0 - 0
dist/index.js


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

@@ -44,8 +44,8 @@ export const DEFAULT_PRESET: TInputOptions = Object.freeze({
     stringArrayEncoding: [
         StringArrayEncoding.None
     ],
-    stringArrayWrappersChainedCalls: false,
-    stringArrayWrappersCount: 0,
+    stringArrayWrappersChainedCalls: true,
+    stringArrayWrappersCount: 1,
     stringArrayThreshold: 0.75,
     target: ObfuscationTarget.Browser,
     transformObjectKeys: false,

+ 0 - 1
src/options/presets/MediumObfuscation.ts

@@ -16,7 +16,6 @@ export const MEDIUM_OBFUSCATION_PRESET: TInputOptions = Object.freeze({
     stringArrayEncoding: [
         StringArrayEncoding.Base64
     ],
-    stringArrayWrappersChainedCalls: true,
     stringArrayWrappersCount: 2,
     transformObjectKeys: true
 });

+ 1 - 5
test/dev/dev.ts

@@ -1,7 +1,6 @@
 'use strict';
 
 import { NO_ADDITIONAL_NODES_PRESET } from '../../src/options/presets/NoCustomNodes';
-import { StringArrayEncoding } from '../../src/enums/StringArrayEncoding';
 
 (function () {
     const JavaScriptObfuscator: any = require('../../index');
@@ -27,10 +26,7 @@ import { StringArrayEncoding } from '../../src/enums/StringArrayEncoding';
             stringArray: true,
             stringArrayThreshold: 1,
             stringArrayWrappersChainedCalls: true,
-            stringArrayWrappersCount: 5,
-            stringArrayEncoding: [
-                StringArrayEncoding.None
-            ]
+            stringArrayWrappersCount: 1
         }
     ).getObfuscatedCode();
 

Some files were not shown because too many files changed in this diff