Skip to content

Commit 194ede1

Browse files
author
sanex3339
committed
Added numbersToExpressions option
1 parent b192f8a commit 194ede1

File tree

6 files changed

+41
-7
lines changed

6 files changed

+41
-7
lines changed

App/constants/ActionTypes.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ export const TOGGLE_CONTROL_FLOW_FLATTENING = 'TOGGLE_CONTROL_FLOW_FLATTENING';
5050
export const SET_DEAD_CODE_INJECTION_THRESHOLD = 'SET_DEAD_CODE_INJECTION_THRESHOLD';
5151
export const TOGGLE_DEAD_CODE_INJECTION = 'TOGGLE_DEAD_CODE_INJECTION';
5252

53+
export const TOGGLE_NUMBERS_TO_EXPRESSIONS = 'TOGGLE_NUMBERS_TO_EXPRESSIONS';
54+
5355
export const TOGGLE_UNICODE_ESCAPE_SEQUENCE = 'TOGGLE_UNICODE_ESCAPE_SEQUENCE';
5456

5557
export const TOGGLE_RENAME_GLOBALS = 'TOGGLE_RENAME_GLOBALS';

App/containers/OptionsContainer.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,13 @@ const Options = ({dispatch, options}) =>
208208

209209
<Divider/>
210210

211+
<Form.Checkbox
212+
label='Numbers To Expressions'
213+
checked={options.numbersToExpressions}
214+
onChange={() => dispatch(actions.toggleOption(types.TOGGLE_NUMBERS_TO_EXPRESSIONS))}/>
215+
216+
<Divider/>
217+
211218
<Form.Checkbox
212219
label='Unicode Escape Sequence'
213220
checked={options.unicodeEscapeSequence}

App/reducers/options.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ const initialState = {
3131
stringArrayEncoding: 'false',
3232
stringArrayEncodingEnabled: true,
3333

34+
numbersToExpressions: false,
35+
3436
sourceMap: false,
3537
sourceMapMode: 'off',
3638
sourceMapBaseUrl: '',
@@ -306,6 +308,12 @@ export const options = (state = initialState, action) => {
306308
};
307309
}
308310

311+
case types.TOGGLE_NUMBERS_TO_EXPRESSIONS:
312+
return {
313+
...state,
314+
numbersToExpressions: !state.numbersToExpressions
315+
};
316+
309317
case types.TOGGLE_UNICODE_ESCAPE_SEQUENCE:
310318
return {
311319
...state,

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "javascript-obfuscator-web",
3-
"version": "3.8.0",
3+
"version": "3.9.0",
44
"description": "",
55
"engines": {
66
"node": ">=12.13.1"
@@ -32,7 +32,7 @@
3232
"graceful-fs": "4.1.9",
3333
"html-webpack-plugin": "^3.2.0",
3434
"inert": "5.1.0",
35-
"javascript-obfuscator": "1.5.2",
35+
"javascript-obfuscator": "1.6.0",
3636
"less": "2.7.1",
3737
"less-loader": "4.1.0",
3838
"pm2": "3.5.1",

templates/index.html

Lines changed: 18 additions & 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>@1.5.2</code>
52+
<code><a href="https://github.com/javascript-obfuscator/javascript-obfuscator" target="_new">javascript-obfuscator</a>@1.6.0</code>
5353
created by Timofey Kachalov.
5454
</p>
5555
<div id="GithubBadges">
@@ -397,6 +397,23 @@ <h3>Sounds great!</h3>
397397
</td>
398398
</tr>
399399

400+
<tr>
401+
<td class="collapsing">Numbers To Expressions</td>
402+
<td>
403+
<p>Enables numbers conversion to expressions</p>
404+
<p>
405+
Example:<br/>
406+
<code>
407+
// input<br/>
408+
const foo = 1234;<br/>
409+
<br/>
410+
// output<br/>
411+
const foo=-0xd93+-0x10b4+0x41*0x67+0x84e*0x3+-0xff8;
412+
</code>
413+
</p>
414+
</td>
415+
</tr>
416+
400417
<tr>
401418
<td class="collapsing">Escape Unicode Sequence</td>
402419
<td>

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4146,10 +4146,10 @@ isurl@^1.0.0-alpha5:
41464146
has-to-string-tag-x "^1.2.0"
41474147
is-object "^1.0.1"
41484148

4149-
javascript-obfuscator@1.5.2:
4150-
version "1.5.2"
4151-
resolved "https://registry.yarnpkg.com/javascript-obfuscator/-/javascript-obfuscator-1.5.2.tgz#771742ec736b64a1f18003d920922e1417ffb7f7"
4152-
integrity sha512-D11n0jvo9j6rv+/qfutCXxkOx60gF+SnjqQG0TIkHN50LG+4BjRUK9YHK7BtZvH5tNXowTpCb0sB8wwv+YWJiQ==
4149+
javascript-obfuscator@1.6.0:
4150+
version "1.6.0"
4151+
resolved "https://registry.yarnpkg.com/javascript-obfuscator/-/javascript-obfuscator-1.6.0.tgz#ed70f2f0da962a2ede51e71f1f9ed817ea87ee3b"
4152+
integrity sha512-gG1UD5SitqITe1i/Z8ZvnTn/ZKZH9UkybwxAOOMXejrUfbWuPz8d7q1bE5GAzGLijbB3TMSu97f7WD6HyTAcTw==
41534153
dependencies:
41544154
"@gradecam/tsenum" "1.2.0"
41554155
"@nuxtjs/opencollective" "0.2.2"

0 commit comments

Comments
 (0)