WGDashboard icon indicating copy to clipboard operation
WGDashboard copied to clipboard

Invalid QR code

Open Quintasan opened this issue 2 years ago • 23 comments

Describe The Problem

Android WireGuard client refuses to import via QR code with

WireGuard/TunnelImporter: Couldn't import tunnel: unkown section in Config

I also tried scanning the QR code using https://play.google.com/store/apps/details?id=de.markusfisch.android.binaryeye&hl=pl&gl=US which yields 03048812 instead of the configuration file as one would expect

Quintasan avatar Mar 25 '22 18:03 Quintasan

Huh.. this is weird, what is the output of the QR code?

donaldzou avatar Mar 25 '22 18:03 donaldzou

Done

donaldzou avatar Mar 25 '22 18:03 donaldzou

This is what I got when I scan it

donaldzou avatar Mar 25 '22 18:03 donaldzou

Fascinating, I'm running official WireGuard client from Google Play, and it fails to decode this. Decoding also fails with Binary Eye which usually outputs the contents of QR codes as is.

Quintasan avatar Mar 25 '22 18:03 Quintasan

This is interesting lol, I never had this problem since i'm using an iOS device. I will look into it.

donaldzou avatar Mar 25 '22 18:03 donaldzou

Fascinating, I'm running official WireGuard client from Google Play, and it fails to decode this. Decoding also fails with Binary Eye which usually outputs the contents of QR codes as is.

What is the output of the qrcode when you use a normal scanner?

donaldzou avatar Mar 25 '22 18:03 donaldzou

Hi I've noticed that there are some part of the QR code did not show, around the border, could you try right click and save the qrcode and scan it again with wireguard? I used an android device to scan my own qrcode and it worked.

donaldzou avatar Mar 25 '22 18:03 donaldzou

No dice. Still the same issue. I think this is a problem with the library used by WireGuard client, ZXing which fails to recognize this as a QR code.

Binary Eye: UPC-E code ZXing: UPC-e code

@donaldzou what phone did you use, what Android version? what WireGuard application version?

Quintasan avatar Mar 25 '22 18:03 Quintasan

I was using a XiaoMi phone, android 11 and the newest wireguard version (just downloaded from playstore)

donaldzou avatar Mar 25 '22 18:03 donaldzou

Screen Shot 2022-03-25 at 2 49 10 PM

Can u try this?

donaldzou avatar Mar 25 '22 18:03 donaldzou

I created another peer for my Galaxy S10, and it has the same problem when using the WireGuard application. There must be some kind of issue with the way it deals with QR code recognition...

Quintasan avatar Mar 25 '22 18:03 Quintasan

Screen Shot 2022-03-25 at 2 49 10 PM

Can u try this?

Worked almost instantly. I guess it's those filled-in squares at the edges that made the difference

Quintasan avatar Mar 25 '22 18:03 Quintasan

Yes, the the qrcode on your side should looks similar to mine, you mind telling me what browser your are using?

donaldzou avatar Mar 25 '22 18:03 donaldzou

Yes, the the qrcode on your side should looks similar to mine, you mind telling me what browser your are using?

Firefox 98.0.2 under Windows 10

Quintasan avatar Mar 25 '22 19:03 Quintasan

FYI Chrome does the same shit

obraz

Quintasan avatar Mar 25 '22 19:03 Quintasan

I used my windows laptop with Firefox and it looks totally fine😂😂image

donaldzou avatar Mar 25 '22 19:03 donaldzou

FYI Chrome does the same shit

obraz

What if is something related to your Windows setting? Could you try log onto the dashboard with your phone?

donaldzou avatar Mar 25 '22 19:03 donaldzou

Exactly the same issue happens when I go to the dashboard using my phone. At this point I consider it a problem with my installation.

Quintasan avatar Mar 25 '22 19:03 Quintasan

do you mind to do python3 -m pip list | grep Flask-QRcode on your server and let me know the version number?

donaldzou avatar Mar 25 '22 19:03 donaldzou

Flask-QRCode 3.0.0

Quintasan avatar Mar 25 '22 19:03 Quintasan

This is very interesting... Python should have a same output across all different OS, that's why I choose to use python on this project... I will look into this...

donaldzou avatar Mar 25 '22 20:03 donaldzou

Or maybe do a fresh install? If you want to

donaldzou avatar Mar 25 '22 20:03 donaldzou

I've encountered an issue with scanning a QR code on a dark theme. It appears that adding white margins around the QR code is necessary.

anboch avatar May 07 '23 08:05 anboch