Skip to content

Commit

Permalink
全局变量转私有
Browse files Browse the repository at this point in the history
Signed-off-by: Li Hua <[email protected]>
  • Loading branch information
real-LiHua committed Jun 18, 2024
1 parent 059e332 commit 30f13e4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/obfuscate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ jobs:
if [ ! -z "${{ secrets.XXTEA_KEY }}" ]; then
sed -i "s/20221209/"${{ secrets.XXTEA_KEY }}"/" ./commands.js
fi
uglifyjs ./terminal.js ./boot.js ./crypto.js ./system.js ./filesystem.js ./commands.js -c -o ./output.js
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
uglifyjs ./terminal.js ./boot.js ./crypto.js ./system.js ./filesystem.js ./commands.js ./init.js -c -o ./output.js
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
uglifyjs ./bundle.min.js -e -o ./bundle.min.js
rm ./output.js
if [ ! -z "${{ secrets.XXTEA_KEY }}" ]; then
sed -i "s/"${{ secrets.XXTEA_KEY }}"/20221209/" ./commands.js
Expand Down
11 changes: 1 addition & 10 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,6 @@ <h1><a href="https://github.com/syntaxseed/terminalfaker">Practical Exam for Ker
<!-- <script src="js/src/filesystem.js"></script>
<script src="js/src/commands.js"></script> -->

<script>
// Whether to use the longer boot load screen. If this is missing, defaults to true.
var useBootLoader = true;

// Set the command prompt style:
var customPrompt = function () { return "root@Arch ("+Terminal.path+") # ";};

// Initialize the terminal:
var term = Terminal.init(document.getElementById("terminal"), commands, customPrompt);
</script>
<!-- <script src="js/src/init.js"></script> -->
</body>
</html>
2 changes: 1 addition & 1 deletion js/bundle.min.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions js/src/init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Whether to use the longer boot load screen. If this is missing, defaults to true.
var useBootLoader = true;

// Set the command prompt style:
var customPrompt = function () { return "root@Arch ("+Terminal.path+") # ";};

// Initialize the terminal:
var term = Terminal.init(document.getElementById("terminal"), commands, customPrompt);

0 comments on commit 30f13e4

Please sign in to comment.