From 485869aabf81559fcbe047f35732c05bd1e27966 Mon Sep 17 00:00:00 2001 From: xream Date: Thu, 10 Sep 2026 23:30:53 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20Stash=20=E6=94=AF=E6=8C=81=20Snell=20v6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/package.json | 2 +- .../src/core/proxy-utils/producers/stash.js | 2 +- .../test/proxy-producers/structured.spec.js | 27 ++++++++++--------- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/backend/package.json b/backend/package.json index 01fc70ca..3126cec4 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.39.2", + "version": "2.39.4", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.", "main": "src/main.js", "packageManager": "pnpm@11.0.9", diff --git a/backend/src/core/proxy-utils/producers/stash.js b/backend/src/core/proxy-utils/producers/stash.js index 2eb20750..85de4eaa 100644 --- a/backend/src/core/proxy-utils/producers/stash.js +++ b/backend/src/core/proxy-utils/producers/stash.js @@ -58,7 +58,7 @@ export default function Stash_Producer() { '2022-blake3-aes-128-gcm', '2022-blake3-aes-256-gcm', ].includes(proxy.cipher)) || - (proxy.type === 'snell' && proxy.version >= 6) + (proxy.type === 'snell' && proxy.version > 6) ) { return false; } else if ( diff --git a/backend/src/test/proxy-producers/structured.spec.js b/backend/src/test/proxy-producers/structured.spec.js index a7a24fab..98c1aa88 100644 --- a/backend/src/test/proxy-producers/structured.spec.js +++ b/backend/src/test/proxy-producers/structured.spec.js @@ -315,8 +315,8 @@ describe('Proxy structured producers', function () { } }); - it('keeps Mihomo and Stash Snell versions 1 through 5', function () { - const proxies = [1, 2, 3, 4, 5, 6].map((version) => ({ + it('keeps Mihomo Snell versions 1 through 5 and Stash versions 1 through 6', function () { + const proxies = [1, 2, 3, 4, 5, 6, 7].map((version) => ({ type: 'snell', name: `Snell ${version}`, server: 'snell.example.com', @@ -326,7 +326,10 @@ describe('Proxy structured producers', function () { udp: true, })); - for (const platform of ['Mihomo', 'Stash']) { + for (const [platform, expectedVersions] of [ + ['Mihomo', [1, 2, 3, 4, 5]], + ['Stash', [1, 2, 3, 4, 5, 6]], + ]) { const internal = produceInternal( platform, proxies.map((proxy) => ({ ...proxy })), @@ -339,11 +342,11 @@ describe('Proxy structured producers', function () { expect( internal.map((proxy) => proxy.version), platform, - ).to.deep.equal([1, 2, 3, 4, 5]); + ).to.deep.equal(expectedVersions); expect( external.proxies.map((proxy) => proxy.version), platform, - ).to.deep.equal([1, 2, 3, 4, 5]); + ).to.deep.equal(expectedVersions); expect( internal.find((proxy) => proxy.version === 1), platform, @@ -352,14 +355,12 @@ describe('Proxy structured producers', function () { internal.find((proxy) => proxy.version === 2), platform, ).to.not.have.property('udp'); - expect(internal.find((proxy) => proxy.version === 4).udp).to.equal( - true, - platform, - ); - expect(internal.find((proxy) => proxy.version === 5).udp).to.equal( - true, - platform, - ); + for (const version of expectedVersions.filter((v) => v >= 3)) { + expect( + internal.find((proxy) => proxy.version === version).udp, + platform, + ).to.equal(true); + } } });