Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Barcode of Austria's largest loyalty program (JÖ Bonus Club) not supported? #181

Open
ILoveFOSS opened this issue Apr 3, 2021 · 7 comments
Labels
common: occasional Affects or can be seen by some users regularly or most users rarely severity: major Severely degrades major functionality or product features, with no satisfactory workaround state: blocked by upstream Can't currently be done due to a limitation of Android or another upstream state: help wanted I looked into this issue but couldn't solve it quickly type: enhancement New feature or request

Comments

@ILoveFOSS
Copy link

Hi!

(First I really want to thank all contributors for this project! It's a great tool and allows getting rid of all the privacy invading apps on my phone and the cards out of my wallet. I have been using stocard until recently but am very happy finding a FOSS alternative!)

I started moving my cards from Stocard to Catima and discovered that the Barcode of JÖ Bonus Club is successfully and correctly scanned but can't be displayed. Catima only shows me the numbers in plain text but no scanable version. To be fair the used barcode is quite unique, and I have never seen a similar one. Also, REWE is trying hard to hide the used barcode. On all their websites they only show the front of their card but never it's back. However, I was able to find a publicly available example (this is not my personal card): Picture Here is the link to the website if required: https://colnect.com/en/functional_cards/functional_card/52512-%C3%96sterreichs_Bonus_Club-J%C3%96-Shops_-_Supermarkets-Austria

Additional info: The JÖ Club is like a meta-loyalty program of all stores belonging to REWE Group and some other companies in Austria. You could also describe it as a copycat of the Payback loyalty program.

I would be very grateful if this barcode could be supported in an upcoming version!
Thank you!

@TheLastProject
Copy link
Member

Oh geez, that is... definitely quite unique yes.

The very interesting part is that if I scan it in Stocard, then take a screenshot and import that screenshot in Catima it shows Barcode type as RSS_EXPANDED but doesn't show an actual barcode.

Further research shows that I can enforce this to be detected, but then the following happens:

E/Catima: Failed to generate barcode of type RSS_EXPANDED: (01)09010374000019(21)02097564604859211217(10)01231287693
    com.google.zxing.WriterException: java.lang.IllegalArgumentException: No encoder available for format RSS_EXPANDED

So, the library used (zxing), can detect, but doesn't support generating RSS_EXPANDED barcodes.

Looking at https://github.com/zxing/zxing/blob/master/core/src/main/java/com/google/zxing/MultiFormatWriter.java, no new writing support has been added in 6 years, and zxing itself is in maintenance mode. The best fix would probably to switch to another more maintained library, preferably a more maintained fork of zxing.

So, while I do want to support this, the amount of work is sadly likely substantial so this won't happen soon.

@TheLastProject TheLastProject added type: enhancement New feature or request state: help wanted I looked into this issue but couldn't solve it quickly labels Apr 3, 2021
@TheLastProject
Copy link
Member

Hmm, it looks like zxing does support PRs with new features: https://github.com/zxing/zxing/pulls?q=is%3Apr+is%3Aclosed

So this may be possible to add to zxing, would be the least painful method probably.

@ILoveFOSS
Copy link
Author

I couldn't let go of this and tried to generate a JÖ Bonus Club barcode with an existing software as I can't code at all but wanted to support the development somehow. It took some research but I was successful eventually.

It was possible to generate it with the portableapps.com version of the Zint project: https://github.com/woo-j/zint, so the OkapiBarcode library might be able to do it too as it seems to be from the same person.

XZing calls the barcode RSS Expanded, that name is outdated however. Its name since 2007 is GS1 DataBar and the version used by JÖ Club is GS1 DataBar Expanded Stacked with 8 segments:
grafik
grafik

I hope this reduces the research time required for the person who can actually code this.

@TheLastProject
Copy link
Member

Thanks for the research, I'm sure it will help someone :)

So there are pretty much the following options:

  1. Add it to zxing (preferred if possible because the lowest amount of code changes necessary) or a fork of it (if a fork, preferably one that supports Java 7 still because of zxing-core 3.4.0 crashes on Android < 7.0 when decoding QR code zxing/zxing#1170, but I'm willing to keep my own fork with a patch restoring pre-Android 7 support if really necessary)
  2. Help OkapiBarcode support Android: Android support woo-j/OkapiBarcode#82

@ILoveFOSS
Copy link
Author

As 1. would clearly be a lot more efficient (it only requires an extension of existing functionality and not broad code changes in two independent projects), I was digging a little deeper.
As OkapiBarcode is written in Java such as Zxing, my naive perspective makes me believes that porting the capability is comparably straightforward?

This should be the file responsible for encoding GS1 DataBar Expanded in OkapiBarcode

@TheLastProject
Copy link
Member

Yeah, basically that should be it as I understand it too.

https://github.com/zxing/zxing/tree/master/core/src/main/java/com/google/zxing/oned/rss contains several readers, but not a writer. Looking at another writer in https://github.com/zxing/zxing/tree/master/core/src/main/java/com/google/zxing/oned, refactoring the OkapiBarcode code to fit within the functions zxing defines should be the easiest way to support this.

@TheLastProject
Copy link
Member

Got an email about this so a summary here: Someone needs to add this to zxing first.

@TheLastProject TheLastProject added state: blocked by upstream Can't currently be done due to a limitation of Android or another upstream common: occasional Affects or can be seen by some users regularly or most users rarely severity: major Severely degrades major functionality or product features, with no satisfactory workaround labels Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
common: occasional Affects or can be seen by some users regularly or most users rarely severity: major Severely degrades major functionality or product features, with no satisfactory workaround state: blocked by upstream Can't currently be done due to a limitation of Android or another upstream state: help wanted I looked into this issue but couldn't solve it quickly type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants