wewewe718 / QrAndBarcodeScanner

An Android app for scanning QR codes and barcodes
The Unlicense
712 stars 141 forks source link

[bug] Connecting to WiFi from QR code doesn't work #84

Open kyoforkshomebrews opened 3 years ago

RunningDroid commented 2 years ago

It works, but it's strict.

This code (generated by my Nintendo Switch) works. WIFI:S:switch_9D04ED0100D;T:WPA;P:h79mcfxn;; 1636913009090

This code (generated by my Dad's Samsung S8+ on Android 9 in the WiFi menu) does not work because of the "Start of Heading" character at the end. WIFI:T:WPA;S:NETGEAR56-5G;P:perfectcello320;H:false; 1636913484582

ld892012 commented 1 year ago

No way to fix this ? The WiFi connect feature works rarely for me too

kyoforkshomebrews commented 1 year ago

This code (generated by my Dad's Samsung S8+ on Android 9 in the WiFi menu) does not work because of the "Start of Heading" character at the end.

Your issue seems to be different to what I meant, though i should've added that in the description. In this case the regex at https://github.com/wewewe718/QrAndBarcodeScanner/blob/a35d93047bdfe86e66a463d6689550865d60da7b/app/src/main/java/com/example/barcodescanner/model/schema/Wifi.kt is probably at fault. A quick fix would be "^WIFI:((?:.+?:(?:[^\\;]|\\.)*;)+);?�*$" which includes to match that specific heading character.

My issue however was that my WiFi QR codes are correctly parsed by the app but I can't connect to it. When I press "establish connection" it tells me "Connecting..." and then nothing happens. The ap is not added to wifi settings.