Created
January 14, 2011 23:34
-
-
Save wooster/780503 to your computer and use it in GitHub Desktop.
plist from .mobileprovision file
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
import plistlib | |
from StringIO import StringIO | |
def plist_from_mobileprovision(provision_path): | |
f = open(provision_path) | |
f.seek(62) | |
string = "" | |
lookfor = "</plist>" | |
found = False | |
while True: | |
bytes = f.read(1024) | |
pos = bytes.find(lookfor) | |
if pos == -1: | |
string += bytes | |
continue | |
string += bytes[0:pos+len(lookfor)] | |
found = True | |
break | |
f.close() | |
if not found: | |
return None | |
s = StringIO(string) | |
result = plistlib.readPlist(s) | |
if not result: | |
return None | |
return result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment