From: Jay Freeman (saurik) Date: Fri, 21 Oct 2011 03:32:48 +0000 (+0000) Subject: Turn off quirks mode to fix WB crash. X-Git-Tag: v0.9.3902~5 X-Git-Url: https://git.saurik.com/winterboard.git/commitdiff_plain/f9511b593520ade931a963ce683452f35a28ce33?ds=inline Turn off quirks mode to fix WB crash. --- diff --git a/Application.mm b/Application.mm index 4bfef61..f033c3f 100644 --- a/Application.mm +++ b/Application.mm @@ -46,6 +46,9 @@ #import #import +#include +#include + static NSBundle *wbSettingsBundle; static Class $WBSettingsController; @@ -181,9 +184,17 @@ static Class $WBSettingsController; @end +MSHook(int32_t, NSVersionOfLinkTimeLibrary, const char *name) { + if (strcmp(name, "UIKit") == 0) + return 0x6400000; + return _NSVersionOfLinkTimeLibrary(name); +} + int main(int argc, char *argv[]) { NSAutoreleasePool *pool( [[NSAutoreleasePool alloc] init]); + MSHookFunction(NSVersionOfLinkTimeLibrary, MSHake(NSVersionOfLinkTimeLibrary)); + int value = UIApplicationMain(argc, argv, @"WBApplication", @"WBApplication"); [pool release]; diff --git a/makefile b/makefile index 429d952..6094676 100644 --- a/makefile +++ b/makefile @@ -20,7 +20,7 @@ WinterBoard.dylib: Library.mm WBMarkup.mm WBMarkup.h makefile ../mobilesubstrate ldid -S $@ WinterBoard: Application.mm makefile - $(target)g++ -g0 -O2 -Wall -Werror -o $@ $(filter %.mm,$^) -framework UIKit -framework Foundation -framework CoreFoundation -lobjc -framework CoreGraphics -I/apl/sdk -framework Preferences -F$(PKG_ROOT)/System/Library/PrivateFrameworks + $(target)g++ -g0 -O2 -Wall -Werror -o $@ $(filter %.mm,$^) -framework UIKit -framework Foundation -framework CoreFoundation -lobjc -framework CoreGraphics -I/apl/sdk -framework Preferences -F$(PKG_ROOT)/System/Library/PrivateFrameworks $(substrate) ldid -S $@ Optimize: Optimize.cpp makefile