Skip to content

Commit e43acda

Browse files
committed
Version update to 0.18.0, reservedStrings option
1 parent 8f06c0c commit e43acda

File tree

7 files changed

+69
-25
lines changed

7 files changed

+69
-25
lines changed

App/actions/index.js

+10
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@ export const removeReservedName = (name) => ({
5353
name
5454
});
5555

56+
export const addReservedString = (string) => ({
57+
'type': types.ADD_RESERVED_STRING,
58+
string
59+
});
60+
61+
export const removeReservedString = (string) => ({
62+
'type': types.REMOVE_RESERVED_STRING,
63+
string
64+
});
65+
5666
export const setStringArrayThreshold = (threshold) => ({
5767
'type': types.SET_STRING_ARRAY_THRESHOLD,
5868
threshold

App/constants/ActionTypes.js

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ export const REMOVE_DOMAIN_LOCK = 'REMOVE_DOMAIN_LOCK';
2727
export const ADD_RESERVED_NAME = 'ADD_RESERVED_NAME';
2828
export const REMOVE_RESERVED_NAME = 'REMOVE_RESERVED_NAME';
2929

30+
export const ADD_RESERVED_STRING = 'ADD_RESERVED_STRING';
31+
export const REMOVE_RESERVED_STRING = 'REMOVE_RESERVED_STRING';
32+
3033
export const SET_SEED = 'SET_SEED';
3134

3235
export const SET_CONTROL_FLOW_FLATTENING_THRESHOLD = 'SET_CONTROL_FLOW_FLATTENING_THRESHOLD';

App/containers/OptionsContainer.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,18 @@ const Options = ({dispatch, options}) =>
202202
label='Reserved Names'
203203
actionAddEntryToState={(name) => dispatch(actions.addReservedName(name))}
204204
actionRemoveEntryFromState={(name) => dispatch(actions.removeReservedName(name))}
205-
placeholder="^someVariable"
205+
placeholder="^someVariable *or *RegExp"
206206
entries={options.reservedNames}
207207
buttonIcon="plus"/>
208208

209+
<EntryInputContainer
210+
label='Reserved Strings'
211+
actionAddEntryToState={(string) => dispatch(actions.addReservedString(string))}
212+
actionRemoveEntryFromState={(string) => dispatch(actions.removeReservedString(string))}
213+
placeholder="^some *string *or RegExp"
214+
entries={options.reservedStrings}
215+
buttonIcon="plus"/>
216+
209217
</Segment>
210218
</Grid.Column>
211219

App/reducers/options.js

+18
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const initialState = {
2929

3030
domainLock: [],
3131
reservedNames: [],
32+
reservedStrings: [],
3233

3334
seed: 0,
3435

@@ -188,6 +189,23 @@ export const options = (state = initialState, action) => {
188189
reservedNames: state.reservedNames.filter((name) => name !== action.name),
189190
};
190191

192+
case types.ADD_RESERVED_STRING: {
193+
const string = action.string;
194+
if (state.reservedStrings.indexOf(string) !== -1)
195+
return state;
196+
197+
return {
198+
...state,
199+
reservedStrings: [...state.reservedStrings, string],
200+
};
201+
}
202+
203+
case types.REMOVE_RESERVED_STRING:
204+
return {
205+
...state,
206+
reservedStrings: state.reservedStrings.filter((string) => string !== action.string),
207+
};
208+
191209
case types.SET_SEED:
192210
return {
193211
...state,

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "javascript-obfuscator-web",
3-
"version": "1.2.2",
3+
"version": "1.3.0",
44
"description": "",
55
"main": "server.js",
66
"engines": {
@@ -22,7 +22,7 @@
2222
"express": "4.14.0",
2323
"graceful-fs": "4.1.9",
2424
"inert": "5.1.0",
25-
"javascript-obfuscator": "0.17.3",
25+
"javascript-obfuscator": "0.18.0",
2626
"prop-types": "15.6.1",
2727
"react": "16.3.0",
2828
"react-codemirror2": "5.0.1",

templates/index.html

+12-2
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 ES2017). 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>@0.17.3</code>
52+
<code><a href="https://github.com/javascript-obfuscator/javascript-obfuscator" target="_new">javascript-obfuscator</a>@0.18.0</code>
5353
created by Timofey Kachalov.
5454
</p>
5555
<div id="GithubBadges">
@@ -394,7 +394,7 @@ <h3>Sounds great!</h3>
394394
</tr>
395395

396396
<tr>
397-
<td class="collapsing">Reseverd Names</td>
397+
<td class="collapsing">Reserved Names</td>
398398
<td>
399399
<p>Disables obfuscation and generation of identifiers, which being matched by passed RegExp
400400
patterns.</p>
@@ -404,6 +404,16 @@ <h3>Sounds great!</h3>
404404
</td>
405405
</tr>
406406

407+
<tr>
408+
<td class="collapsing">Reserved Strings</td>
409+
<td>
410+
<p>Disables transformation of string literals, which being matched by passed RegExp patterns.</p>
411+
<p>For instance, if you add <code>^some *string</code>, the obfuscator will ensure that all
412+
strings that starts with <strong>some string</strong>
413+
will not get moved to the `stringArray`.</p>
414+
</td>
415+
</tr>
416+
407417
<tr>
408418
<td class="collapsing">Source Map</td>
409419
<td>

yarn.lock

+15-20
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,10 @@
4646
esutils "^2.0.2"
4747
js-tokens "^3.0.0"
4848

49-
"@babel/[email protected]beta.55":
50-
version "7.0.0-beta.55"
51-
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.0.0-beta.55.tgz#0bc33aa5a6ac0b012f37e25b9e6aaa2e489a916b"
49+
"@babel/[email protected]rc.1":
50+
version "7.0.0-rc.1"
51+
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.0.0-rc.1.tgz#42f36fc5817911c89ea75da2b874054922967616"
5252
dependencies:
53-
core-js "^2.5.7"
5453
regenerator-runtime "^0.12.0"
5554

5655
@@ -1620,9 +1619,9 @@ colors@~1.1.2:
16201619
version "1.1.2"
16211620
resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63"
16221621

1623-
commander@2.16.0:
1624-
version "2.16.0"
1625-
resolved "https://registry.yarnpkg.com/commander/-/commander-2.16.0.tgz#f16390593996ceb4f3eeb020b31d78528f7f8a50"
1622+
commander@2.17.1:
1623+
version "2.17.1"
1624+
resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf"
16261625

16271626
commander@~2.13.0:
16281627
version "2.13.0"
@@ -1706,10 +1705,6 @@ core-js@^2.4.0, core-js@^2.4.1, core-js@^2.5.0:
17061705
version "2.5.6"
17071706
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.6.tgz#0fe6d45bf3cac3ac364a9d72de7576f4eb221b9d"
17081707

1709-
core-js@^2.5.7:
1710-
version "2.5.7"
1711-
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e"
1712-
17131708
core-util-is@~1.0.0:
17141709
version "1.0.2"
17151710
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
@@ -3418,15 +3413,15 @@ isurl@^1.0.0-alpha5:
34183413
has-to-string-tag-x "^1.2.0"
34193414
is-object "^1.0.1"
34203415

3421-
javascript-obfuscator@0.17.3:
3422-
version "0.17.3"
3423-
resolved "https://registry.yarnpkg.com/javascript-obfuscator/-/javascript-obfuscator-0.17.3.tgz#1bd777d53cef92cd24f2874603cc33510e3101ce"
3416+
javascript-obfuscator@0.18.0:
3417+
version "0.18.0"
3418+
resolved "https://registry.yarnpkg.com/javascript-obfuscator/-/javascript-obfuscator-0.18.0.tgz#b58ec1d71967ae7f6785e276f461174f528ca51f"
34243419
dependencies:
3425-
"@babel/runtime" "7.0.0-beta.55"
3420+
"@babel/runtime" "7.0.0-rc.1"
34263421
chalk "2.4.1"
34273422
chance "1.0.16"
34283423
class-validator "0.9.1"
3429-
commander "2.16.0"
3424+
commander "2.17.1"
34303425
escodegen-wallaby "1.6.19"
34313426
espree "4.0.0"
34323427
estraverse "4.2.0"
@@ -3437,7 +3432,7 @@ [email protected]:
34373432
multimatch "2.1.0"
34383433
opencollective "1.0.3"
34393434
reflect-metadata "0.1.12"
3440-
source-map-support "0.5.6"
3435+
source-map-support "0.5.8"
34413436
string-template "1.0.0"
34423437
tslib "1.9.3"
34433438

@@ -5558,9 +5553,9 @@ source-map-resolve@^0.5.0:
55585553
source-map-url "^0.4.0"
55595554
urix "^0.1.0"
55605555

5561-
5562-
version "0.5.6"
5563-
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.6.tgz#4435cee46b1aab62b8e8610ce60f788091c51c13"
5556+
5557+
version "0.5.8"
5558+
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.8.tgz#04f5581713a8a65612d0175fbf3a01f80a162613"
55645559
dependencies:
55655560
buffer-from "^1.0.0"
55665561
source-map "^0.6.0"

0 commit comments

Comments
 (0)