4 #include <UIKit/UIKit.h>
5 #include <CydiaSubstrate/CydiaSubstrate.h>
6 #include "CyteKit/PerlCompatibleRegEx.hpp"
8 _H<NSMutableDictionary> Sources_;
9 _H<NSString> CydiaSource_;
12 _H<NSString> Firmware_;
14 int main(int argc, const char *argv[]) {
15 if (argc < 2 || strcmp(argv[1], "configure") != 0)
18 NSAutoreleasePool *pool([[NSAutoreleasePool alloc] init]);
20 Pcre pattern("^([0-9]+\\.[0-9]+)");
22 if (pattern([[UIDevice currentDevice] systemVersion]))
23 Firmware_ = pattern[1];
25 NSDictionary *metadata([[[NSMutableDictionary alloc] initWithContentsOfFile:@"/var/lib/cydia/metadata.plist"] autorelease]);
26 NSUInteger version(0);
28 if (metadata != nil) {
29 Sources_ = [metadata objectForKey:@"Sources"];
30 CydiaSource_ = [metadata objectForKey:@"CydiaSource"];
32 if (NSNumber *number = [metadata objectForKey:@"Version"])
33 version = [number unsignedIntValue];
36 if (CydiaSource_ == nil)
37 CydiaSource_ = @"apt.saurik.com";
40 Sources_ = [NSMutableDictionary dictionaryWithCapacity:8];
43 CydiaAddSource(@"http://apt.thebigboss.org/repofiles/cydia/", @"stable", [NSMutableArray arrayWithObject:@"main"]);
44 CydiaAddSource(@"http://apt.modmyi.com/", @"stable", [NSMutableArray arrayWithObject:@"main"]);
45 CydiaAddSource(@"http://cydia.zodttd.com/repo/cydia/", @"stable", [NSMutableArray arrayWithObject:@"main"]);
46 CydiaAddSource(@"http://repo666.ultrasn0w.com/", @"./");