Skip to content
This repository was archived by the owner on Dec 9, 2025. It is now read-only.

Commit bdecb5b

Browse files
committed
Obfuscator version update to 2.11.0. Added renameProperties option
1 parent 75f76ec commit bdecb5b

File tree

7 files changed

+40
-7
lines changed

7 files changed

+40
-7
lines changed

App/actions/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,11 @@ export const removeDictionaryIdentifier = (name) => ({
134134
name
135135
});
136136

137+
export const setRenamePropertiesMode = (renamePropertiesMode) => ({
138+
'type': types.SET_RENAME_PROPERTIES_MODE,
139+
renamePropertiesMode
140+
});
141+
137142
export const setSplitStringsChunkLength = (chunkLength) => ({
138143
'type': types.SET_SPLIT_STRINGS_CHUNK_LENGTH,
139144
chunkLength

App/constants/ActionTypes.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export const TOGGLE_UNICODE_ESCAPE_SEQUENCE = 'TOGGLE_UNICODE_ESCAPE_SEQUENCE';
7070
export const TOGGLE_RENAME_GLOBALS = 'TOGGLE_RENAME_GLOBALS';
7171

7272
export const TOGGLE_RENAME_PROPERTIES = 'TOGGLE_RENAME_PROPERTIES';
73+
export const SET_RENAME_PROPERTIES_MODE = 'SET_RENAME_PROPERTIES_MODE';
7374

7475
export const SET_TARGET = 'SET_TARGET';
7576

App/containers/OptionsContainer.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ const OPTIONS_PRESET_OPTIONS = [
2626
{text: 'High', value: OPTIONS_PRESET_HIGH_OBFUSCATION},
2727
];
2828

29+
export const RENAME_PROPERTIES_MODE_SAFE = 'safe';
30+
export const RENAME_PROPERTIES_MODE_UNSAFE = 'unsafe';
31+
32+
const RENAME_PROPERTIES_MODE_OPTIONS = [
33+
{text: 'Safe', value: RENAME_PROPERTIES_MODE_SAFE},
34+
{text: 'Unsafe', value: RENAME_PROPERTIES_MODE_UNSAFE},
35+
];
36+
2937
export const SOURCEMAP_INLINE = 'inline';
3038
export const SOURCEMAP_SEPARATE = 'separate';
3139

@@ -392,11 +400,21 @@ const Options = ({dispatch, options}) => {
392400
checked={options.renameGlobals}
393401
onChange={() => dispatch(actions.toggleOption(types.TOGGLE_RENAME_GLOBALS))}/>
394402

403+
<Divider/>
404+
395405
<Form.Checkbox
396406
label='Rename Properties'
397407
checked={options.renameProperties}
398408
onChange={() => dispatch(actions.toggleOption(types.TOGGLE_RENAME_PROPERTIES))}/>
399409

410+
<Form.Select
411+
label='Rename Properties Mode'
412+
value={options.renamePropertiesMode}
413+
disabled={!options.renameProperties}
414+
fluid
415+
onChange={(event, {value}) => dispatch(actions.setRenamePropertiesMode(value))}
416+
options={RENAME_PROPERTIES_MODE_OPTIONS}/>
417+
400418
<Divider/>
401419

402420
<EntryInputContainer

App/reducers/options.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import {
88
STRING_ARRAY_ENCODING_NONE,
99
STRING_ARRAY_ENCODING_BASE64,
1010
STRING_ARRAY_ENCODING_RC4,
11-
STRING_ARRAY_WRAPPERS_TYPE_VARIABLE, STRING_ARRAY_INDEXES_TYPE_HEXADECIMAL_NUMBER
11+
STRING_ARRAY_WRAPPERS_TYPE_VARIABLE,
12+
STRING_ARRAY_INDEXES_TYPE_HEXADECIMAL_NUMBER, RENAME_PROPERTIES_MODE_SAFE
1213
} from '../containers/OptionsContainer';
1314

1415
const initialState = {
@@ -80,7 +81,9 @@ const initialState = {
8081
unicodeEscapeSequence: false,
8182

8283
renameGlobals: false,
84+
8385
renameProperties: false,
86+
renamePropertiesMode: RENAME_PROPERTIES_MODE_SAFE,
8487

8588
target: TARGET_BROWSER,
8689

@@ -426,6 +429,12 @@ export const options = (state = initialState, action) => {
426429
renameProperties: !state.renameProperties
427430
};
428431

432+
case types.SET_RENAME_PROPERTIES_MODE:
433+
return {
434+
...state,
435+
renamePropertiesMode: action.renamePropertiesMode
436+
};
437+
429438
case types.SET_TARGET: {
430439
const target = action.target;
431440

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"file-loader": "^6.2.0",
3838
"graceful-fs": "4.2.4",
3939
"html-webpack-plugin": "^4.5.1",
40-
"javascript-obfuscator": "2.10.6",
40+
"javascript-obfuscator": "2.11.0",
4141
"less": "2.7.1",
4242
"less-loader": "7.3.0",
4343
"mini-css-extract-plugin": "^1.3.4",

templates/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ <h1>JavaScript Obfuscator Tool</h1>
4949
<p>
5050
A free and efficient obfuscator for JavaScript (including partial support of ES2019). Make your code harder to copy and
5151
prevent people from stealing your work. This tool is a Web UI to the excellent (and open source)
52-
<code><a href="https://github.com/javascript-obfuscator/javascript-obfuscator" target="_new">javascript-obfuscator</a>@2.10.6</code>
52+
<code><a href="https://github.com/javascript-obfuscator/javascript-obfuscator" target="_new">javascript-obfuscator</a>@2.11.0</code>
5353
created by Timofey Kachalov.
5454
</p>
5555
<div id="GithubBadges">

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4104,10 +4104,10 @@ iterate-object@^1.3.0, iterate-object@^1.3.1:
41044104
resolved "https://registry.yarnpkg.com/iterate-object/-/iterate-object-1.3.4.tgz#fa50b1d9e58e340a7dd6b4c98c8a5e182e790096"
41054105
integrity sha512-4dG1D1x/7g8PwHS9aK6QV5V94+ZvyP4+d19qDv43EzImmrndysIl4prmJ1hWWIGCqrZHyaHBm6BSEWHOLnpoNw==
41064106

4107-
javascript-obfuscator@2.10.6:
4108-
version "2.10.6"
4109-
resolved "https://registry.yarnpkg.com/javascript-obfuscator/-/javascript-obfuscator-2.10.6.tgz#25367d2f3b9867d6517f10a5dd0277446df21901"
4110-
integrity sha512-t8YNTg/d13UJfn1GhgJUWTgbcLHeE7pKXoe45wsUOfe7DaY4KO494Rx/ul0r9Xa7OWSDiP0wgXSzv4AtdCBhig==
4107+
javascript-obfuscator@2.11.0:
4108+
version "2.11.0"
4109+
resolved "https://registry.yarnpkg.com/javascript-obfuscator/-/javascript-obfuscator-2.11.0.tgz#2dae30ba7a0655bd910b05fa132e609e444adfed"
4110+
integrity sha512-2coAHPC0F+GJS3AjqQtDLywaZgQeNI995y5F82IwbM0aIG++pSffEAxBNCFlhB9WjFSqjjN2AT/L0oxLbK5AVw==
41114111
dependencies:
41124112
"@javascript-obfuscator/escodegen" "2.1.1"
41134113
"@nuxtjs/opencollective" "0.3.2"

0 commit comments

Comments
 (0)