Skip to content

Commit c7dca16

Browse files
author
sanex3339
committed
Updated to 0.19.0 version
1 parent d6c1ba9 commit c7dca16

File tree

7 files changed

+261
-85
lines changed

7 files changed

+261
-85
lines changed

App/actions/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ export const removeReservedString = (string) => ({
6363
string
6464
});
6565

66+
export const setSplitStringsChunkLength = (chunkLength) => ({
67+
'type': types.SET_SPLIT_STRINGS_CHUNK_LENGTH,
68+
chunkLength
69+
});
70+
6671
export const setStringArrayThreshold = (threshold) => ({
6772
'type': types.SET_STRING_ARRAY_THRESHOLD,
6873
threshold

App/constants/ActionTypes.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ export const SET_SOURCEMAP_MODE = 'SET_SOURCEMAP_MODE';
1616
export const SET_SOURCEMAP_BASE_URL = 'SET_SOURCEMAP_BASE_URL';
1717
export const SET_SOURCEMAP_FILE_NAME = 'SET_SOURCEMAP_FILE_NAME';
1818

19+
export const TOGGLE_SPLIT_STRINGS = 'TOGGLE_SPLIT_STRINGS';
20+
export const SET_SPLIT_STRINGS_CHUNK_LENGTH = 'SET_SPLIT_STRINGS_CHUNK_LENGTH';
21+
1922
export const SET_STRING_ARRAY_THRESHOLD = 'SET_STRING_ARRAY_THRESHOLD';
2023
export const TOGGLE_ROTATE_STRING_ARRAY = 'TOGGLE_ROTATE_STRING_ARRAY';
2124
export const TOGGLE_STRING_ARRAY = 'TOGGLE_STRING_ARRAY';

App/containers/OptionsContainer.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,22 @@ const Options = ({dispatch, options}) =>
152152

153153
<Divider/>
154154

155+
<Form.Checkbox
156+
label='Split Strings'
157+
checked={options.splitStrings}
158+
onChange={() => dispatch(actions.toggleOption(types.TOGGLE_SPLIT_STRINGS))}/>
159+
160+
<Form.Input
161+
type='number'
162+
label='Split Strings Chunk Length'
163+
defaultValue={options.splitStringsChunkLength}
164+
min="1"
165+
step="1"
166+
onChange={(event) => dispatch(actions.setSplitStringsChunkLength(parseInt(event.target.value)))}
167+
disabled={!options.splitStringsChunkLengthEnabled}/>
168+
169+
<Divider/>
170+
155171
<Form.Checkbox
156172
label='Transform Object Keys'
157173
checked={options.transformObjectKeys}

App/reducers/options.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ const initialState = {
1010
debugProtection: false,
1111
debugProtectionInterval: false,
1212

13+
splitStrings: false,
14+
15+
splitStringsChunkLength: 10,
16+
splitStringsChunkLengthEnabled: false,
17+
1318
stringArray: true,
1419

1520
rotateStringArray: true,
@@ -103,6 +108,22 @@ export const options = (state = initialState, action) => {
103108
debugProtectionInterval: !state.debugProtectionInterval,
104109
};
105110

111+
case types.TOGGLE_SPLIT_STRINGS: {
112+
const splitStrings = !state.splitStrings;
113+
114+
return {
115+
...state,
116+
splitStrings,
117+
splitStringsChunkLengthEnabled: splitStrings,
118+
};
119+
}
120+
121+
case types.SET_SPLIT_STRINGS_CHUNK_LENGTH:
122+
return {
123+
...state,
124+
splitStringsChunkLength: action.chunkLength
125+
};
126+
106127
case types.TOGGLE_STRING_ARRAY: {
107128
// Also change the TOGGLE_DEAD_CODE_INJECTION below if changed
108129
const stringArray = !state.stringArray;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"extract-text-webpack-plugin": "4.0.0-beta.0",
3333
"graceful-fs": "4.1.9",
3434
"inert": "5.1.0",
35-
"javascript-obfuscator": "0.18.8",
35+
"javascript-obfuscator": "0.19.0",
3636
"less": "2.7.1",
3737
"less-loader": "4.1.0",
3838
"pm2": "3.5.1",

templates/index.html

Lines changed: 30 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 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.18.8</code>
52+
<code><a href="https://github.com/javascript-obfuscator/javascript-obfuscator" target="_new">javascript-obfuscator</a>@0.19.0</code>
5353
created by Timofey Kachalov.
5454
</p>
5555
<div id="GithubBadges">
@@ -257,6 +257,35 @@ <h3>Sounds great!</h3>
257257
</td>
258258
</tr>
259259

260+
<tr>
261+
<td class="collapsing">Split Strings</td>
262+
<td>
263+
264+
<div class="ui tiny message">
265+
<p><i class="warning sign icon"></i> This option increases the size of the obfuscated code.</p>
266+
</div>
267+
268+
<p>
269+
This feature splits literal strings into chunks with length of the <code>splitStringsChunkLength</code> option value.
270+
</p>
271+
272+
<table class="ui definition table">
273+
<tbody>
274+
275+
<tr>
276+
<td class="collapsing">Split Strings Chunk Length</td>
277+
<td>
278+
<p>
279+
You can use this setting to set chunk length of the <code>splitStrings</code> option.
280+
</p>
281+
</td>
282+
</tr>
283+
284+
</tbody>
285+
</table>
286+
</td>
287+
</tr>
288+
260289
<tr>
261290
<td class="collapsing">String Array</td>
262291
<td>

0 commit comments

Comments
 (0)