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:
+3
-2
@@ -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',
|
||||||
|
|||||||
Reference in New Issue
Block a user