Skip to content

Instantly share code, notes, and snippets.

@mattghali
Last active March 24, 2016 11:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattghali/4b2e1327c9fbeb615cf3 to your computer and use it in GitHub Desktop.
Save mattghali/4b2e1327c9fbeb615cf3 to your computer and use it in GitHub Desktop.
Dump iOS Passbook entries
# dumps all configured ios passbook entries into /tmp/passbook.
# happy dumping! matt ghali - @bizzyunderscore
def f(arg, dirname, files):
passfile = os.path.join(dirname, 'pass.json')
if os.path.exists(passfile):
with open(passfile, 'r') as pf:
j = json.load(pf)
passname = j['passTypeIdentifier']
outfile = os.path.join('/tmp/passbook', passname)
with open(outfile, 'w') as of:
for line in json.dumps(j, indent=2):
of.write(line)
import json, os
os.mkdir('/tmp/passbook')
os.path.walk(os.path.join(os.environ['HOME'], 'Library/Mobile Documents/com~apple~shoebox/UbiquitousCards'), f, None)
@mattghali
Copy link
Author

Usage:
Paste into python interpeter (it used to be closer to a one-liner..)
All your configured passbook entries get dumped as pretty json files under /tmp/passbook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment