mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-11 13:49:02 +08:00
feat: 规则中处理 GEOIP/GEOSITE, Loon 已支持 SRC-PORT/DEST-PORT/PROTOCOL
This commit is contained in:
parent
bbb9602f9f
commit
6ec8c29f6a
@ -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": {
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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) =>
|
||||
|
Loading…
x
Reference in New Issue
Block a user