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

Pkpass exporter #156

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Pkpass exporter #156

wants to merge 3 commits into from

Conversation

jejb
Copy link

@jejb jejb commented Apr 25, 2023

Three commits: one to make the barcode scanner more robust (I've discovered some bugs scanning non-US airline passes). One to allow exporting the scanned barcode as a pkpass (or sharing if you have the app installed). To view, you need an app, like PassAndroid which can edit the pass because there is information missing which isn't in the barcode (like departure time and boarding group). The final commit adds the regulation TSAPre image if the barcode says it should be present. This is because the screeners at some TSA lines in the US seem to be very insistent on having this exact image on mobile boarding passes. The TSA publishes the image for free use, so there shouldn't be a copyright issue (even if they didn't, the TSA, being a US government entity, is required to release all copyrightable materials into the public domain anyway).

The pkpass exporter can also add the airline specific header images and icons which are on real mobile boarding passes. I haven't included any of these in this pull request because of doubts about copyright, but they can be added later if people think its a good idea (so far I've collected the ones for AA, DL, TK, AS and BA).

James Bottomley added 3 commits April 24, 2023 16:19
At the moment it throws an exception on various format errors.  Make
it more defensive about the requirements as well as return null in
every situation so the barcode scan still completes even if it isn't
recognized as a boarding pass.

Signed-off-by: James Bottomley <[email protected]>
This allows a scanned boarding pass to be converted to a pkpass file
and then shared with any application that can make use of it.  Note
that because of the limitations of what the boarding pass barcode
contains (no flight time, no frequent flyer status etc), the exported
pkpass is somewhat incomplete (so the user will have to add
information to certain fields).

This functionality is most useful with PassAndroid which allows pass
editing so you can fill in the missing information.

Signed-off-by: James Bottomley <[email protected]>
If you have TSAPre in the US it shows in the barcode, so if this
is present export the PKPASS with a TSAPre green check at the bottom
so you can use the Pre lanes without getting stopped.

Signed-off-by: James Bottomley <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant