This commit is contained in:
cmliu
2024-11-24 21:05:05 +08:00
parent 7ea8766246
commit a4181243dd
3 changed files with 78 additions and 5 deletions

72
.github/workflows/obfuscator.yml vendored Normal file
View File

@@ -0,0 +1,72 @@
name: Obfuscate and Commit
on:
push:
paths:
- '_worker.src.js'
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: Prepare files for obfuscation
run: |
if grep -q "Obfuscate-cmliu" _worker.src.js; then
echo "检测到 Obfuscate 准备分段处理"
line_number=$(awk '/Obfuscate-cmliu/ {print NR; exit}' _worker.src.js)
echo "Obfuscate 分段处理行号为: $line_number"
head -n $line_number _worker.src.js > src.js
tail -n +$((line_number + 1)) _worker.src.js > obf.js
else
echo "未检测到 Obfuscate 执行全文件混淆"
cp _worker.src.js obf.js
fi
- name: Obfuscate code
run: |
javascript-obfuscator obf.js --output _worker.js \
--compact true \
--control-flow-flattening true \
--control-flow-flattening-threshold 1 \
--dead-code-injection true \
--dead-code-injection-threshold 1 \
--string-array true \
--string-array-encoding 'rc4' \
--string-array-threshold 1 \
--transform-object-keys true \
--unicode-escape-sequence true
- name: Concatenate src.js if exists
run: |
if [ -f src.js ]; then
cat src.js _worker.js > temp && mv temp _worker.js
fi
- 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 }}

View File

@@ -223,4 +223,4 @@ Telegram交流群[@CMLiussss](https://t.me/CMLiussss)**感谢[Alice Networ
- clash.meta[FlClash](https://github.com/chen08209/FlClash)
# 感谢
[zizifn](https://github.com/zizifn/edgetunnel)、[3Kmfi6HP](https://github.com/3Kmfi6HP/EDtunnel)、[Stanley-baby](https://github.com/Stanley-baby)、[ACL4SSR](https://github.com/ACL4SSR/ACL4SSR/tree/master/Clash/config)、[SHIJS1999](https://github.com/SHIJS1999/cloudflare-worker-vless-ip)、<a href="https://url.cmliussss.com/alice"><img src="https://alicenetworks.net/templates/lagom2/assets/img/logo/logo_big.194980063.png" width="150" height="75" alt="Alice Networks LTD"/></a>、
[zizifn](https://github.com/zizifn/edgetunnel)、[3Kmfi6HP](https://github.com/6Kmfi6HP/EDtunnel)、[Stanley-baby](https://github.com/Stanley-baby)、[ACL4SSR](https://github.com/ACL4SSR/ACL4SSR/tree/master/Clash/config)、[SHIJS1999](https://github.com/SHIJS1999/cloudflare-worker-vless-ip)、<a href="https://url.cmliussss.com/alice"><img src="https://alicenetworks.net/templates/lagom2/assets/img/logo/logo_big.194980063.png" width="150" height="75" alt="Alice Networks LTD"/></a>、

View File

@@ -80,6 +80,7 @@ let effectiveTime = 7;//有效时间 单位:天
let updateTime = 3;//更新时间
let userIDLow;
let userIDTime = "";
/*Obfuscate-cmliu*/
if (!isValidUUID(userID)) {
throw new Error('uuid is not valid');
}
@@ -1298,7 +1299,7 @@ function checkSUB(host) {
}
}
const 啥啥啥_写的这是啥啊 = 'dmxlc3M=';
const 啥啥啥_写的这是啥啊 = `\u0064\u006d\u0078\u006c\u0063\u0033\u004d\u003d`;
function 配置信息(UUID, 域名地址) {
const 协议类型 = atob(啥啥啥_写的这是啥啊);
@@ -1323,7 +1324,7 @@ function 配置信息(UUID, 域名地址) {
传输层安全 = ['',false];
}
const v2ray = `${协议类型}://${用户ID}@${地址}:${端口}?encryption=${加密方式}&security=${传输层安全[0]}&sni=${SNI}&fp=${指纹}&type=${传输层协议}&host=${伪装域名}&path=${encodeURIComponent(路径)}#${encodeURIComponent(别名)}`;
const v2ray = `${协议类型}://${用户ID}@${地址}:${端口}\u003f\u0065\u006e\u0063\u0072\u0079\u0070\u0074\u0069\u006f\u006e\u003d${加密方式}&security=${传输层安全[0]}&sni=${SNI}&fp=${指纹}&type=${传输层协议}&host=${伪装域名}&path=${encodeURIComponent(路径)}#${encodeURIComponent(别名)}`;
const clash = `- type: ${协议类型}
name: ${FileName}
server: ${地址}
@@ -1824,7 +1825,7 @@ function subAddresses(host,UUID,noTLS,newAddressesapi,newAddressescsv,newAddress
let 节点备注 = '';
const 协议类型 = atob(啥啥啥_写的这是啥啊);
const vlessLink = `${协议类型}://${UUID}@${address}:${port}?encryption=none&security=&type=ws&host=${伪装域名}&path=${encodeURIComponent(最终路径)}#${encodeURIComponent(addressid + 节点备注)}`;
const vlessLink = `${协议类型}://${UUID}@${address}:${port}\u003f\u0065\u006e\u0063\u0072\u0079\u0070\u0074\u0069\u006f\u006e\u003dnone&security=&type=ws&host=${伪装域名}&path=${encodeURIComponent(最终路径)}#${encodeURIComponent(addressid + 节点备注)}`;
return vlessLink;
@@ -1889,7 +1890,7 @@ function subAddresses(host,UUID,noTLS,newAddressesapi,newAddressescsv,newAddress
}
const 协议类型 = atob(啥啥啥_写的这是啥啊);
const vlessLink = `${协议类型}://${UUID}@${address}:${port}?encryption=none&security=tls&sni=${伪装域名}&fp=random&type=ws&host=${伪装域名}&path=${encodeURIComponent(最终路径)}#${encodeURIComponent(addressid + 节点备注)}`;
const vlessLink = `${协议类型}://${UUID}@${address}:${port}\u003f\u0065\u006e\u0063\u0072\u0079\u0070\u0074\u0069\u006f\u006e\u003dnone&security=tls&sni=${伪装域名}&fp=random&type=ws&host=${伪装域名}&path=${encodeURIComponent(最终路径)}#${encodeURIComponent(addressid + 节点备注)}`;
return vlessLink;
}).join('\n');