From: Jay Freeman (saurik) Date: Wed, 12 Oct 2011 20:36:05 +0000 (+0000) Subject: Just stop using isWildcat: too risky. X-Git-Tag: v0.9.3901~31 X-Git-Url: https://git.saurik.com/winterboard.git/commitdiff_plain/609e1cd8f3f2e64f6e1d3375d59fe9b4d0158546 Just stop using isWildcat: too risky. --- diff --git a/Library.mm b/Library.mm index 65a7994..7a5bc3f 100644 --- a/Library.mm +++ b/Library.mm @@ -101,6 +101,8 @@ bool _itv; #import +#include + extern "C" void __clear_cache (char *beg, char *end); @protocol WinterBoard @@ -773,8 +775,19 @@ MSHook(id, SBUIController$init, SBUIController *self, SEL sel) { if (self == nil) return nil; - UIDevice *device([UIDevice currentDevice]); - IsWild_ = [device respondsToSelector:@selector(isWildcat)] && [device isWildcat]; + { + 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; + } BOOL (*GSSystemHasCapability)(CFStringRef) = reinterpret_cast(dlsym(RTLD_DEFAULT, "GSSystemHasCapability")); diff --git a/control b/control index e6fed4c..c698e0a 100644 --- a/control +++ b/control @@ -3,7 +3,7 @@ Priority: optional Section: System Maintainer: Jay Freeman (saurik) Architecture: iphoneos-arm -Version: 0.9.3900-1 +Version: 0.9.3901-1 Description: more powerful, open-source SummerBoard Name: WinterBoard Depends: mobilesubstrate (>= 0.9.3225-1), killall, preferenceloader, libhide (>= 2.0.4), findutils, net.howett.pincrush (>= 0.0.1-23) | pincrush