From a24ad1a62ad1e56c0b014ddc2af608c70a83df81 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Wed, 26 Nov 2014 13:05:48 -0800 Subject: [PATCH] We need access to IsWild_ outside of SpringBoard. --- Library.mm | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) 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) -- 2.47.2