fix: 修复ss2022订阅下发密码错误的问题

This commit is contained in:
xboard committed 2024-05-24 22:45:27 +08:00
1 parent 0c04c97ab5
commit 891d00c5a4
16 files changed
+37 -65

No files matched your search

+1 -11
View File
@@ -44,7 +44,7 @@ class SingBox
$proxies = [];
foreach ($this->servers as $item) {
if ($item['type'] === 'shadowsocks') {
$ssConfig = $this->buildShadowsocks($this->user['uuid'], $item);
$ssConfig = $this->buildShadowsocks($item['password'], $item);
$proxies[] = $ssConfig;
}
if ($item['type'] === 'trojan') {
@@ -77,16 +77,6 @@ class SingBox
protected 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}";
}
$array = [];
$array['tag'] = $server['name'];
$array['type'] = 'shadowsocks';