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 1006debc42
commit a508cc665c
+3 -2
View File
@@ -458,13 +458,14 @@ class QrUtil
$envelope = [
'containers' => [
[
'container' => 'amnezia-xray',
'xray' => [
'isThirdPartyConfig' => true,
// 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,
'transport_proto' => 'tcp'
]
],
'container' => 'amnezia-xray'
]
],
'defaultContainer' => 'amnezia-xray',