Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

提高一点非正常手段解题难度 #13

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/obfuscate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: ["master"]
paths:
- "js/src/*"
workflow_dispatch:

permissions:
contents: write
Expand All @@ -29,8 +30,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
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 --control-flow-flattening=true --debug-protection=true --debug-protection-interval=1000 --disable-console-output=true --domain-lock=exam.kernelsu.org --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 --numbers-to-expressions=true --rename-globals=true --self-defending=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);