diff -r e8a00b720e2d -r 3cbd5a39aaee project_files/HedgewarsMobile/gen_entitlements.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/project_files/HedgewarsMobile/gen_entitlements.py Fri Mar 12 20:36:12 2010 +0000 @@ -0,0 +1,35 @@ +#!/usr/bin/env python + +import sys +import struct + +if len(sys.argv) != 3: + print "Usage: %s appname dest_file.xcent" % sys.argv[0] + sys.exit(-1) + +APPNAME = sys.argv[1] +DEST = sys.argv[2] + +if not DEST.endswith('.xml') and not DEST.endswith('.xcent'): + print "Dest must be .xml (for ldid) or .xcent (for codesign)" + sys.exit(-1) + +entitlements = """ + + + + + application-identifier + %s + get-task-allow + + + +""" % APPNAME + +f = open(DEST,'w') +if DEST.endswith('.xcent'): + f.write("\xfa\xde\x71\x71") + f.write(struct.pack('>L', len(entitlements) + 8)) +f.write(entitlements) +f.close()