mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-09-15 00:33:15 +08:00
feat: sing-box 订阅格式修改(如需原始格式 请使用 target=sing-box&produceType=internal); 清理 Clash 系无效字段
This commit is contained in:
parent
fa6a274f79
commit
e7a2e60963
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "sub-store",
|
"name": "sub-store",
|
||||||
"version": "2.14.271",
|
"version": "2.14.272",
|
||||||
"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": {
|
||||||
|
@ -150,6 +150,13 @@ export default function Clash_Producer() {
|
|||||||
|
|
||||||
delete proxy.subName;
|
delete proxy.subName;
|
||||||
delete proxy.collectionName;
|
delete proxy.collectionName;
|
||||||
|
delete proxy.id;
|
||||||
|
delete proxy.resolved;
|
||||||
|
for (const key in proxy) {
|
||||||
|
if (proxy[key] == null) {
|
||||||
|
delete proxy[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
if (
|
if (
|
||||||
['grpc'].includes(proxy.network) &&
|
['grpc'].includes(proxy.network) &&
|
||||||
proxy[`${proxy.network}-opts`]
|
proxy[`${proxy.network}-opts`]
|
||||||
|
@ -165,6 +165,13 @@ export default function ClashMeta_Producer() {
|
|||||||
}
|
}
|
||||||
delete proxy.subName;
|
delete proxy.subName;
|
||||||
delete proxy.collectionName;
|
delete proxy.collectionName;
|
||||||
|
delete proxy.id;
|
||||||
|
delete proxy.resolved;
|
||||||
|
for (const key in proxy) {
|
||||||
|
if (proxy[key] == null) {
|
||||||
|
delete proxy[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
if (
|
if (
|
||||||
['grpc'].includes(proxy.network) &&
|
['grpc'].includes(proxy.network) &&
|
||||||
proxy[`${proxy.network}-opts`]
|
proxy[`${proxy.network}-opts`]
|
||||||
|
@ -168,6 +168,13 @@ export default function ShadowRocket_Producer() {
|
|||||||
}
|
}
|
||||||
delete proxy.subName;
|
delete proxy.subName;
|
||||||
delete proxy.collectionName;
|
delete proxy.collectionName;
|
||||||
|
delete proxy.id;
|
||||||
|
delete proxy.resolved;
|
||||||
|
for (const key in proxy) {
|
||||||
|
if (proxy[key] == null) {
|
||||||
|
delete proxy[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
if (
|
if (
|
||||||
['grpc'].includes(proxy.network) &&
|
['grpc'].includes(proxy.network) &&
|
||||||
proxy[`${proxy.network}-opts`]
|
proxy[`${proxy.network}-opts`]
|
||||||
|
@ -789,7 +789,9 @@ export default function singbox_Producer() {
|
|||||||
$.error(e.message ?? e);
|
$.error(e.message ?? e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return type === 'internal' ? list : JSON.stringify(list, null, 2);
|
return type === 'internal'
|
||||||
|
? list
|
||||||
|
: JSON.stringify({ outbounds: list }, null, 2);
|
||||||
};
|
};
|
||||||
return { type, produce };
|
return { type, produce };
|
||||||
}
|
}
|
||||||
|
@ -257,6 +257,13 @@ export default function Stash_Producer() {
|
|||||||
|
|
||||||
delete proxy.subName;
|
delete proxy.subName;
|
||||||
delete proxy.collectionName;
|
delete proxy.collectionName;
|
||||||
|
delete proxy.id;
|
||||||
|
delete proxy.resolved;
|
||||||
|
for (const key in proxy) {
|
||||||
|
if (proxy[key] == null) {
|
||||||
|
delete proxy[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
if (
|
if (
|
||||||
['grpc'].includes(proxy.network) &&
|
['grpc'].includes(proxy.network) &&
|
||||||
proxy[`${proxy.network}-opts`]
|
proxy[`${proxy.network}-opts`]
|
||||||
|
@ -8,6 +8,13 @@ export default function URI_Producer() {
|
|||||||
let result = '';
|
let result = '';
|
||||||
delete proxy.subName;
|
delete proxy.subName;
|
||||||
delete proxy.collectionName;
|
delete proxy.collectionName;
|
||||||
|
delete proxy.id;
|
||||||
|
delete proxy.resolved;
|
||||||
|
for (const key in proxy) {
|
||||||
|
if (proxy[key] == null) {
|
||||||
|
delete proxy[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
if (['trojan', 'tuic', 'hysteria', 'hysteria2'].includes(proxy.type)) {
|
if (['trojan', 'tuic', 'hysteria', 'hysteria2'].includes(proxy.type)) {
|
||||||
delete proxy.tls;
|
delete proxy.tls;
|
||||||
}
|
}
|
||||||
|
@ -36,8 +36,13 @@ function operator(proxies = [], targetPlatform, context) {
|
|||||||
// isIPv6,
|
// isIPv6,
|
||||||
// isIP,
|
// isIP,
|
||||||
// yaml, // yaml 解析和生成
|
// yaml, // yaml 解析和生成
|
||||||
|
// getFlag, // 获取 emoji 旗帜
|
||||||
|
// getISO, // 获取 ISO 3166-1 alpha-2 代码
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
// 示例: 给节点名添加前缀
|
||||||
|
// $server.name = `[${ProxyUtils.getISO($server.name)}] ${$server.name}`
|
||||||
|
|
||||||
// 示例: 从 sni 文件中读取内容并进行节点操作
|
// 示例: 从 sni 文件中读取内容并进行节点操作
|
||||||
// const sni = await produceArtifact({
|
// const sni = await produceArtifact({
|
||||||
// type: 'file',
|
// type: 'file',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user