Open
Conversation
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 <James.Bottomley@HansenPartnership.com>
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 <James.Bottomley@HansenPartnership.com>
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 <James.Bottomley@HansenPartnership.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).