fix(qr): Add isThirdPartyConfig and reorder keys

- Added 'isThirdPartyConfig' => true to X-Ray config object. This flag is present in imported configs in Amnezia Android.
- Reordered keys so protocol object ('xray') comes before 'container' key, matching the order seen in WireGuard QR codes.
This commit is contained in:
infosave2007
2026-01-24 13:45:56 +03:00
parent b2f42ec7ec
commit 174a2fb1e8
+3 -2
View File
@@ -458,13 +458,14 @@ class QrUtil
$envelope = [ $envelope = [
'containers' => [ 'containers' => [
[ [
'container' => 'amnezia-xray',
'xray' => [ 'xray' => [
'isThirdPartyConfig' => true,
// X-Ray config must be wrapped in a "config" field inside the last_config JSON // 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), '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'
] ],
'container' => 'amnezia-xray'
] ]
], ],
'defaultContainer' => 'amnezia-xray', 'defaultContainer' => 'amnezia-xray',