diff --git a/backend/package.json b/backend/package.json index 83e598c3..c917fc13 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.36.39", + "version": "2.36.40", "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 b991ca12..2eb20750 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 >= 4) + (proxy.type === 'snell' && proxy.version >= 6) ) { return false; } else if ( @@ -85,12 +85,6 @@ export default function Stash_Producer() { ['xhttp'].includes(proxy.network) ) { return false; - } else if ( - proxy.encryption && - proxy.encryption !== 'none' && - ['vless'].includes(proxy.type) - ) { - return false; } else if ( ['ws'].includes(proxy.network) && proxy['ws-opts']?.['v2ray-http-upgrade'] diff --git a/backend/src/test/proxy-producers/structured.spec.js b/backend/src/test/proxy-producers/structured.spec.js index b28f9845..8c307ba3 100644 --- a/backend/src/test/proxy-producers/structured.spec.js +++ b/backend/src/test/proxy-producers/structured.spec.js @@ -315,7 +315,7 @@ describe('Proxy structured producers', function () { } }); - it('keeps Mihomo Snell versions 1 through 5', function () { + it('keeps Mihomo and Stash Snell versions 1 through 5', function () { const proxies = [1, 2, 3, 4, 5, 6].map((version) => ({ type: 'snell', name: `Snell ${version}`, @@ -326,27 +326,41 @@ describe('Proxy structured producers', function () { udp: true, })); - const internal = produceInternal('Mihomo', proxies); - const external = loadProducedYaml('Mihomo', proxies); + for (const platform of ['Mihomo', 'Stash']) { + const internal = produceInternal( + platform, + proxies.map((proxy) => ({ ...proxy })), + ); + const external = loadProducedYaml( + platform, + proxies.map((proxy) => ({ ...proxy })), + ); - expect(internal.map((proxy) => proxy.version)).to.deep.equal([ - 1, 2, 3, 4, 5, - ]); - expect(external.proxies.map((proxy) => proxy.version)).to.deep.equal([ - 1, 2, 3, 4, 5, - ]); - expect( - internal.find((proxy) => proxy.version === 1), - ).to.not.have.property('udp'); - expect( - internal.find((proxy) => proxy.version === 2), - ).to.not.have.property('udp'); - expect(internal.find((proxy) => proxy.version === 4).udp).to.equal( - true, - ); - expect(internal.find((proxy) => proxy.version === 5).udp).to.equal( - true, - ); + expect( + internal.map((proxy) => proxy.version), + platform, + ).to.deep.equal([1, 2, 3, 4, 5]); + expect( + external.proxies.map((proxy) => proxy.version), + platform, + ).to.deep.equal([1, 2, 3, 4, 5]); + expect( + internal.find((proxy) => proxy.version === 1), + platform, + ).to.not.have.property('udp'); + expect( + 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, + ); + } }); it('keeps supported Snell in sing-box by default', function () { @@ -2412,7 +2426,7 @@ describe('Proxy structured producers', function () { }); }); - it('keeps Stash VLESS TCP REALITY nodes while still filtering non-tcp and unsupported variants', function () { + it('keeps Stash VLESS TCP REALITY and Encryption nodes while filtering non-tcp REALITY', function () { const proxies = [ { type: 'vless', @@ -2495,15 +2509,17 @@ describe('Proxy structured producers', function () { const internal = produceInternal('Stash', proxies); const external = loadProducedYaml('Stash', proxies); - expect(internal).to.have.length(2); - expect(external.proxies).to.have.length(2); + expect(internal).to.have.length(3); + expect(external.proxies).to.have.length(3); expect(internal.map((proxy) => proxy.name)).to.deep.equal([ 'Supported Reality', 'Custom Flow', + 'Encrypted VLESS', ]); expect(external.proxies.map((proxy) => proxy.name)).to.deep.equal([ 'Supported Reality', 'Custom Flow', + 'Encrypted VLESS', ]); expectSubset(internal[0], { type: 'vless', @@ -2514,6 +2530,11 @@ describe('Proxy structured producers', function () { name: 'Custom Flow', flow: 'xtls-rprx-unknown', }); + expectSubset(internal[2], { + type: 'vless', + name: 'Encrypted VLESS', + encryption: 'aes-128-gcm', + }); expectSubset(external.proxies[0], { type: 'vless', name: 'Supported Reality', @@ -2523,6 +2544,11 @@ describe('Proxy structured producers', function () { name: 'Custom Flow', flow: 'xtls-rprx-unknown', }); + expectSubset(external.proxies[2], { + type: 'vless', + name: 'Encrypted VLESS', + encryption: 'aes-128-gcm', + }); }); it('keeps shadow-tls plugin objects for Shadowrocket', function () {