Skip to content

Commit b757984

Browse files
committed
Added forceTransformStrings option
1 parent da14a14 commit b757984

File tree

7 files changed

+52
-7
lines changed

7 files changed

+52
-7
lines changed

App/actions/index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,16 @@ export const removeReservedName = (name) => ({
104104
name
105105
});
106106

107+
export const addForceTransformString = (string) => ({
108+
'type': types.ADD_FORCE_TRANSFORM_STRING,
109+
string
110+
});
111+
112+
export const removeForceTransformString = (string) => ({
113+
'type': types.REMOVE_FORCE_TRANSFORM_STRING,
114+
string
115+
});
116+
107117
export const addReservedString = (string) => ({
108118
'type': types.ADD_RESERVED_STRING,
109119
string

App/constants/ActionTypes.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ export const REMOVE_DOMAIN_LOCK = 'REMOVE_DOMAIN_LOCK';
4343
export const ADD_RESERVED_NAME = 'ADD_RESERVED_NAME';
4444
export const REMOVE_RESERVED_NAME = 'REMOVE_RESERVED_NAME';
4545

46+
export const ADD_FORCE_TRANSFORM_STRING = 'ADD_FORCE_TRANSFORM_STRING';
47+
export const REMOVE_FORCE_TRANSFORM_STRING = 'REMOVE_FORCE_TRANSFORM_STRING';
48+
4649
export const ADD_RESERVED_STRING = 'ADD_RESERVED_STRING';
4750
export const REMOVE_RESERVED_STRING = 'REMOVE_RESERVED_STRING';
4851

App/containers/OptionsContainer.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,8 @@ const Options = ({dispatch, options}) => {
328328
entries={options.domainLock}
329329
buttonIcon="plus"/>
330330

331+
<Divider/>
332+
331333
<EntryInputContainer
332334
label='Reserved Names'
333335
actionAddEntryToState={(name) => dispatch(actions.addReservedName(name))}
@@ -336,6 +338,16 @@ const Options = ({dispatch, options}) => {
336338
entries={options.reservedNames}
337339
buttonIcon="plus"/>
338340

341+
<Divider/>
342+
343+
<EntryInputContainer
344+
label='Force Transform Strings'
345+
actionAddEntryToState={(string) => dispatch(actions.addForceTransformString(string))}
346+
actionRemoveEntryFromState={(string) => dispatch(actions.removeForceTransformString(string))}
347+
placeholder="^some *string *or RegExp"
348+
entries={options.forceTransformStrings}
349+
buttonIcon="plus"/>
350+
339351
<EntryInputContainer
340352
label='Reserved Strings'
341353
actionAddEntryToState={(string) => dispatch(actions.addReservedString(string))}

App/reducers/options.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ const initialState = {
5757

5858
domainLock: [],
5959
domainLockEnabled: true,
60+
61+
forceTransformStrings: [],
6062
reservedNames: [],
6163
reservedStrings: [],
6264

@@ -285,6 +287,24 @@ export const options = (state = initialState, action) => {
285287
reservedNames: state.reservedNames.filter((name) => name !== action.name),
286288
};
287289

290+
case types.ADD_FORCE_TRANSFORM_STRING: {
291+
const string = action.string;
292+
if (state.forceTransformStrings.indexOf(name) !== -1)
293+
return state;
294+
295+
return {
296+
...state,
297+
forceTransformStrings: [...state.forceTransformStrings, string],
298+
};
299+
}
300+
301+
case types.REMOVE_FORCE_TRANSFORM_STRING: {
302+
return {
303+
...state,
304+
forceTransformStrings: state.forceTransformStrings.filter((string) => string !== action.string)
305+
};
306+
}
307+
288308
case types.ADD_RESERVED_STRING: {
289309
const string = action.string;
290310
if (state.reservedStrings.indexOf(string) !== -1)

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.12.1",
3+
"version": "3.13.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": "2.3.1",
35+
"javascript-obfuscator": "2.4.0",
3636
"less": "2.7.1",
3737
"less-loader": "4.1.0",
3838
"pm2": "3.5.1",

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.3.1</code>
52+
<code><a href="https://github.com/javascript-obfuscator/javascript-obfuscator" target="_new">javascript-obfuscator</a>@2.4.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
@@ -4156,10 +4156,10 @@ isurl@^1.0.0-alpha5:
41564156
has-to-string-tag-x "^1.2.0"
41574157
is-object "^1.0.1"
41584158

4159-
javascript-obfuscator@2.3.1:
4160-
version "2.3.1"
4161-
resolved "https://registry.yarnpkg.com/javascript-obfuscator/-/javascript-obfuscator-2.3.1.tgz#9ae1d86466b3749d78e191a567bb0237865a5189"
4162-
integrity sha512-eE7e99fsALsZ50aRxN5mpJadvXsp9LjX+JQx8Bgls4gJkrmVH5OFjCNXmHCIwMbrUDRccNtCKFRE3QSRw5i8gg==
4159+
javascript-obfuscator@2.4.0:
4160+
version "2.4.0"
4161+
resolved "https://registry.yarnpkg.com/javascript-obfuscator/-/javascript-obfuscator-2.4.0.tgz#f907723cb5193ac8d9ba52d6595d11fab48056e0"
4162+
integrity sha512-KYclayLFyw3XtMXx56axp82d6cGOaUDd5O5DxtpBaDSb+4wWT/wnG9Ecws0pfUXAL338lRoy/kkKeomQUglr/Q==
41634163
dependencies:
41644164
"@gradecam/tsenum" "1.2.0"
41654165
"@nuxtjs/opencollective" "0.2.2"

0 commit comments

Comments
 (0)