From a53e5daad21ecb28edda74fff3c0a18fc863444d Mon Sep 17 00:00:00 2001 From: cmliu Date: Sat, 18 Oct 2025 00:18:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=88=A0=E9=99=A4=E6=B7=B7=E6=B7=86?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=B5=81=E6=96=87=E4=BB=B6=20obfuscator.yml?= =?UTF-8?q?=20=E5=92=8C=20obfuscator=5Fup.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/obfuscator.yml | 63 --------------------------- .github/workflows/obfuscator_up.yml | 66 ----------------------------- _worker.js | 8 ++-- 3 files changed, 5 insertions(+), 132 deletions(-) delete mode 100644 .github/workflows/obfuscator.yml delete mode 100644 .github/workflows/obfuscator_up.yml diff --git a/.github/workflows/obfuscator.yml b/.github/workflows/obfuscator.yml deleted file mode 100644 index 3a18bb1..0000000 --- a/.github/workflows/obfuscator.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: 混淆当前版本源码 -on: - workflow_dispatch: - -jobs: - obfuscate: - runs-on: ubuntu-latest - permissions: - contents: write - - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: 使用 Node.js - uses: actions/setup-node@v3 - with: - node-version: "16" - - - name: 安装依赖 - run: npm install -g javascript-obfuscator - - - name: 检查备份文件是否存在 - run: | - if [ ! -f _worker.js.backup ]; then - echo "备份文件 _worker.js.backup 不存在,正在创建..." - cp _worker.js _worker.js.backup - fi - cp _worker.js.backup _worker_temp.js - - - name: 混淆代码 - run: | - javascript-obfuscator _worker_temp.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: 提交更改 - 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 _worker.js.backup - if git diff --cached --quiet; then - echo "没有文件更改,跳过提交" - else - git commit -m "混淆 _worker.js 文件并备份原文件" - fi - - - name: 推送更改 - uses: ad-m/github-push-action@master - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - branch: ${{ github.ref }} diff --git a/.github/workflows/obfuscator_up.yml b/.github/workflows/obfuscator_up.yml deleted file mode 100644 index ccc6a61..0000000 --- a/.github/workflows/obfuscator_up.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: 混淆最新版本源码 -on: - workflow_dispatch: - -jobs: - obfuscate: - runs-on: ubuntu-latest - permissions: - contents: write - - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: 使用 Node.js - uses: actions/setup-node@v3 - with: - node-version: "16" - - - name: 安装依赖 - run: npm install -g javascript-obfuscator - - - name: 检查备份文件是否存在 - run: | - if [ ! -f _worker.js.backup ]; then - echo "备份文件 _worker.js.backup 不存在,正在创建..." - cp _worker.js _worker.js.backup - fi - - - name: 加载源码 - run: | - curl -o 明文源码.js https://raw.githubusercontent.com/cmliu/edgetunnel/main/_worker.js - - - name: 混淆代码 - 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: 提交更改 - 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 _worker.js.backup - if git diff --cached --quiet; then - echo "没有文件更改,跳过提交" - else - git commit -m "混淆 _worker.js 文件并备份原文件" - fi - - - name: 推送更改 - uses: ad-m/github-push-action@master - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - branch: ${{ github.ref }} diff --git a/_worker.js b/_worker.js index 7e26c86..f845ccd 100644 --- a/_worker.js +++ b/_worker.js @@ -9,7 +9,6 @@ let subConfig = atob('aHR0cHM6Ly9yYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tL0FDTDRTU1IvQU let subProtocol = 'https'; let subEmoji = 'true'; let socks5Address = ''; -let parsedSocks5Address = {}; let enableSocks = false; let enableHttp = false; let noTLS = 'false'; @@ -124,7 +123,7 @@ export default { proxyIP = env.PROXYIP || env.proxyip || proxyIP; proxyIPs = await 整理(proxyIP); proxyIP = proxyIPs[Math.floor(Math.random() * proxyIPs.length)]; - proxyIP = proxyIP ? proxyIP.toLowerCase() : request.cf.colo + atob('LnByb3h5aXAuY21saXVzc3NzLm5ldA==') + proxyIP = proxyIP ? proxyIP.toLowerCase() : request.cf.colo + '.PrOXYip.CMLiussss.NeT'; socks5Address = env.HTTP || env.SOCKS5 || socks5Address; socks5s = await 整理(socks5Address); socks5Address = socks5s[Math.floor(Math.random() * socks5s.length)]; @@ -135,7 +134,7 @@ export default { if (env.BAN) banHosts = await 整理(env.BAN); if (socks5Address) { try { - parsedSocks5Address = socks5AddressParser(socks5Address); + socks5AddressParser(socks5Address); 请求CF反代IP = env.RPROXYIP || 'false'; enableSocks = true; } catch (err) { @@ -300,6 +299,9 @@ export default { } else if (new RegExp('/pyip=', 'i').test(url.pathname)) { proxyIP = url.pathname.toLowerCase().split('/pyip=')[1]; enableSocks = false; + } else if (new RegExp('/ip=', 'i').test(url.pathname)) { + proxyIP = url.pathname.toLowerCase().split('/ip=')[1]; + enableSocks = false; } return handleWebSocket(request);