diff --git a/backend/package.json b/backend/package.json index bf6067b..363c8f9 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.14.256", + "version": "2.14.257", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/core/rule-utils/parsers.js b/backend/src/core/rule-utils/parsers.js index 6289544..7556652 100644 --- a/backend/src/core/rule-utils/parsers.js +++ b/backend/src/core/rule-utils/parsers.js @@ -39,8 +39,7 @@ function AllRuleParser() { content: params[1], }; if ( - rule.type === 'IP-CIDR' || - rule.type === 'IP-CIDR6' + ['IP-CIDR', 'IP-CIDR6', 'GEOIP'].includes(rule.type) ) { rule.options = params.slice(2); } diff --git a/backend/src/core/rule-utils/producers.js b/backend/src/core/rule-utils/producers.js index ea0c82b..d11577f 100644 --- a/backend/src/core/rule-utils/producers.js +++ b/backend/src/core/rule-utils/producers.js @@ -10,6 +10,8 @@ function QXFilter() { 'SRC-IP', 'IN-PORT', 'PROTOCOL', + 'GEOSITE', + 'GEOIP', ]; if (UNSUPPORTED.indexOf(rule.type) !== -1) return null; @@ -29,6 +31,8 @@ function QXFilter() { function SurgeRuleSet() { const type = 'SINGLE'; const func = (rule) => { + const UNSUPPORTED = ['GEOSITE', 'GEOIP']; + if (UNSUPPORTED.indexOf(rule.type) !== -1) return null; let output = `${rule.type},${rule.content}`; if (['IP-CIDR', 'IP-CIDR6'].includes(rule.type)) { output += @@ -43,7 +47,7 @@ function LoonRules() { const type = 'SINGLE'; const func = (rule) => { // skip unsupported rules - const UNSUPPORTED = ['DEST-PORT', 'SRC-IP', 'IN-PORT', 'PROTOCOL']; + const UNSUPPORTED = ['SRC-IP', 'GEOSITE', 'GEOIP']; if (UNSUPPORTED.indexOf(rule.type) !== -1) return null; if (['IP-CIDR', 'IP-CIDR6'].includes(rule.type) && rule.options) { // Loon only supports the no-resolve option @@ -69,7 +73,7 @@ function ClashRuleProvider() { let output = `${TRANSFORM[rule.type] || rule.type},${ rule.content }`; - if (['IP-CIDR', 'IP-CIDR6'].includes(rule.type)) { + if (['IP-CIDR', 'IP-CIDR6', 'GEOIP'].includes(rule.type)) { if (rule.options) { // Clash only supports the no-resolve option rule.options = rule.options.filter((option) =>