Advertisement
TCB13

ldid3.py

May 28th, 2012
1,067
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. from sys import argv
  4. from subprocess import check_call
  5. from os.path import basename, splitext, join
  6. from tempfile import NamedTemporaryFile
  7.  
  8. app = argv[-1]
  9. obj_path = join(app, splitext(basename(app))[0])
  10.  
  11. if '-gta' not in argv:
  12.     check_call(['/usr/bin/ldid', '-S', obj_path])
  13. else:
  14.     with NamedTemporaryFile() as f:
  15.         f.write("""
  16. <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  17. <plist version="1.0">
  18.  <dict>
  19.    <key>get-task-allow</key>
  20.    <true/>
  21.  </dict>
  22. </plist>
  23.        """)
  24.     f.flush()
  25.         check_call(['/usr/bin/ldid', '-S' + f.name, obj_path])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement