mirror of
https://github.com/v2board/v2board.git
synced 2025-06-13 21:28:27 +08:00
1.7.0
1.7.0
This commit is contained in:
@ -2,6 +2,8 @@
|
||||
|
||||
namespace App\Http\Controllers\Client\Protocols;
|
||||
|
||||
use App\Utils\Dict;
|
||||
use phpDocumentor\Reflection\Types\Self_;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
class Clash
|
||||
@ -36,7 +38,14 @@ class Clash
|
||||
$proxies = [];
|
||||
|
||||
foreach ($servers as $item) {
|
||||
if ($item['type'] === 'shadowsocks') {
|
||||
if ($item['type'] === 'shadowsocks'
|
||||
&& in_array($item['cipher'], [
|
||||
'aes-128-gcm',
|
||||
'aes-192-gcm',
|
||||
'aes-256-gcm',
|
||||
'chacha20-ietf-poly1305'
|
||||
])
|
||||
) {
|
||||
array_push($proxy, self::buildShadowsocks($user['uuid'], $item));
|
||||
array_push($proxies, $item['name']);
|
||||
}
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
namespace App\Http\Controllers\Client\Protocols;
|
||||
|
||||
use App\Utils\Helper;
|
||||
|
||||
class Shadowrocket
|
||||
{
|
||||
public $flag = 'shadowrocket';
|
||||
@ -43,6 +45,16 @@ class Shadowrocket
|
||||
|
||||
public static function buildShadowsocks($password, $server)
|
||||
{
|
||||
if ($server['cipher'] === '2022-blake3-aes-128-gcm') {
|
||||
$serverKey = Helper::getShadowsocksServerKey($server['created_at'], 16);
|
||||
$userKey = Helper::uuidToBase64($password, 16);
|
||||
$password = "{$serverKey}:{$userKey}";
|
||||
}
|
||||
if ($server['cipher'] === '2022-blake3-aes-256-gcm') {
|
||||
$serverKey = Helper::getShadowsocksServerKey($server['created_at'], 32);
|
||||
$userKey = Helper::uuidToBase64($password, 32);
|
||||
$password = "{$serverKey}:{$userKey}";
|
||||
}
|
||||
$name = rawurlencode($server['name']);
|
||||
$str = str_replace(
|
||||
['+', '/', '='],
|
||||
|
@ -29,7 +29,9 @@ class Shadowsocks
|
||||
$bytesRemaining = $user['transfer_enable'] - $bytesUsed;
|
||||
|
||||
foreach ($servers as $item) {
|
||||
if ($item['type'] === 'shadowsocks') {
|
||||
if ($item['type'] === 'shadowsocks'
|
||||
&& in_array($item['cipher'], ['aes-128-gcm', 'aes-256-gcm', 'aes-192-gcm'])
|
||||
) {
|
||||
array_push($configs, self::SIP008($item, $user));
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,14 @@ class Stash
|
||||
$proxies = [];
|
||||
|
||||
foreach ($servers as $item) {
|
||||
if ($item['type'] === 'shadowsocks') {
|
||||
if ($item['type'] === 'shadowsocks'
|
||||
&& in_array($item['cipher'], [
|
||||
'aes-128-gcm',
|
||||
'aes-192-gcm',
|
||||
'aes-256-gcm',
|
||||
'chacha20-ietf-poly1305'
|
||||
])
|
||||
) {
|
||||
array_push($proxy, self::buildShadowsocks($user['uuid'], $item));
|
||||
array_push($proxies, $item['name']);
|
||||
}
|
||||
|
@ -28,7 +28,14 @@ class Surfboard
|
||||
$proxyGroup = '';
|
||||
|
||||
foreach ($servers as $item) {
|
||||
if ($item['type'] === 'shadowsocks') {
|
||||
if ($item['type'] === 'shadowsocks'
|
||||
&& in_array($item['cipher'], [
|
||||
'aes-128-gcm',
|
||||
'aes-192-gcm',
|
||||
'aes-256-gcm',
|
||||
'chacha20-ietf-poly1305'
|
||||
])
|
||||
) {
|
||||
// [Proxy]
|
||||
$proxies .= self::buildShadowsocks($user['uuid'], $item);
|
||||
// [Proxy Group]
|
||||
|
@ -28,7 +28,14 @@ class Surge
|
||||
$proxyGroup = '';
|
||||
|
||||
foreach ($servers as $item) {
|
||||
if ($item['type'] === 'shadowsocks') {
|
||||
if ($item['type'] === 'shadowsocks'
|
||||
&& in_array($item['cipher'], [
|
||||
'aes-128-gcm',
|
||||
'aes-192-gcm',
|
||||
'aes-256-gcm',
|
||||
'chacha20-ietf-poly1305'
|
||||
])
|
||||
) {
|
||||
// [Proxy]
|
||||
$proxies .= self::buildShadowsocks($user['uuid'], $item);
|
||||
// [Proxy Group]
|
||||
|
Reference in New Issue
Block a user