-
-
Save jhbush/a86a31b0eb122e0d7cdc0848ef537a3a to your computer and use it in GitHub Desktop.
Show and set the CatalogURL on macOS 10.10 and greater
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 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