From a508cc665c711359a7d6c2c3c85683e0d03827cd Mon Sep 17 00:00:00 2001 From: infosave2007 Date: Sat, 24 Jan 2026 13:45:56 +0300 Subject: [PATCH] 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. --- inc/QrUtil.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/inc/QrUtil.php b/inc/QrUtil.php index e294506..9e434d9 100644 --- a/inc/QrUtil.php +++ b/inc/QrUtil.php @@ -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',