Created
October 10, 2016 14:02
-
-
Save badstreff/9da44ac3a30837149508f3146fdf5f16 to your computer and use it in GitHub Desktop.
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
#!/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