Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Piker-Alpha
Created October 17, 2017 14:14
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save Piker-Alpha/446522eb74e89005b1f2463e61492bbf to your computer and use it in GitHub Desktop.
Save Piker-Alpha/446522eb74e89005b1f2463e61492bbf 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