5 #include <sys/sysctl.h>
7 #include <CydiaSubstrate/CydiaSubstrate.h>
8 #include "CyteKit/PerlCompatibleRegEx.hpp"
10 _H<NSMutableDictionary> Sources_;
15 int main(int argc, const char *argv[]) {
16 if (argc < 2 || strcmp(argv[1], "configure") != 0)
19 NSAutoreleasePool *pool([[NSAutoreleasePool alloc] init]);
22 sysctlbyname("kern.osversion", NULL, &size, NULL, 0);
23 char *osversion = new char[size];
24 if (sysctlbyname("kern.osversion", osversion, &size, NULL, 0) != -1)
25 System_ = [NSString stringWithUTF8String:osversion];
27 NSDictionary *metadata([[[NSMutableDictionary alloc] initWithContentsOfFile:@"/var/lib/cydia/metadata.plist"] autorelease]);
28 NSUInteger version(0);
30 if (metadata != nil) {
31 Sources_ = [metadata objectForKey:@"Sources"];
33 if (NSNumber *number = [metadata objectForKey:@"Version"])
34 version = [number unsignedIntValue];
38 Sources_ = [NSMutableDictionary dictionaryWithCapacity:8];
41 CydiaAddSource(@"http://apt.thebigboss.org/repofiles/cydia/", @"stable", [NSMutableArray arrayWithObject:@"main"]);
42 CydiaAddSource(@"http://apt.modmyi.com/", @"stable", [NSMutableArray arrayWithObject:@"main"]);
43 CydiaAddSource(@"http://cydia.zodttd.com/repo/cydia/", @"stable", [NSMutableArray arrayWithObject:@"main"]);
44 CydiaAddSource(@"http://repo666.ultrasn0w.com/", @"./");