From dffe39b6d9d3736bb4268da37d7bb11f709d27a3 Mon Sep 17 00:00:00 2001 From: wyx2685 Date: Fri, 13 Oct 2023 09:28:50 +0900 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DV2rayNG=E7=9A=84SS2022?= =?UTF-8?q?=E8=AE=A2=E9=98=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Protocols/V2rayNG.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/Protocols/V2rayNG.php b/app/Protocols/V2rayNG.php index a91deeb7..9166fa60 100644 --- a/app/Protocols/V2rayNG.php +++ b/app/Protocols/V2rayNG.php @@ -41,6 +41,16 @@ class V2rayNG public static function buildShadowsocks($password, $server) { + if ($server['cipher'] === '2022-blake3-aes-128-gcm') { + $serverKey = Helper::getServerKey($server['created_at'], 16); + $userKey = Helper::uuidToBase64($password, 16); + $password = "{$serverKey}:{$userKey}"; + } + if ($server['cipher'] === '2022-blake3-aes-256-gcm') { + $serverKey = Helper::getServerKey($server['created_at'], 32); + $userKey = Helper::uuidToBase64($password, 32); + $password = "{$serverKey}:{$userKey}"; + } $name = rawurlencode($server['name']); $str = str_replace( ['+', '/', '='],