Skip to content

Commit 30f13e4

Browse files
committed
全局变量转私有
Signed-off-by: Li Hua <[email protected]>
1 parent 059e332 commit 30f13e4

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

.github/workflows/obfuscate.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ jobs:
2929
if [ ! -z "${{ secrets.XXTEA_KEY }}" ]; then
3030
sed -i "s/20221209/"${{ secrets.XXTEA_KEY }}"/" ./commands.js
3131
fi
32-
uglifyjs ./terminal.js ./boot.js ./crypto.js ./system.js ./filesystem.js ./commands.js -c -o ./output.js
33-
javascript-obfuscator ./output.js -o ../bundle.min.js --options-preset high-obfuscation --force-transform-strings=You,have,successfully,completed,exam,The,Group,Pass,word,pwd,fastboot --identifier-names-generator=dictionary --identifiers-dictionary=You,have,successfully,completed,exam,The,Group,Pass,word,pwd,decrypt,fastboot,ok,isOK,isSuccessfully,isTrue,secret,Terminal,term,commands --numbers-to-expressions=true --rename-globals=true --reserved-names=Terminal,commands --split-strings-chunk-length=4 --split-strings=true --string-array-calls-transform=true --string-array-encoding=base64,rc4 --string-array-index-shift=true --string-array-shuffle=true --string-array=true --string-array-wrappers-chained-calls=true --unicode-escape-sequence=true
32+
uglifyjs ./terminal.js ./boot.js ./crypto.js ./system.js ./filesystem.js ./commands.js ./init.js -c -o ./output.js
33+
javascript-obfuscator ./output.js -o ../bundle.min.js --options-preset high-obfuscation --force-transform-strings=You,have,successfully,completed,exam,The,Group,Pass,word,pwd,fastboot --identifier-names-generator=dictionary --identifiers-dictionary=You,have,successfully,completed,exam,The,Group,Pass,word,pwd,decrypt,fastboot,ok,isOK,isSuccessfully,isTrue,secret,Terminal,term,commands --numbers-to-expressions=true --rename-globals=true --rename-properties=true --split-strings-chunk-length=4 --split-strings=true --string-array-calls-transform=true --string-array-encoding=base64,rc4 --string-array-index-shift=true --string-array-shuffle=true --string-array=true --string-array-wrappers-chained-calls=true --transform-object-keys=true --unicode-escape-sequence=true
34+
uglifyjs ./bundle.min.js -e -o ./bundle.min.js
3435
rm ./output.js
3536
if [ ! -z "${{ secrets.XXTEA_KEY }}" ]; then
3637
sed -i "s/"${{ secrets.XXTEA_KEY }}"/20221209/" ./commands.js

index.html

+1-10
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,6 @@ <h1><a href="https://github.com/syntaxseed/terminalfaker">Practical Exam for Ker
5454
<!-- <script src="js/src/filesystem.js"></script>
5555
<script src="js/src/commands.js"></script> -->
5656

57-
<script>
58-
// Whether to use the longer boot load screen. If this is missing, defaults to true.
59-
var useBootLoader = true;
60-
61-
// Set the command prompt style:
62-
var customPrompt = function () { return "root@Arch ("+Terminal.path+") # ";};
63-
64-
// Initialize the terminal:
65-
var term = Terminal.init(document.getElementById("terminal"), commands, customPrompt);
66-
</script>
57+
<!-- <script src="js/src/init.js"></script> -->
6758
</body>
6859
</html>

js/bundle.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/src/init.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Whether to use the longer boot load screen. If this is missing, defaults to true.
2+
var useBootLoader = true;
3+
4+
// Set the command prompt style:
5+
var customPrompt = function () { return "root@Arch ("+Terminal.path+") # ";};
6+
7+
// Initialize the terminal:
8+
var term = Terminal.init(document.getElementById("terminal"), commands, customPrompt);

0 commit comments

Comments
 (0)