Skip to content

Instantly share code, notes, and snippets.

@badstreff
Created October 10, 2016 14:02
Show Gist options
  • Save badstreff/9da44ac3a30837149508f3146fdf5f16 to your computer and use it in GitHub Desktop.
Save badstreff/9da44ac3a30837149508f3146fdf5f16 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
import objc
from Cocoa import NSObject, NSURL, NSBundle
# disturbing hack warning!
# this works around an issue with App Transport Security on 10.11
bundle = NSBundle.mainBundle()
info = bundle.localizedInfoDictionary() or bundle.infoDictionary()
info['NSAppTransportSecurity'] = {'NSAllowsArbitraryLoads': True}
# load private framework
framework="/System/Library/PrivateFrameworks/SoftwareUpdate.framework"
objc.loadBundle("SoftwareUpdate", globals(), framework)
# Instantaite a SUCatalogFetch object and pull the catalogURL
catalog_fetch = SUCatalogFetch.alloc().init()
print(catalog_fetch.finalURL())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment