mirror of
https://github.com/lush2020/edgetunnel.git
synced 2026-03-20 16:33:06 +08:00
feat: 删除混淆工作流文件 obfuscator.yml 和 obfuscator_up.yml
This commit is contained in:
63
.github/workflows/obfuscator.yml
vendored
63
.github/workflows/obfuscator.yml
vendored
@@ -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 }}
|
||||
66
.github/workflows/obfuscator_up.yml
vendored
66
.github/workflows/obfuscator_up.yml
vendored
@@ -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 }}
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user