mirror of
https://github.com/amnezia-vpn/amneziawg-android.git
synced 2026-10-14 05:41:48 +00:00
[GH-ISSUE #56] Android AmneziaWG fails to scan QR code from macOS AmneziaVPN when config contains empty I2, I3, I4, I5 fields #31
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
amnezia-vpn/amneziawg-android#31
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @nia-sempai on GitHub (Feb 16, 2026).
Original GitHub issue: https://github.com/amnezia-vpn/amneziawg-android/issues/56
The problem
When sharing a VPN connection from AmneziaVPN on macOS to AmneziaWG on Android using the "Native AmneziaWG format" QR code, the Android app fails to import the tunnel. It shows a syntax error near "interface" after scanning.
How it breaks
What the QR code contains (simplified version of the broken config):
How I fixed it
I manually removed all empty fields:
I2 =I3 =I4 =I5 =After removing these lines, I generated a new QR code (using http://qrcoder.ru/) with the cleaned config. This time VPN connected and works perfectly
Expected behavior
QR codes generated by macOS AmneziaVPN in Native AmneziaWG format should scan and import correctly on Android AmneziaWG without manual editing.
@decide-you commented on GitHub (Feb 18, 2026):
thank you for solution
@warment commented on GitHub (Aug 28, 2026):
Workaround: decode the
vpn://export into a plain.confand import by fileThe QR generated by AmneziaVPN (macOS) in "Native AmneziaWG format" is actually an AmneziaQR payload (
vpn://…= base64url → zlib → JSON →configstring), not a plain WireGuard config. The Android scanner chokes on it withsyntax error near 'interface'. This is the same incompatibility the docs admit ("The QR code cannot be scanned if you selected AmneziaWG native format").Bypass the broken scan entirely: turn that export into a plain text config and import it as a file.
I built a small MIT tool that does exactly this:
fixed.conf→ import in AmneziaWG via Import from file (works reliably).qr.png→ a QR built from the plain config text, which the scanner accepts.Repo: https://github.com/warment/amneziawg-qr-fix (releases include a ready script).
One caveat for this specific issue: the tool currently preserves the empty
I2 =/I3 =/I4 =/I5 =lines that break Android import in your case. If import still fails after decoding, delete those empty lines (as you did manually) before generating the QR — I'll add automatic stripping of empty AWG fields in the next release. The--rawflag returns the config unchanged so you can edit it.Root cause worth fixing upstream: the QR/export encoder should emit either a valid plain
.confor a self-consistent AmneziaQR that the same app's scanner can parse — right now it emits the latter but the scanner expects the former.