Skip to content

Instantly share code, notes, and snippets.

@wooster
Created January 14, 2011 23:34
Show Gist options
  • Save wooster/780503 to your computer and use it in GitHub Desktop.
Save wooster/780503 to your computer and use it in GitHub Desktop.
plist from .mobileprovision file
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