From 00affda8f2b0993608b47bfef17a43ad0b5c778b Mon Sep 17 00:00:00 2001 From: infosave2007 Date: Sat, 24 Jan 2026 13:34:13 +0300 Subject: [PATCH] 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. --- inc/QrUtil.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inc/QrUtil.php b/inc/QrUtil.php index 293dc99..a822240 100644 --- a/inc/QrUtil.php +++ b/inc/QrUtil.php @@ -462,7 +462,8 @@ class QrUtil [ 'container' => 'amnezia-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, 'transport_proto' => 'tcp' ]