Skip to content

reload page

reload page #5

Workflow file for this run

name: Obfuscate JS Code
on:
push:
branches: ["master"]
paths:
- "js/src/*"
permissions:
contents: write
pages: write
id-token: write
jobs:
obfuscate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Obfuscate JS Code
run: |
cd $GITHUB_WORKSPACE/js/src
sudo npm install uglify-js -g
sudo npm install javascript-obfuscator -g
rm ../bundle.min.js
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
rm ./output.js
if [ ! -z "${{ secrets.XXTEA_KEY }}" ]; then
sed -i "s/"${{ secrets.XXTEA_KEY }}"/20221209/" ./commands.js
fi
- name: Commit files
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -a -m "Obfuscate js code"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}