feat: update QR code generation to use vpn:// format with JSON and zlib compression

This commit is contained in:
infosave2007
2026-04-20 21:15:35 +03:00
parent c1282a058d
commit 7bacc94e9c
3 changed files with 56 additions and 23 deletions
+2 -9
View File
@@ -1269,15 +1269,8 @@ class VpnClient
return self::generateQRCode($config, $protocolSlug);
}
// For AWG2, use compressed format (second QR code format)
if ($protocolSlug === 'awg2') {
$payloadCompressed = QrUtil::encodeCompressedConf($config, $protocolSlug);
$dataUri = QrUtil::pngBase64($payloadCompressed);
return $dataUri;
}
// For other WireGuard/AWG, use vpn:// URL format
$payloadVpn = QrUtil::encodeVpnUrlPayload($config, $protocolSlug);
// For AWG2 and other WireGuard/AWG, use vpn:// URL format with JSON + zlib
$payloadVpn = QrUtil::encodeVpnUrlConf($config, $protocolSlug);
$dataUri = QrUtil::pngBase64($payloadVpn);
return $dataUri;
} catch (Throwable $e) {