static _H<UIFont> Font22Bold_;
static const char *Machine_ = NULL;
-static NSString *System_ = nil;
+_H<NSString> System_;
static NSString *SerialNumber_ = nil;
static NSString *ChipID_ = nil;
static NSString *BBSNum_ = nil;
bool IsWildcat_;
static CGFloat ScreenScale_;
static NSString *Idiom_;
-_H<NSString> Firmware_;
+static _H<NSString> Firmware_;
static NSString *Major_;
static _H<NSMutableDictionary> SessionData_;
if (Safari_ != nil)
application = [NSString stringWithFormat:@"Safari/%@ %@", Safari_, application];
if (System_ != nil)
- application = [NSString stringWithFormat:@"Mobile/%@ %@", System_, application];
+ application = [NSString stringWithFormat:@"Mobile/%@ %@", (id) System_, application];
if (Product_ != nil)
application = [NSString stringWithFormat:@"Version/%@ %@", Product_, application];
extern _H<NSMutableDictionary> Sources_;
extern _H<NSString> CydiaSource_;
-extern _H<NSString> Firmware_;
+extern _H<NSString> System_;
extern bool Changed_;
void CydiaWriteSources() {
_assert(file != NULL);
NSString *distribution(@"ios");
- if (Firmware_ != nil)
- distribution = [distribution stringByAppendingString:[NSString stringWithFormat:@"/%@", (id) Firmware_]];
+ if (System_ != nil)
+ distribution = [distribution stringByAppendingString:[NSString stringWithFormat:@"/%@", (id) System_]];
fprintf(file, "deb http://%s/ %s main\n",
[CydiaSource_ UTF8String],
#include <strings.h>
#include <Sources.h>
-#include <UIKit/UIKit.h>
+#include <sys/types.h>
+#include <sys/sysctl.h>
+
#include <CydiaSubstrate/CydiaSubstrate.h>
#include "CyteKit/PerlCompatibleRegEx.hpp"
_H<NSString> CydiaSource_;
bool Changed_;
-_H<NSString> Firmware_;
+_H<NSString> System_;
int main(int argc, const char *argv[]) {
if (argc < 2 || strcmp(argv[1], "configure") != 0)
NSAutoreleasePool *pool([[NSAutoreleasePool alloc] init]);
- Pcre pattern("^([0-9]+\\.[0-9]+)");
-
- if (pattern([[UIDevice currentDevice] systemVersion]))
- Firmware_ = pattern[1];
+ 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);