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

FR: Support for .pkpass files #11739

Open
fekir opened this issue May 1, 2024 · 10 comments
Open

FR: Support for .pkpass files #11739

fekir opened this issue May 1, 2024 · 10 comments
Labels
enhancement user plugin All plugins are cool, but some of them are too specific to be included on main repo.

Comments

@fekir
Copy link

fekir commented May 1, 2024

Does your feature request involve difficulty completing a task? Please describe.

koreader does not support pkpass files.
Supporting them out-of-the-box would make it possible to use an ebook reader for those documents at the airport and other places

Describe the solution you'd like
Being able to open pkpass files, in particular display the QR code

Describe alternatives you've considered

Convert pkpass to a PDF file, or make a screenshot of the displayed pkpass file.

Additional context

https://en.wikipedia.org/wiki/PKPASS

Open source application that supports pkpass:

@offset-torque
Copy link

I can't think of a scenario where a person travels with their e-reader but without their phone (an internet connected device which can already display pkpass files). Can you clarify in which cases this might be useful?

@fekir
Copy link
Author

fekir commented May 1, 2024

The battery of my ebook reader is much better than the one of my phone.

Also, what if the phone stops to work?

Two devices stopping to work at the same time is more improbable.

@offset-torque
Copy link

I see. As a backup it makes sense yes. But for non-android e-readers you already have to connect them to another device to transfer the pkpass files. At that moment, saving a screenshot of QR code is at most 10 seconds longer than transferring the pkpass. I can't see the utility of this tiny amount of benefit offsetting the effort of adding and maintaining this feature to KOReader, but it is up to our devs of course.

@Frenzie
Copy link
Member

Frenzie commented May 1, 2024

It seems to say it's merely a zip file with some images, in which case I suspect it's already supported if you add .zip at the end.

@fekir
Copy link
Author

fekir commented May 1, 2024

I see. As a backup it makes sense yes.

Yes, I would say it is more than a backup, I use it as primary device ;)

The monitor of my e-reader is bigger, thus scanning and reading the values is easier.
Longer battery life (days instead of hours) means I can use the device freely, while I would not do it with my phone (maybe more a psychological issue).

But for non-android e-readers you already have to connect them to another device to transfer the pkpass files. At that moment, saving a screenshot of QR code is at most 10 seconds longer than transferring the pkpass.

Yes, it is not a great effort to "convert" the pkpass to another format, which is what I am already doing.
Transferring, at least for me, is a non-issue.
I am already transferring the file from my PC to my phone...

I can't see the utility of this tiny amount of benefit offsetting the effort of adding and maintaining this feature to KOReader, but it is up to our devs of course.

👍

@fekir
Copy link
Author

fekir commented May 1, 2024

@Frenzie

It seems to say it's merely a zip file with some images, in which case I suspect it's already supported if you add .zip at the end.

Well, in that case koreader shows me the images (the logo of the company), but not the content of the json file (more or less the same content that mupdf shows me)

And the QR code (at least in my pkpass files) is not an image.

I suppose it is generated by the reader from the json data structure.

@Frenzie Frenzie added Plugin user plugin All plugins are cool, but some of them are too specific to be included on main repo. and removed Plugin labels May 1, 2024
@Frenzie
Copy link
Member

Frenzie commented May 1, 2024

I wrote that based on "icon.png is the digital pass icon. logo.png is displayed at the top left of the rendered pass."

The good news is that the format looks fairly simple.
https://github.com/alexandercerutti/passkit-generator/blob/bab4117cb029b00a50077262187fcc2ad9412357/examples/models/exampleBooking.pass/pass.json#L19-L25

@Frenzie
Copy link
Member

Frenzie commented May 1, 2024

I suppose it is generated by the reader from the json data structure.

This does suggest btw that if you long press on the file, choose "open with archive viewer", view pass.json and extra long-press (about 4 s) the "message", you can then do clipboard to QR.

@fekir
Copy link
Author

fekir commented May 2, 2024

I suppose it is generated by the reader from the json data structure.

This does suggest btw that if you long press on the file, choose "open with archive viewer", view pass.json and extra long-press (about 4 s) the "message", you can then do clipboard to QR.

Tested right now, the generated QR code looks completely different.

I'll try to find out whats written there...

@fekir
Copy link
Author

fekir commented May 10, 2024

I've downloaded

https://github.com/keefmoon/Passbook-Example-Code/blob/master/Pass-Example-Generic/Pass-Example-Generic.pkpass

and imported in passandroid

The qrcode contains the value "0000001", I suppose from the field

  "barcode" : {
  		"format" : "PKBarcodeFormatQR",
  		"message" : "0000001",
  		"messageEncoding" : "iso-8859-1",
  		"altText" : "Staff ID 0000001"
   },

from the file pass.json

This seems to be the relevant documentation: https://developer.apple.com/documentation/walletpasses/pass

(additional resource: https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/PassKit_PG/Creating.html)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement user plugin All plugins are cool, but some of them are too specific to be included on main repo.
Projects
None yet
Development

No branches or pull requests

3 participants