-
Notifications
You must be signed in to change notification settings - Fork 1
131 lines (114 loc) · 3.66 KB
/
js-obfuscation-test.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
name: "Obfuscate js test application"
on:
push:
jobs:
test-js-obfuscation:
runs-on: ubuntu-latest
steps:
- name: Cleanup workspace path
uses: mickem/clean-after-action@v1
- name: Set current branch ref
id: git_info
run: |
echo "::set-output name=branch::${GITHUB_REF##*/}"
echo "::set-output name=hash::$(git rev-parse --short \"$GITHUB_SHA\")"
- uses: actions/checkout@v3
with:
ref: ${{ steps.git_info.outputs.branch }}
- uses: actions/setup-node@v3
with:
node-version: 14
- name: Execute without obfuscation
run: |
npm --prefix example install
node example/index.js
- name: Create distribution path
run: |
mkdir -p dist_low_obfuscation
- name: Low obfuscation test
uses: ./
with:
input_path: example
output_path: dist_low_obfuscation
compact: true
control_flow_flattening: false
dead_code_injection: false
debug_protection: false
debug_protection_interval: 0
log: false
disable_console_output: true
rename_globals: false
string_array_rotate: true
self_defending: true
string_array: true
string_array_encoding: 'none'
string_array_threshold: 0.75
unicode_escape_sequence: false
target: node
- name: Create distribution path
run: |
mkdir -p dist_medium_obfuscation
- name: Medium obfuscation test
uses: ./
with:
input_path: example
output_path: dist_medium_obfuscation
compact: true
control_flow_flattening: true
control_flow_flattening_threshold: 0.75
dead_code_injection: true
dead_code_injection_threshold: 0.4
debug_protection: false
debug_protection_interval: 0
log: false
disable_console_output: true
rename_globals: false
string_array_rotate: true
self_defending: true
string_array: true
string_array_encoding: 'base64'
string_array_threshold: 0.75
unicode_escape_sequence: false
target: node
- name: Create distribution path
run: |
mkdir -p dist_high_obfuscation
- name: High obfuscation test
uses: ./
with:
input_path: example
output_path: dist_high_obfuscation
compact: true
control_flow_flattening: true
control_flow_flattening_threshold: 1
dead_code_injection: true
dead_code_injection_threshold: 1
debug_protection: true
debug_protection_interval: 500
disable_console_output: true
rename_globals: false
string_array_rotate: true
self_defending: true
string_array: true
string_array_encoding: 'rc4'
string_array_threshold: 1
unicode_escape_sequence: false
target: node
- run: mkdir -p upload_files
- uses: vimtor/action-zip@v1
with:
files: dist_low_obfuscation/
dest: upload_files/dist_low_obfuscation.zip
- uses: vimtor/action-zip@v1
with:
files: dist_medium_obfuscation/
dest: upload_files/dist_medium_obfuscation.zip
- uses: vimtor/action-zip@v1
with:
files: dist_high_obfuscation/
dest: upload_files/dist_high_obfuscation.zip
- name: upload files
uses: actions/upload-artifact@v2
with:
name: obufscated_example_files
path: upload_files/