-
Notifications
You must be signed in to change notification settings - Fork 1
/
action.yml
477 lines (375 loc) · 12.4 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
name: 'Github Action javascript-obfuscator'
author: Kevin Rohn
description: 'Obfuscate javascript by using the javascript-obfuscator'
inputs:
input_path:
description: 'Single file or directory'
required: true
output_path:
description: 'Output path for single file or directory'
required: true
compact:
description: >
Compact code output on one line.
Type: boolean
Default: true
required: false
control_flow_flattening:
description: >
Enables control flow flattening.
Type: boolean
Default: false
required: false
control_flow_flattening_threshold:
description: >
The probability that the control flow flattening transformation will be applied to the node.
Type: boolean
Default: false
required: false
dead_code_injection:
required: false
description: >
Enables dead code injection
Type: boolean
Default: false
dead_code_injection_threshold:
required: false
description: >
The probability that the dead code injection transformation will be applied to the node.
Type: boolean
Default: false
debug_protection:
required: false
description: >
Disable browser Debug panel (can cause DevTools enabled browser freeze).
Type: boolean
Default: false
debug_protection_interval:
required: false
description: >
Sets interval in milliseconds for debug protection so it is working even after page was loaded (can cause DevTools enabled browser freeze).
Type: number
Default: 0
disable_console_output:
required: false
description: >
Allow console.log, console.info, console.error and console.warn messages output into browser console.
Type: boolean
Default: false
domain_lock:
required: false
description: >
Allows to run the obfuscated source code only on specific domains and/or sub-domains (comma separated).
Type: string[] (comma separated, without whitespaces)
Default: []
domain_lock_redirect_url:
required: false
description: >
Allows the browser to be redirected to a passed URL if the source code is not run on the domains specified by `domain_lock`.
Type: string
Default: about:blank
exclude:
required: false
description: >
A filename or glob which indicates files to exclude from obfuscation.
Type: string[] (comma separated, without whitespaces)
Default: []
force_transform_strings:
required: false
description: >
Enables force transformation of string literals, which being matched by passed RegExp patterns (comma separated).
Type: string[] (comma separated, without whitespaces)
Default: []
identifier_names_cache_path:
required: false
description: >
The existing .json file that will be used to read and write identifier names cache.
Type: string
Default:
identifier_names_generator:
required: false
description: >
Sets identifier names generator. Values: dictionary, hexadecimal, mangled, mangled-shuffled.
Type: string
Default: hexadecimal
identifiers_dictionary:
required: false
description: >
Identifiers dictionary (comma separated) for `identifier_names_generator dictionary` option.
Type: string[] (comma separated, without whitespaces)
Default: []
identifiers_prefix:
required: false
description: >
Sets prefix for all global identifiers.
Type: string
Default: ''
ignore_imports:
required: false
description: >
Prevents obfuscation of `require` and `dynamic` imports'
Type: boolean
Default: false
log:
required: false
description: >
Enables logging of the information to the console.
Type: boolean
Default: false
numbers_to_expressions:
required: false
description: >
Enables numbers conversion to expressions.
Type: boolean
Default: false
options_preset:
required: false
description: >
Allows to set options preset. Values: default, low-obfuscation, medium-obfuscation, high-obfuscation. Default: default
Type: string
Default: default
rename_globals:
required: false
description: >
Allows to enable obfuscation of global variable and function names with declaration.
Type: boolean
Default: false
rename_properties:
required: false
description: >
UNSAFE: Enables renaming of property names. This probably MAY break your code.
Type: boolean
Default: false
rename_properties_mode:
required: false
description: >
Specify `rename_properties` option mode. Values: safe, unsafe. Default: safe
Type: string
Default: safe
reserved_names:
required: false
description: >
Disables obfuscation and generation of identifiers, which being matched by passed RegExp patterns (comma separated).
Type: string[] (comma separated, without whitespaces)
Default: []
reserved_strings:
required: false
description: >
Disables transformation of string literals, which being matched by passed RegExp patterns (comma separated).
Type: string[] (comma separated, without whitespaces)
Default: []
seed:
required: false
description: >
Sets seed for random generator. This is useful for creating repeatable results.
Type: string|number
Default: false
self_defending:
required: false
description: >
Disables self-defending for obfuscated code.
Type: boolean
Default: false
simplify:
required: false
description: >
Enables additional code obfuscation through simplification.
Type: boolean
Default: true
source_map:
required: false
description: >
Enables source map generation.
Type: boolean
Default: false
source_map_base_url:
required: false
description: >
Sets base url to the source map import url when `source_map_mode: separate`.
Type: string
Default: ''
source_map_file_name:
required: false
description: >
Sets file name for output source map when `source_map_mode: separate`.
Type: string
Default: ''
source_map_mode:
required: false
description: >
Specify source map output mode. Values: inline, separate. Default: separate
Type: string
Default: 'separate'
source_map_sources_mode:
required: false
description: >
Specify source map sources mode. Values: sources, sources-content. Default: sources-content
Type: string
Default: sources-content
split_strings:
required: false
description: >
Splits literal strings into chunks with length of `split_strings_chunk_length` option value.
Type: boolean
Default: false
split_strings_chunk_length:
required: false
description: >
Sets chunk length of `split_strings` option
Type: number
Default: 10
string_array:
required: false
description: >
Enables gathering of all literal strings into an array and replacing every literal string with an array call.
Type: boolean
Default: true
string_array_calls_transform:
required: false
description: >
Enables the transformation of calls to the string array.
Type: boolean
Default: false
string_array_calls_transform_threshold:
required: false
description: >
The probability that that calls to the string array will be transformed.
Type: number
Default: 0.5
string_array_encoding:
required: false
description: >
Encodes each string in strings array using base64 or rc4 (this option can slow down your code speed). Values: none, base64, rc4. Default: none
Type: string[] (comma separated, without whitespaces)
Default: []
string_array_indexes_type:
required: false
description: >
Allows to control the type of string array call indexes.
Type: string[] (comma separated, without whitespaces)
Default: []
string_array_index_shift:
required: false
description: >
Enables additional index shift for all string array calls.
Type: boolean
Default: true
string_array_rotate:
required: false
description: >
Enable rotation of string array values during obfuscation.
Type: boolean
Default: true
string_array_shuffle:
required: false
description: >
Randomly shuffles string array items.
Type: boolean
Default: true
string_array_wrappers_count:
required: false
description: >
Sets the count of wrappers for the string array inside each root or function scope.
Type: number
Default: 1
string_array_wrappers_chained_calls:
required: false
description: >
Enables the chained calls between string array wrappers.
Type: boolean
Default: true
string_array_wrappers_parameters_max_count:
required: false
description: >
Allows to control the maximum number of string array wrappers parameters.
Type: number
Default: 2
string_array_wrappers_type:
required: false
description: >
Allows to select a type of the wrappers that are appending by the `string_array_wrappers_count` option. Values: variable, function. Default: variable
Type: string
Default: 'variable'
string_array_threshold:
required: false
description: >
The probability that the literal string will be inserted into `string_array` (Default: 0.8, Min: 0, Max: 1).
Type: number
Default: 0.8
target:
required: false
description: >
Allows to set target environment for obfuscated code. Values: browser, browser-no-eval, node. Default: browser.
Type: string
Default: browser
transform_object_keys:
required: false
description: >
Enables transformation of object keys.
Type: boolean
Default: false
unicode_escape_sequence:
required: false
description: >
Allows to enable/disable string conversion to unicode escape sequence.
Type: boolean
Default: false
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.input_path }}
- ${{ inputs.output_path }}
- ${{ inputs.control_flow_flattening }}
- ${{ inputs.control_flow_flattening_threshold }}
- ${{ inputs.dead_code_injection }}
- ${{ inputs.dead_code_injection_threshold }}
- ${{ inputs.debug_protection }}
- ${{ inputs.debug_protection_interval }}
- ${{ inputs.disable_console_output }}
- ${{ inputs.domain_lock }}
- ${{ inputs.domain_lock_redirect_url }}
- ${{ inputs.exclude }}
- ${{ inputs.force_transform_strings }}
- ${{ inputs.identifier_names_cache_path }}
- ${{ inputs.identifier_names_generator }}
- ${{ inputs.identifiers_prefix }}
- ${{ inputs.identifiers_dictionary }}
- ${{ inputs.ignore_imports }}
- ${{ inputs.log }}
- ${{ inputs.numbers_to_expressions }}
- ${{ inputs.options_preset }}
- ${{ inputs.reserved_names }}
- ${{ inputs.reserved_strings }}
- ${{ inputs.rename_globals }}
- ${{ inputs.rename_properties }}
- ${{ inputs.rename_properties_mode }}
- ${{ inputs.seed }}
- ${{ inputs.self_defending }}
- ${{ inputs.simplify }}
- ${{ inputs.source_map }}
- ${{ inputs.source_map_base_url }}
- ${{ inputs.source_map_file_name }}
- ${{ inputs.source_map_mode }}
- ${{ inputs.source_map_sources_mode }}
- ${{ inputs.split_strings }}
- ${{ inputs.split_strings_chunk_length }}
- ${{ inputs.string_array }}
- ${{ inputs.string_array_calls_transform }}
- ${{ inputs.string_array_calls_transform_threshold }}
- ${{ inputs.string_array_encoding }}
- ${{ inputs.string_array_indexes_type }}
- ${{ inputs.string_array_index_shift }}
- ${{ inputs.sring_array_rotate }}
- ${{ inputs.string_array_shuffle }}
- ${{ inputs.string_array_wrappers_count }}
- ${{ inputs.string_array_wrappers_chained_calls }}
- ${{ inputs.string_array_wrappers_parameters_max_count }}
- ${{ inputs.string_array_wrappers_type }}
- ${{ inputs.string_array_threshold }}
- ${{ inputs.target }}
- ${{ inputs.transform_object_keys }}
- ${{ inputs.unicode_escape_sequence }}
branding:
icon: 'package'
color: 'green'