diff --git a/debian/changelog b/debian/changelog index ebc62c4..7c7cab6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,11 @@ +wifi-qr (0.2-3+18) unstable; urgency=medium + + * #18 Xiaomi QR code is parsed incorrectly. + + -- kokoye2007 Mon, 22 May 2023 04:32:35 +1000 + wifi-qr (0.2-3) unstable; urgency=medium - * #12 Password with special characters needs to be unquoted. * #17 QR issue when the name and SSID differ. * #16 QR issue when the password has special characters. * #15 QR issue when the SSID has special characters. diff --git a/debian/patches/0.2-3+18 b/debian/patches/0.2-3+18 new file mode 100644 index 0000000..370c6fe --- /dev/null +++ b/debian/patches/0.2-3+18 @@ -0,0 +1,41 @@ +Description: Xiaomi QR code is parsed incorrectly. + Xiaomi use own template. + . + wifi-qr (0.2-3) unstable; urgency=medium + . + * #18 Xiaomi QR code is parsed incorrectly. + * #17 QR issue when the name and SSID differ. + * #16 QR issue when the password has special characters. + * #15 QR issue when the SSID has special characters. + * #12 Password with special characters needs to be unquoted. +Author: kokoye2007 + +--- +Origin: upstream, https://github.com/kokoye2007/wifi-qr +Forwarded: not-needed +Reviewed-By: kokoye2007 +Last-Update: 2023-05-21 + +--- wifi-qr-0.2.orig/wifi-qr ++++ wifi-qr-0.2/wifi-qr +@@ -258,16 +258,16 @@ call_wifi_scan() { + WIFIQRDATA="${wifiqrdata}" + + # Extract the SSID +- QSSID=$(echo "$WIFIQRDATA" | sed -n 's/.*S:\(.*\);T.*/\1/p' | sed 's/\\\([\\;,:"\]\)/\1/g' ) ++ QSSID=$(echo "$WIFIQRDATA" | sed -n 's/.*S:\([^;]*\)\(;[PHT]\).*$/\1/p' | sed 's/\\\([\\;,:"\]\)/\1/g' ) + + # Extract the security type +- QTYPE=$(echo "$WIFIQRDATA" | sed -n 's/.*T:\(.*\);P.*/\1/p') ++ QTYPE=$(echo "$WIFIQRDATA" | sed -n 's/.*T:\([^;]*\)\(;[PHS]\).*$/\1/p' | sed 's/\\\([\\;,:"\]\)/\1/g' ) + + # Extract the password + if [[ $WIFIQRDATA == *';H:'* ]]; then +- QKEES=$(echo "$WIFIQRDATA" | sed -n 's/.*;P:\(.*\);H:.*/\1/p' | sed 's/\\:/:/g' | sed 's/\\\([\\;,:"\]\)/\1/g' ) ++ QKEES=$(echo "$WIFIQRDATA" | sed -n 's/.*P:\([^;]*\)\(;[TSH]\).*$/\1/p' | sed 's/\\\([\\;,:"\]\)/\1/g' ) + else +- QKEES=$(echo "$WIFIQRDATA" | sed -n 's/.*;P:\(.*\);;.*/\1/p' | sed 's/\\:/:/g' | sed 's/\\\([\\;,:"\]\)/\1/g' ) ++ QKEES=$(echo "$WIFIQRDATA" | sed -n 's/.*P:\([^;]*\)\(;[TS]\).*$/\1/p' | sed 's/\\\([\\;,:"\]\)/\1/g' ) + fi + + # Check if the Wi-Fi network is hidden diff --git a/debian/patches/series b/debian/patches/series index c806e74..9b6b13a 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,2 +1,3 @@ 01-QR-Code-Scan-From-File 0.2-3_update +0.2-3+18 diff --git a/wifi-qr b/wifi-qr index 8a8b122..d8e1449 100755 --- a/wifi-qr +++ b/wifi-qr @@ -258,16 +258,16 @@ call_wifi_scan() { WIFIQRDATA="${wifiqrdata}" # Extract the SSID - QSSID=$(echo "$WIFIQRDATA" | sed -n 's/.*S:\(.*\);T.*/\1/p' | sed 's/\\\([\\;,:"\]\)/\1/g' ) + QSSID=$(echo "$WIFIQRDATA" | sed -n 's/.*S:\([^;]*\)\(;[PHT]\).*$/\1/p' | sed 's/\\\([\\;,:"\]\)/\1/g' ) # Extract the security type - QTYPE=$(echo "$WIFIQRDATA" | sed -n 's/.*T:\(.*\);P.*/\1/p') + QTYPE=$(echo "$WIFIQRDATA" | sed -n 's/.*T:\([^;]*\)\(;[PHS]\).*$/\1/p' | sed 's/\\\([\\;,:"\]\)/\1/g' ) # Extract the password if [[ $WIFIQRDATA == *';H:'* ]]; then - QKEES=$(echo "$WIFIQRDATA" | sed -n 's/.*;P:\(.*\);H:.*/\1/p' | sed 's/\\:/:/g' | sed 's/\\\([\\;,:"\]\)/\1/g' ) + QKEES=$(echo "$WIFIQRDATA" | sed -n 's/.*P:\([^;]*\)\(;[TSH]\).*$/\1/p' | sed 's/\\\([\\;,:"\]\)/\1/g' ) else - QKEES=$(echo "$WIFIQRDATA" | sed -n 's/.*;P:\(.*\);;.*/\1/p' | sed 's/\\:/:/g' | sed 's/\\\([\\;,:"\]\)/\1/g' ) + QKEES=$(echo "$WIFIQRDATA" | sed -n 's/.*P:\([^;]*\)\(;[TS]\).*$/\1/p' | sed 's/\\\([\\;,:"\]\)/\1/g' ) fi # Check if the Wi-Fi network is hidden