Android icon indicating copy to clipboard operation
Android copied to clipboard

[BUG] Cyrillic and other characters support in QR code from pkpass files

Open 000exploit opened this issue 6 months ago • 9 comments

Similar issue as in SeineEloquenz/fosswallet#110, I see the same question marks when scanning the generated QR code. I don't know, if it's possible to fix this here because of, perhaps, generic way to generate QR codes. I can send .pkpass file as an example, if it necessary.

000exploit avatar Jun 21 '25 05:06 000exploit

Just an example, how it works right now:

Image

Image

000exploit avatar Jun 21 '25 05:06 000exploit

I was pretty sure I had to do something with messageEncoding in the pkpass parser, it's even marked as a todo, but I indeed had no file to test with so couldn't be sure. If you could send the affected file that would be great yeah :)

TheLastProject avatar Jun 21 '25 06:06 TheLastProject

@TheLastProject of course I can, but only by sending it via email. It contains sensetive information, so I can't post it here. Is this acceptable for you? I saw an email in your gh profile, may I send to it?

000exploit avatar Jun 21 '25 06:06 000exploit

Yeah sure :)

I do prefer public when possible, especially because then stuff can be added to unit tests, but yeah, with files like these I very much understand :)

TheLastProject avatar Jun 21 '25 08:06 TheLastProject

Just sent it! Check your inbox.

000exploit avatar Jun 21 '25 08:06 000exploit

Can confirm: the value is correctly read, but the barcode itself is generated incorrectly. Seems like this might be a similar issue to #1697 and #1496, but the card ID itself is saved fine so easier to debug this probably :)

TheLastProject avatar Jun 21 '25 10:06 TheLastProject

So? Is there any progress on this issue? I'll be traveling across the EU soon, and I'm choosing the right mobile application right now.

000exploit avatar Sep 25 '25 20:09 000exploit

I haven't had time to look deeper into this no. Contributions welcome.

TheLastProject avatar Sep 25 '25 20:09 TheLastProject

Okay I did look a bit deeper today and... what a rabbit hole it is.

The patch in FossWallet makes some sense, reading the messageEncoding field in a pkpass file is definitely correct and will at least fix pkpass files. However, it doesn't fix scanning QR codes and the likes.

Scouring the internet for several hours I could find that zxing seems to default to ISO-8859-1 for most barcodes, but that is definitely wrong for cyrillic. However! Defaulting to UTF-8 will also break some scanners according to my research, as not all scanners support UTF-8. So just always forcing UTF-8 is a bad idea too (I expect little issues here for FossWallet because the messageEncoding is a required field and thus should always be defined).

I created https://github.com/CatimaLoyalty/Android/pull/2716 but I don't think I'll merge that very soon. I first want to get the crash reporter out there, just in case this goes wrong.

TheLastProject avatar Sep 26 '25 22:09 TheLastProject