From c569008df0f7eb196dbb0b5a3418b5f8edc504a0 Mon Sep 17 00:00:00 2001 From: dev Date: Fri, 11 Apr 2025 10:58:20 -0700 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=20Stash=20?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rewrite-Parser.beta.js | 2 ++ Rewrite-Parser.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Rewrite-Parser.beta.js b/Rewrite-Parser.beta.js index d9073e0..a5eabe4 100644 --- a/Rewrite-Parser.beta.js +++ b/Rewrite-Parser.beta.js @@ -1199,6 +1199,8 @@ if (binaryInfo != null && binaryInfo.length > 0) { rules.push(mark + noteK + ruletype + ',' + rulevalue + ',' + rulepolicy + rulenore + rulesni + rulepm) } else if (/^(?:and|or|not)$/i.test(ruletype) && !isStashiOS) { rules.push(ori) + } else if (/^(?:and|or|not)$/i.test(ruletype) && isStashiOS) { + rules.push(mark + noteK2 + '- ' + ori) } else if (/(?:^domain$|domain-suffix|domain-keyword|ip-|de?st-port)/i.test(ruletype) && isStashiOS) { rules.push(mark + noteK2 + '- ' + ruletype + ',' + rulevalue + ',' + rulepolicy + rulenore) } else if (/src-port/i.test(ruletype) && (isSurgeiOS || isLooniOS)) { diff --git a/Rewrite-Parser.js b/Rewrite-Parser.js index d9073e0..a5eabe4 100644 --- a/Rewrite-Parser.js +++ b/Rewrite-Parser.js @@ -1199,6 +1199,8 @@ if (binaryInfo != null && binaryInfo.length > 0) { rules.push(mark + noteK + ruletype + ',' + rulevalue + ',' + rulepolicy + rulenore + rulesni + rulepm) } else if (/^(?:and|or|not)$/i.test(ruletype) && !isStashiOS) { rules.push(ori) + } else if (/^(?:and|or|not)$/i.test(ruletype) && isStashiOS) { + rules.push(mark + noteK2 + '- ' + ori) } else if (/(?:^domain$|domain-suffix|domain-keyword|ip-|de?st-port)/i.test(ruletype) && isStashiOS) { rules.push(mark + noteK2 + '- ' + ruletype + ',' + rulevalue + ',' + rulepolicy + rulenore) } else if (/src-port/i.test(ruletype) && (isSurgeiOS || isLooniOS)) { From 6959dff543029de169e2083884ef8ba8984da0a5 Mon Sep 17 00:00:00 2001 From: dev Date: Fri, 11 Apr 2025 10:58:39 -0700 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=20Stash=20JQ?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rewrite-Parser.beta.js | 4 ++-- Rewrite-Parser.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Rewrite-Parser.beta.js b/Rewrite-Parser.beta.js index a5eabe4..733fc6c 100644 --- a/Rewrite-Parser.beta.js +++ b/Rewrite-Parser.beta.js @@ -559,7 +559,7 @@ if (binaryInfo != null && binaryInfo.length > 0) { if (/\s((request|response)-body-json-jq)\s/.test(_x)) { let [_, regex, type, value] = _x.match(/^(.*?)\s+?(?:(request|response)-body-json-jq)\s+?(.*?)\s*$/) - if (jqEnabled && isSurgeiOS) { + if (jqEnabled && (isSurgeiOS || isStashiOS)) { const jqPath = value.match(/jq-path="(.+?)"/)?.[1] if (jqPath) { if (/^https?:\/\//.test(jqPath)) { @@ -610,7 +610,7 @@ if (binaryInfo != null && binaryInfo.length > 0) { const jsptn = regex let args = [[action, newSuffixArray]] - if (jqEnabled && isSurgeiOS) { + if (jqEnabled && (isSurgeiOS || isStashiOS)) { if (action === 'json-add') { newSuffixArray.forEach(item => { const paths = parseJsonPath(item[0]) diff --git a/Rewrite-Parser.js b/Rewrite-Parser.js index a5eabe4..733fc6c 100644 --- a/Rewrite-Parser.js +++ b/Rewrite-Parser.js @@ -559,7 +559,7 @@ if (binaryInfo != null && binaryInfo.length > 0) { if (/\s((request|response)-body-json-jq)\s/.test(_x)) { let [_, regex, type, value] = _x.match(/^(.*?)\s+?(?:(request|response)-body-json-jq)\s+?(.*?)\s*$/) - if (jqEnabled && isSurgeiOS) { + if (jqEnabled && (isSurgeiOS || isStashiOS)) { const jqPath = value.match(/jq-path="(.+?)"/)?.[1] if (jqPath) { if (/^https?:\/\//.test(jqPath)) { @@ -610,7 +610,7 @@ if (binaryInfo != null && binaryInfo.length > 0) { const jsptn = regex let args = [[action, newSuffixArray]] - if (jqEnabled && isSurgeiOS) { + if (jqEnabled && (isSurgeiOS || isStashiOS)) { if (action === 'json-add') { newSuffixArray.forEach(item => { const paths = parseJsonPath(item[0])