fix(qr): Wrap X-Ray config in 'config' field inside last_config

Amnezia Android expects the contents of 'last_config' to be a JSON object
containing a 'config' field which holds the actual protocol configuration string.
Previously we were putting the configuration directly into 'last_config',
which caused the import to fail.
This commit is contained in:
infosave2007
2026-01-24 13:34:13 +03:00
parent e283fdac1d
commit 00affda8f2
+2 -1
View File
@@ -462,7 +462,8 @@ class QrUtil
[ [
'container' => 'amnezia-xray', 'container' => 'amnezia-xray',
'xray' => [ 'xray' => [
'last_config' => json_encode($clientCfg, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT), // X-Ray config must be wrapped in a "config" field inside the last_config JSON
'last_config' => json_encode(['config' => json_encode($clientCfg, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT)], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
'port' => (string) $port, 'port' => (string) $port,
'transport_proto' => 'tcp' 'transport_proto' => 'tcp'
] ]