- (bool) popErrorWithTitle:(NSString *)title forReadList:(pkgSourceList &)list {
if ([self popErrorWithTitle:title forOperation:list.ReadMainList()])
return true;
+ if ([self popErrorWithTitle:title forOperation:list.Read(SOURCES_LIST)])
+ return true;
return false;
}
}
}
- _root(CydiaWriteSources());
+ CydiaWriteSources();
}
// Navigation controller for the queuing badge.
} broken = nil;
/* }}} */
- _root(CydiaWriteSources());
+ CydiaWriteSources();
_trace();
mkdir("/var/mobile/Library/Cydia", 0755);
#include <cstdio>
+#include "Sources.h"
+
extern _H<NSMutableDictionary> Sources_;
extern bool Changed_;
void CydiaWriteSources() {
- FILE *file(fopen("/etc/apt/sources.list.d/cydia.list", "w"));
+ FILE *file(fopen(SOURCES_LIST, "w"));
_assert(file != NULL);
fprintf(file, "deb http://apt.saurik.com/ ios/%.2f main\n", kCFCoreFoundationVersionNumber);
$(cycc) -std=c++11 $(filter %.cpp,$^) $(flags) $(link) -Wno-deprecated-writable-strings
@ldid -T0 -S $@
-postinst: postinst.mm Sources.mm Sources.h CyteKit/stringWithUTF8Bytes.mm CyteKit/stringWithUTF8Bytes.h CyteKit/UCPlatform.h
+postinst: postinst.mm CyteKit/stringWithUTF8Bytes.mm CyteKit/stringWithUTF8Bytes.h CyteKit/UCPlatform.h
$(cycc) -std=c++11 $(filter %.mm,$^) $(flags) $(link) -framework CoreFoundation -framework Foundation -framework UIKit
@ldid -T0 -S $@
}
}
-_H<NSMutableDictionary> Sources_;
-bool Changed_;
-
-_H<NSString> System_;
-
int main(int argc, const char *argv[]) {
if (argc < 2 || strcmp(argv[1], "configure") != 0)
return 0;
}
}
- size_t size;
- sysctlbyname("kern.osversion", NULL, &size, NULL, 0);
- char *osversion = new char[size];
- if (sysctlbyname("kern.osversion", osversion, &size, NULL, 0) != -1)
- System_ = [NSString stringWithUTF8String:osversion];
-
- NSDictionary *metadata([[[NSMutableDictionary alloc] initWithContentsOfFile:@"/var/lib/cydia/metadata.plist"] autorelease]);
- NSUInteger version(0);
-
- if (metadata != nil) {
- Sources_ = [metadata objectForKey:@"Sources"];
-
- if (NSNumber *number = [metadata objectForKey:@"Version"])
- version = [number unsignedIntValue];
- }
-
- if (Sources_ == nil)
- Sources_ = [NSMutableDictionary dictionaryWithCapacity:8];
-
- if (version == 0) {
- CydiaAddSource(@"http://apt.thebigboss.org/repofiles/cydia/", @"stable", [NSMutableArray arrayWithObject:@"main"]);
- CydiaAddSource(@"http://apt.modmyi.com/", @"stable", [NSMutableArray arrayWithObject:@"main"]);
- CydiaAddSource(@"http://cydia.zodttd.com/repo/cydia/", @"stable", [NSMutableArray arrayWithObject:@"main"]);
- CydiaAddSource(@"http://repo666.ultrasn0w.com/", @"./");
- }
-
- CydiaWriteSources();
+ unlink("/etc/apt/sources.list.d/cydia.list");
#define OldCache_ "/var/root/Library/Caches/com.saurik.Cydia"
if (access(OldCache_, F_OK) == 0)