From: Jay Freeman (saurik) Date: Wed, 26 Nov 2014 21:05:48 +0000 (-0800) Subject: We need access to IsWild_ outside of SpringBoard. X-Git-Tag: v0.9.3917~6 X-Git-Url: https://git.saurik.com/winterboard.git/commitdiff_plain/a24ad1a62ad1e56c0b014ddc2af608c70a83df81 We need access to IsWild_ outside of SpringBoard. --- diff --git a/Library.mm b/Library.mm index bc8084b..e994934 100644 --- a/Library.mm +++ b/Library.mm @@ -1273,20 +1273,6 @@ MSInstanceMessageHook0(id, SBUIController, init) { if (paper != nil) paper = [paper stringByDeletingLastPathComponent]; - { - size_t size; - sysctlbyname("hw.machine", NULL, &size, NULL, 0); - char *machine = new char[size]; - - if (sysctlbyname("hw.machine", machine, &size, NULL, 0) == -1) { - perror("sysctlbyname(\"hw.machine\", ?)"); - delete [] machine; - machine = NULL; - } - - IsWild_ = machine != NULL && strncmp(machine, "iPad", 4) == 0; - } - if (Debug_) NSLog(@"WB:Debug:Info = %@", [Info_ description]); @@ -2461,6 +2447,19 @@ MSInitialize { dlset(_GSFontGetUseLegacyFontMetrics, "GSFontGetUseLegacyFontMetrics"); + // Initialize IsWild_ {{{ + size_t size; + sysctlbyname("hw.machine", NULL, &size, NULL, 0); + char *machine = new char[size]; + + if (sysctlbyname("hw.machine", machine, &size, NULL, 0) == -1) { + perror("sysctlbyname(\"hw.machine\", ?)"); + delete [] machine; + machine = NULL; + } + + IsWild_ = machine != NULL && strncmp(machine, "iPad", 4) == 0; + // }}} // Load Settings.plist {{{ if (NSDictionary *settings = [NSDictionary dictionaryWithContentsOfFile:[NSString stringWithFormat:@"/User/Library/Preferences/com.saurik.WinterBoard.plist"]]) { if (kCFCoreFoundationVersionNumber >= 1000)