Skip to content

Commit

Permalink
Fix Obfuscate JS Code (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
natsumerinchan authored Aug 10, 2023
1 parent 0c8ca85 commit 67795f1
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 56 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/obfuscate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
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
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
- 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 }}
55 changes: 0 additions & 55 deletions .github/workflows/static.yml

This file was deleted.

2 changes: 1 addition & 1 deletion js/src/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ builtInCommands.ls = {
var children = Array.prototype.slice.call(term.filesystemPointer.querySelector('c').children);
children.forEach(function(element, index){
listing += "<span class='filesystem-"+element.nodeName+"'>"+element.getAttribute('name')+"</span>";
if( args[1] && args[1] == "-l"){
if( args[1] && (args[1] == "-l" || args[1] == "-al")){
listing += "<br>";
}else{
listing += "&nbsp;&nbsp;";
Expand Down

0 comments on commit 67795f1

Please sign in to comment.