10 ms·
Getting my library cards onto my phone the hard way
- amluto 3y ago> for some reason, passes are cryptographically signed, and they have to be signed with a key known to one of Apple’s certificate authorities. Cryptographically signing these files makes some sense when you consider that passes were designed to get automatic updates from their vendors; for example, your boarding pass for a flight reflecting gate changes or changing your seat assignment. How does this make sense? There’s a perfectly well supported system for doing this: HTTPS. Maybe Apple wants passes to be verifiable by the phone offline instead of just when updated? This still seems silly — a malicious actor could replace a pass instead of updating it.
- robryk 3y agoHaving the initial pass specify the public key that it accepts for updates would be sufficient. Having an association with an Apple developer account doesn't help for the updates problem at all AFAICT. The only reason I came up with for the blessed-by-Apple requirement I came up with is selling fake tickets. There is no way to tell (with or without that requirement) whether a pkpass file with a "ticket to concert X" is actually legit. So, one can try to combat the (potential?) problem by responding to complaints of fraud by revoking the corresponding developer's account. However, that doesn't seem like a solution either: developer account are probably way cheaper than how much you can gain on fraud before you get caught in that way.
- lxgr 3y agoYeah, I also found the justifications for Apple requiring passes to be signed pretty vague. Locking things down is just the default for Apple; it's usually only in later iterations that they open up integrations to the broader ecosystem. On the face of it, it's really weird to require passes to be signed: I can always just store a PNG or PDF showing the same bar code in my photo library or files app and present that. Imagine iOS only displaying signed PDFs!
- nash 3y agoSo.. I just added my card to Stocard and used it a King County. Took 2 minutes, on my phone, synced across devices. Or yeah, you could do it that way I guess.
- k8svet 3y agoOooh, now do Orca cards next. Seattle is one of the tech capitals of the United States, and on top of the metro system just being not great, it's also technically inferior to nearly every single other major city that I've used public transit. Pick any European city, CDMX, Denver. They're all light years ahead of Seattle. Denver might have been my favorite. Fun fact, one of the orgs that runs Orca actually wrote a blog post mentioning they were adding NFC support to their Android app (with some absurdly long timeline). That post is no longer to be found, and of course, years later, that functionality is absent.
- organsnyder 3y agoMy local transit system just added tap-to-pay that works with any credit card (or Apple/Google Pay etc.). As long as you use the same card it handles transfers, multi-day passes, etc. seamlessly as well—it will automatically ensure you're getting the correct rate (e.g. no charge for passes or rides after a certain number within a certain period).
- snazz 3y agoThis is how it works in London and I think New York as well now. Big upgrade over loading money on a card.
- fotta 3y agoClipper-accepting agencies in the SF Bay Area will have this next summer too.
- femiagbabiaka 3y agoWoah. Where can I read more?
- pests 3y agoYep this was how it was in New York City. I was there a few months ago and remember the subway being free or reduced after 10 trips per week - tracked by the credit card number used.
- js2 3y agoSo wait: you don't want to pay Apple $99 and you don't want to pay for one of the apps that generates a pass for you, but you'll extract the cert from one of those apps thereby piggybacking on another developer's $99 payment to Apple. That's uncool. On a slightly related note: a site I login to regularly uses Semantic VIP Access for 2FA. You can convert these to standard TOTP codes so that you can load them into the Apple Keychain or whatever other TOTP program you prefer: https://github.com/dlenski/python-vipaccess https://github.com/dlenski/python-vipaccess
- circuit10 3y agoI think if you are locked out from doing what you want on your phone that you bought through arbitrary software locks then you should have the right to bypass that. This isn’t costing the app developer anything, nor were they even using the app to generate the pass, so I don’t really see any issue here
- js2 3y agoIt's taking advantage of another developer's $99 payment. I just took a look at one of these apps and the in-app purchase to remove ads is $1.99. I think if I did this I'd throw that developer the 2 bucks. Sort of like when you bum a ride from someone, even though it's not costing them anything, it's good form to offer to split the cost of gasoline.
- circuit10 3y agoIt would be nice to do that but I don’t think this is some horribly immoral thing either
- saagarjha 3y agoLook I’ll generate and give you a certificate for free if you want one.
- js2 3y agoI'd pay Apple $99 before I asked another developer to do that for me, probably putting their agreement with Apple at risk. Taking a principled stance against Apple is fine. I'm totally onboard with that. I only think it's uncool to take that stance and then use another developer's cert without their permission. Even though it's unlikely, it can only harm that other developer. Based on all the downvotes HN seems to disagree, but I don't see what's so unreasonable about my position.
- tzs 3y ago> But having the barcode is far more convenient, and I’d like to have it without having to keep yet another plastic card I rarely use in my wallet. > So I put it on my phone, in my iPhone’s Wallet app Another option would be to literally put the barcode on the phone. Print it on a small piece of paper, about 15mm wide, and tape it to the back of the phone with some transparent tape.
- js2 3y agoOr take a picture of card and store it in a note. I do this for things like my insurance cards, driver license, etc.
- dkurth 3y agoI solved this problem by taking a photograph of my library card. To check out a book, I load the picture and hold it up to the scanner.
- wenc 3y agoThis is a brilliant and simple solution. If it's a static barcode, a photo is all that is needed. There's little advantage to having it in the wallet. I store all my IDs in a Photo Album on my phone.
- wandermatt 3y agoI added an image of my barcode to a location based reminder, so it pops up in a notification when I go to my local library.
- clintfred 3y agoThat's amazing. Truly. I'm assuming you're on iPhone. Anyone know if there is a way to do this in Android?
- gattilorenz 3y agoIf you use Google Keep for the note, it's easy to do
- mksybr 3y agohttps://tasks.org/docs/location/ https://tasks.org/docs/location/
- throwaway742 3y agoTasker
- tantalor 3y agohttps://support.google.com/keep/answer/3187168 https://support.google.com/keep/answer/3187168 > You can set reminders to go off at a certain time or place
- x0ul 3y agoThis is a great hack to get custom passes/codes into the wallet, and I'm glad the author wrote it up. I may end up doing this myself. That shell script to generate a bmp was wild.
- dividuum 3y agoPass4wallet is a nice app for that, if you’re ok with your pass data being (according to their privacy policy) sent to their server, signed and then deleted.
- jeffgreco 3y agoI did this just last week with my Chicago Public Library card and Pass4wallet and it’s great, even though CPL scanners still can’t scan screen codes.
- smithza 3y agoI came here looking for this. The write-up is interesting for a deep dive in Apple interfacing… obviously though is too involved for a simple library card. Thanks.
- willks 3y agoYep, Pass4wallet is great, and free to boot. I’ve used it for lots of loyalty cards and membership cards that don’t support Wallet, and even for some that do, so I can avoid installing apps for them.
- desro 3y agoThis is a really great write up, very clear and easy to follow. Was very impressed at your pure bash barcode generator. I'm eager to try this out on my own library card!
- inasio 3y agoI expected something more like squeezing the cards with NIF lasers (and alchemy) into diamond lattices encoding the information and then hacking it alongside phone storage
- gumby 3y agoWasn’t that already posted on HN a couple of weeks ago? :-)
- somat 3y agoOnly slightly related but my preferred way to generate barcodes is the barcode writer in pure postcsript. https://bwipp.terryburton.co.uk/ https://bwipp.terryburton.co.uk/
- mherdeg 3y agoGosh. I just emailed myself a .png of the barcode containing my library card number and open it in, like, the Photos or Gmail app when I'm at the kiosk.
- phyzome 3y agoThey did specify that this was the hard way. :-)
- mbirth 3y agoWallet passes allow you to define locations and timespans where the pass is "relevant". I've used the app MakePass to create a pass with my StarBucks membership code and when I'm nearing my usual shops, my phone will automatically suggest the StarBucks pass on the lock screen. Same with event tickets. I define a location and timespan and when I arrive at that location, my phone will suggest the pass automatically without me having to look for it. Also, after the event, it won't suggest it anymore and move the pass to the "Expired Passes" section to not clutter the main view. MakePass: https://pvieito.com https://pvieito.com
- fastball 3y agoDoesn't the Starbucks app literally do this for you? It did when I had it 7 years ago.
- electrondood 3y agoThis is indeed the hard way. I just used Stocard to scan my library card barcodes. Done.
- cglong 3y agoThis was a great blogpost, but then ends with: > I will note that I have not yet tested this pass in a real library yet I get this project was mostly for fun, but why not spend the 10 minutes it takes to test the final solution before sharing your work?
- skykooler 3y agoLibrary might not be open on a Saturday?
- cglong 3y agoThis isn't an unpublished zero-day, or even a new feature in iOS. I would've waited until Monday to publish if that was the issue.
- lxgr 3y agoThe point of the article is to show how it's possible to create an Apple pass from a custom barcode. Whether that barcode can then actually be read by a specific reader from a phone or not is arguably a different concern: Some readers support it; others don't. Obviously a passbook version of a paper barcode is useless for the latter. Personally, I found the post valuable regardless of whether the barcode would actually end up working at the author's library or not; I have a few scenarios myself where I know screen-presented codes are accepted.
- Lucasoato 3y agoThat’s a bigger problem than barcodes then.
- jldugger 3y agoThis post is from two months ago.
- MollyRealized 3y agoYes, that kind of ruined the entire article for me. "I have this great scientific theory about oxygen loss during running. I will admit, I have not actually started jogging yet, but ... "
- Ayesh 3y agoThose cheap laser "1D" bar code scanners cannot read off a screen (except maybe eInk). It sucks because the supermarkets I frequent have their loyalty cards based off barcodes. Fortunately, barcode readers emulate keyboards so you can just type the code on a keyboard.
- samtho 3y agoI made a cheap barcode display-er with a Bluetooth MCU and an E-ink display, that works for all 1D only barcode scanners.
- lxgr 3y agoThat's really neat! Real-life Doctor Who psychic paper, basically :)
- lxgr 3y agoAs far as I understand, that's because older systems don't use a digital image sensor to scan these, but rather a rotating laser beam and a simple photo diode registering the variations in brightness caused by varying reflections of the laser beam by the white and black parts of the barcode. A camera-based scanner doesn't care where the illumination of the barcode is coming from (i.e. ambient light, its own LED illuminating a piece of paper, or an active backlit screen); that laser-based system is purely based on its own reflected light, though, and won't work with actively backlit screens at all. (I wonder if it works with e-ink or passive LCD displays!)
- Crunchified 3y agoI am consistently impressed by how quickly and easily Costco's handheld scanners (seemingly straightforward red line 2D type) can read my membership barcode that is printed really narrow and tiny on my membership card. I guess hardware matters!
- karaterobot 3y ago> Our local libraries, The Seattle Public Library and the King County Library System, issue pieces of plastic with barcodes printed on the back assigned to your borrower account. I just memorized my account number for KCLS. It should take maybe 30 seconds to commit it to memory—though your mileage may vary, I have to believe it's faster than this. After that, you just type in the account number instead of scanning the bar code, and probably do it in less time than it takes to get your phone ready. I don't know if SPL works the same way, as I'm not in Seattle.
- wging 3y agoIf you don’t feel like memorizing it, you could also store it on your phone in your password manager of choice.
- folmar 3y agoDo it the 1990s way, just add it to the phone book.
- Scoundreller 3y agoUsed to do that for alarm codes for different locations I worked at and the last 4 numbers would be the code. Mr John Springfield - xxx-xxx-1234 Mr John Madison - xxx-xxx-5309 Etc etc
- rhplus 3y agoStocard app worked for me. Simple and has an Apple Watch app to boot. https://stocardapp.com/ https://stocardapp.com/
- samtho 3y agoI really love barcodes and barcode symbology for reasons I cannot fully explain. I even wore the npm module named ‘barcode’ which I desperately need to update. Fun fact about codabar, it is among the only barcode symbologies that can be implemented completely as a plain font.
- tonyedgecombe 3y ago2 of 5 can be as well (but not the interleaved version).
- lxgr 3y agoInteresting, why is that? Due to character boundaries and encoded-character-as-symbol boundaries not overlapping for the other codes? And do you know if that was a conscious design choice?
- samtho 3y agoI am unsure of the context in which codabar was developed, but I know it was originally made for dot matrix printers, maybe if you go back to how those worked, it lended itself well to monospaced fonts because we had a fixed number of “dots” per byte cell. It can be roughly thought of like a low-resolution LED screen display used at transit stations to display real-time etas. The purposefully low resolution can save on costs while being able to show legible text - but not much else. Codabar was can be implemented as a font because the standard does not define specific start and stops symbols, instead it was developed as just a raw 1-to-1 encoding of character to pattern. It does not have check digits because it uses more space per symbol to handle error correction by making it very difficult to misread each pattern. The spacing (kerning) between each symbol is a different width ratio than the white bars found in each symbol. Going back to dot matrix, it does appear that some early printers just had a grid of character “cells” in which the spacing between each cell was slightly more than a single “dot”, this probably explains the codabar quirk with 3 different space ratios (black bar, white bar, and inter-character quiet-space) and probably is the beginning of some further investigation into that topic.
- underseacables 3y agoMy library card and a lot of other barcoded cards that I use are stored in an app called Key Ring. It works really well.
- deleted 3y ago[deleted]
- ajot 3y agoFor anyone wanting to do something like this on an Android phone, there is Catima (on Google Play and FDroid), which supports many types of barcodes. https://catima.app/ https://catima.app/
- com2kid 3y agoThe overdrive app has supported digital library cards for years now. I agree having all the cards in one place is nice, but the fact is libraries put their cards in overdrive, so in effect all my library cards are in one place. Since overdrive is also how you access ebooks from the library, there is a good chance that any "technologically with it" people have it installed already. Now overdrive not being part of Amazon Kindle Fire for Kids tablets, separate issue I have.. Edit: I just checked, Google Wallet has built in support specifically for Seattle Public Library cards. Thanks, now I don't have to worry about forgetting my card ever again!
- smcin 3y agoApparently Overdrive app was phased out in favor of Libby app, mid-2022 [0][1]. IME Overdrive used to be very clunky and resource-heavy, borderline unuseable. On Mac. [0]: https://www.overdrive.com/apps https://www.overdrive.com/apps [1]: https://www.reddit.com/r/audiobooks/comments/u5oym0/overdrive_had_deleted_the_overdrive_app_from_the/ https://www.reddit.com/r/audiobooks/comments/u5oym0/overdriv...
- kinematikk 3y agoVery interesting, thank you!
- kodapoda 3y agoAh I was planning to look into this, glad to hear it's possible to self-generate a pass. My gym requires subscribers to use their app-generated QR code for entry. I have been using the same QR screenshot for the past 2 years to avoid pulling up the app every time. But even the screenshot takes more time to find in Photos than I would like to.
- tcauduro 3y agoThat's what the built-in shortcut app is for. Have it open the photo on run. Add it to your home screen or lock screen as needed.
- kodapoda 3y agoThat's a great idea! I only recently started using shortcuts and haven't yet developed the habit of solving simple tasks with them. Edit: works very well. Created a shortcut that opens a specific file from Files, and added it to the home screen with a custom icon.
- vxNsr 3y ago[dead]
- nolongerthere 3y agoPass2U solves this problem nicely, no need to do any coding at all. its free if you're only creating passes for yourself.
- dev_0 3y ago[dead]
- user3939382 3y agoThe part of my article that caught my attention was the non-trivial bash script. I do write these myself from time to time, but when you see them it's always like, gah! [Shield your eyes]
- oldbbsnickname 3y agoI believe there were or are arbitrary pass generator apps that can slap a logo and various data into a custom pass. Alternative solutions to barcodes are RFID/NFCs and geofenced authorization.
- jldugger 3y agoGoogle wallet supports barcodes. While technically you can only set up cards for libraries who have gone through the registration program, in practice they pretty much all work interchangably. Downside is you can't change the display name, so if you have more than one nearby library, it can be confusing.
- boguscoder 3y agoBut but but those Yodas on physical cards in King County at least https://imgur.com/a/A2oond2 https://imgur.com/a/A2oond2
- kazinator 3y agoWouldn't it be easier to just stick a copy of the barcode somewhere onto the phone's case? You can check out books even if the battery dies. If this end result must be attained: https://iliana.fyi/blog/ios-wallet-library-card/pass.png https://iliana.fyi/blog/ios-wallet-library-card/pass.png can be achieved by displaying simple PNG image. The point of applications that can store cards is that they enable use with wireless payment terminals. If I couldn't tap my phone to pay with credit cards, I wouldn't have a reason to put them into the phone.
- yonatan8070 3y ago> My library card uses… [stares at Wikipedia for half an hour] Codabar You can just scan it with a barcode scanner like Binary Eye [1] and it will tell you [1] https://github.com/markusfisch/BinaryEye https://github.com/markusfisch/BinaryEye
- tomsmeding 3y agoFor the Android users around who hate Google Wallet because it, like Apple's Passbook, doesn't allow you to just put in any old barcode, there is a delightful app on F-Droid (not on the Google Play Store, unfortunately) called Loyalty Card Keychain ( https://f-droid.org/en/packages/protect.card_locker/ https://f-droid.org/en/packages/protect.card_locker/ ). This app allows you to simply enter a number (or scan an existing barcode), choose a barcode type (with lots of options, including Codabar!), and save it. Selecting the entry on the app's main screen shows the generated barcode and does the screen-brightening thing. Also the app opens super fast because presumably it doesn't do anything but, you know, displaying barcodes. It has only one purpose but it may well be my most favourite app. I've even used it to transfer a barcode from some label in the supermarket to the self-checkout post, where for some reason the supermarket assumed that you use the hand-held self-scanning devices that I also don't like. EDIT: it seems they want you to use Catima instead these days. Trying it briefly it's similarly simple, and seems to be based on the same codebase.
- move-on-by 3y agoFor Apple, I use Pass4Wallet to generate the ‘cards’- which I can then import into Apple Wallet. It’s inconvenient, but gets the job done and has a great privacy policy.
- Liskni_si 3y agoThere's an app that lets you add whatever barcodes you want into Google Wallet: https://play.google.com/store/apps/details?id=color.dev.com.tangerine https://play.google.com/store/apps/details?id=color.dev.com....
- 0x38B 3y agoI use a shortcut and Siri for things like this: 1. Save the image to Photos, favorite it, and get the name (e.g IMG_2678). 2. Make a shortcut with two actions: - find All Photos where name is IMG_2678 and is favorite. - Quick look I most often use “Siri, share my contact”, which shows a QR code for my contact with my cell and email address. It’s proven handy when I was busy (making drinks) but wanted to give someone my contact. Qrafter is what I use to make QR codes on iOS.
- llacb47 3y agoI solved this by memorizing my library card number.
- jedrek 3y agoMy trick for doing this for a summer pool pass in Berlin was to take a photo of the QR code on the ticket and just show that to the scanners.