fix: uuid 只辅助判断, 不直接过滤

This commit is contained in:
xream 2025-02-20 22:52:35 +08:00
parent fda1252d0e
commit a23e2ffcd6
No known key found for this signature in database
GPG Key ID: 1D2C5225471789F9
3 changed files with 11 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "sub-store", "name": "sub-store",
"version": "2.16.49", "version": "2.16.50",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
"main": "src/main.js", "main": "src/main.js",
"scripts": { "scripts": {

View File

@ -81,9 +81,9 @@ function parse(raw) {
if (['vless', 'vmess'].includes(proxy.type)) { if (['vless', 'vmess'].includes(proxy.type)) {
const isProxyUUIDValid = isValidUUID(proxy.uuid); const isProxyUUIDValid = isValidUUID(proxy.uuid);
if (!isProxyUUIDValid) { if (!isProxyUUIDValid) {
$.error(`UUID is invalid: ${proxy.name} ${proxy.uuid}`); $.error(`UUID may be invalid: ${proxy.name} ${proxy.uuid}`);
} }
return isProxyUUIDValid; // return isProxyUUIDValid;
} }
return true; return true;
}); });
@ -235,8 +235,8 @@ function produce(proxies, targetPlatform, type, opts = {}) {
if (['vless', 'vmess'].includes(proxy.type)) { if (['vless', 'vmess'].includes(proxy.type)) {
const isProxyUUIDValid = isValidUUID(proxy.uuid); const isProxyUUIDValid = isValidUUID(proxy.uuid);
if (!isProxyUUIDValid) if (!isProxyUUIDValid)
$.error(`UUID is invalid: ${proxy.name} ${proxy.uuid}`); $.error(`UUID may be invalid: ${proxy.name} ${proxy.uuid}`);
return isProxyUUIDValid; // return isProxyUUIDValid;
} }
return true; return true;
@ -326,6 +326,7 @@ export const ProxyUtils = {
MMDB, MMDB,
Gist, Gist,
download, download,
isValidUUID,
}; };
function tryParse(parser, line) { function tryParse(parser, line) {

View File

@ -24,6 +24,10 @@ function operator(proxies = [], targetPlatform, context) {
// 16. `sing-box` 支持使用 `_network` 来设置 `network`, 例如 `tcp`, `udp` // 16. `sing-box` 支持使用 `_network` 来设置 `network`, 例如 `tcp`, `udp`
// require 为 Node.js 的 require, 在 Node.js 运行环境下 可以用来引入模块 // require 为 Node.js 的 require, 在 Node.js 运行环境下 可以用来引入模块
// 例如在 Node.js 环境下, 将文件内容写入 /tmp/1.txt 文件
// const fs = eval(`require("fs")`)
// // const path = eval(`require("path")`)
// fs.writeFileSync('/tmp/1.txt', $content, "utf8");
// $arguments 为传入的脚本参数 // $arguments 为传入的脚本参数
@ -69,6 +73,7 @@ function operator(proxies = [], targetPlatform, context) {
// Gist, // Gist 类 // Gist, // Gist 类
// download, // 内部的下载方法, 见 backend/src/utils/download.js // download, // 内部的下载方法, 见 backend/src/utils/download.js
// MMDB, // Node.js 环境 可用于模拟 Surge/Loon 的 $utils.ipasn, $utils.ipaso, $utils.geoip. 具体见 https://t.me/zhetengsha/1269 // MMDB, // Node.js 环境 可用于模拟 Surge/Loon 的 $utils.ipasn, $utils.ipaso, $utils.geoip. 具体见 https://t.me/zhetengsha/1269
// isValidUUID, // 辅助判断是否为有效的 UUID
// } // }
// 如果只是为了快速修改或者筛选 可以参考 脚本操作支持节点快捷脚本 https://t.me/zhetengsha/970 和 脚本筛选支持节点快捷脚本 https://t.me/zhetengsha/1009 // 如果只是为了快速修改或者筛选 可以参考 脚本操作支持节点快捷脚本 https://t.me/zhetengsha/970 和 脚本筛选支持节点快捷脚本 https://t.me/zhetengsha/1009