Last active
March 24, 2016 11:24
-
-
Save mattghali/4b2e1327c9fbeb615cf3 to your computer and use it in GitHub Desktop.
Dump iOS Passbook entries
This file contains 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
# 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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.