Skip to content

Instantly share code, notes, and snippets.

@jhbush
Forked from Piker-Alpha/catalogUtilities.py
Created April 17, 2018 20:48
Show Gist options
  • Save jhbush/a86a31b0eb122e0d7cdc0848ef537a3a to your computer and use it in GitHub Desktop.
Save jhbush/a86a31b0eb122e0d7cdc0848ef537a3a to your computer and use it in GitHub Desktop.
Show and set the CatalogURL on macOS 10.10 and greater
#!/usr/bin/python
import objc
from Foundation import NSBundle, NSClassFromString
SeedingBundle = NSBundle.bundleWithPath_('/System/Library/PrivateFrameworks/Seeding.framework')
functions = [
('currentCatalog', '@'),
('_setCatalog', b'@*'),
]
objc.loadBundleFunctions(SeedingBundle, globals(), functions)
catalogUtilities = NSClassFromString('SDCatalogUtilities')
# show CatalogURL
print "CatalogURL: %s" % catalogUtilities._currentCatalog()
# change CatalogURL
catalogUtilities._setCatalog_("https://swscan.apple.com/content/catalogs/others/index-10.13seed-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz")
# show changed CatalogURL
print "CatalogURL: %s" % catalogUtilities._currentCatalog()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment