Wi-Fi QR codes with escape sequences or special characters are misparsed or not recognized
First of all, thank you for a great FOSS app that works even on very old Android devices — I read it supports Android 2.3, which is impressive! I haven't tested it on 2.3 myself, but that’s not the main point. Let me explain the issue.
The problem is that if the QR code for Wi-Fi has escape sequences in the SSID or PASSWORD field, it will either write the SSID incorrectly or it will not recognize the QR code type at all. And this means that if I created a CORRECT QR code in the QR code generator and there are special characters in it. I understood that these four symbols \, ;, :, ,. Then it doesn't reveal these characters. Here are some examples I noticed: \ ► \\ , ; ► \; , : ► \: , , ► \, .
But if I click on the “Copy password into clipboard” button in the upper right corner. The button with the key icon. Then the password will be correctly pasted into the clipboard and it can be viewed by pasting the contents of the clipboard into any text editor on Android. For example, Markor. But this won't happen if you click on the password value itself in the field I've marked. But this will not happen if you click on the values of SSID and PASSWORD fields. They are copied together with the backslash escape character \. I've labeled these two fields as “display field” in the purple box in the screenshot. I have the wildcard in my Wi-Fi password, but when I read the QR code of my network and clicked on “Connect to Wi-Fi” in BinaryEye the Android system did not connect to my Wi-Fi.
I've also noticed that if you write at least one Emoji in the PASSWORD field of a QR code for Wi-Fi. BinaryEye does not recognize QR code type. And it won't even recognize if there is at least one Cyrillic character. For example, from the Russian or Ukrainian alphabet. But for the SSID field you can do anything you want. BinaryEye recognizes QR code type.
I want BinaryEye to correctly recognize and decode this type of QR codes like Barcode Scanner does.
⚡ "Quick-Test, 3.141 @_'🥝/🍉:|:🍉\🥝'_@"; + })]>!<[({ ⚓
https://qrcode.tec-it.com/en/Wifi
This generator correctly escapes wildcards \, ;, :, ,. Some online generators if there are wildcards in the PASSWORD or SSID field, they do not escape them and you get an incorrect QR code for Wi-Fi. The plus of this generator is that it correctly (as it seems to me) shields wildcards. But the disadvantage is that it sends data to the server to generate a QR code.
-- Software Versions -------- Android: 12 (DoKe OS V3.0) BinaryEye: 1.66.0 (from F-Droid) Barcode Scanner: 1.25.2 (from F-Droid)
Screenshots (spoiler)
Test QR-codes (spoiler)
Thanks for filing an issue and especially for the detailled description 👍 And for using Binary Eye, of course 😄
[…] But this won't happen if you click on the password value itself in the field I've marked. […]
This was indeed a bug! It's fixed with https://github.com/markusfisch/BinaryEye/commit/46930ddea67648f6dfc234da7e0236cb6b07391e now. A new version will be out soon.
I've also noticed that if you write at least one Emoji in the PASSWORD field of a QR code for Wi-Fi. BinaryEye does not recognize QR code type. And it won't even recognize if there is at least one Cyrillic character. For example, from the Russian or Ukrainian alphabet. But for the SSID field you can do anything you want. BinaryEye recognizes QR code type.
This is a bit tricky. The reason the QR code isn't recognized as a Wifi QR Code is that Binary Eye immediately tries to build a WifiNetworkSuggestion (here), which fails because setWpa2Passphrase allows ASCII encodable passphrases only 😬
Now, it's probably still questionable to not show the parsed elements in that case (even if you won't be able to add the Wifi because of this limitation), so https://github.com/markusfisch/BinaryEye/commit/b083fcf213a261a232585f6801fdffb067240ce2 changes that.
I also tried the Barcode Scanner app (which is also very good) with your sample code (again, thanks for that!), and while it's showing the credentials correctly, it will crash when you actually try to add the Wifi for the exact same reason that setWpa2Passphrase will throw an IllegalArgumentException because the passpharse is not ASCII encodable 😉 I've just made a Merge Request to catch this exception properly.