mirror of
https://github.com/lush2020/edgetunnel.git
synced 2026-03-22 01:22:21 +08:00
修复1101
This commit is contained in:
54
.github/workflows/obfuscator.yml
vendored
Normal file
54
.github/workflows/obfuscator.yml
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
name: Obfuscate and Commit
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
obfuscate:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "16"
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install -g javascript-obfuscator
|
||||
|
||||
- name: Obfuscate code
|
||||
run: |
|
||||
javascript-obfuscator 明文源码.js --output _worker.js \
|
||||
--compact true \
|
||||
--control-flow-flattening true \
|
||||
--control-flow-flattening-threshold 1 \
|
||||
--dead-code-injection true \
|
||||
--dead-code-injection-threshold 1 \
|
||||
--identifier-names-generator hexadecimal \
|
||||
--rename-globals true \
|
||||
--string-array true \
|
||||
--string-array-encoding 'rc4' \
|
||||
--string-array-threshold 1 \
|
||||
--transform-object-keys true \
|
||||
--unicode-escape-sequence true
|
||||
|
||||
- name: Commit changes
|
||||
run: |
|
||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git config --local user.name "github-actions[bot]"
|
||||
git add _worker.js
|
||||
git commit -m "Obfuscate _worker.js" || echo "No changes to commit"
|
||||
|
||||
- name: Push changes
|
||||
uses: ad-m/github-push-action@master
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: ${{ github.ref }}
|
||||
Reference in New Issue
Block a user