]> git.saurik.com Git - winterboard.git/commitdiff
Turn off quirks mode to fix WB crash.
authorJay Freeman (saurik) <saurik@saurik.com>
Fri, 21 Oct 2011 03:32:48 +0000 (03:32 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Fri, 21 Oct 2011 03:32:48 +0000 (03:32 +0000)
Application.mm
makefile

index 4bfef618c3040e1a73756a2d019de5edc64a6006..f033c3f5395344c144ed07e971f7c0b6d1f16835 100644 (file)
@@ -46,6 +46,9 @@
 #import <Preferences/PSListController.h>
 #import <Preferences/PSSpecifier.h>
 
 #import <Preferences/PSListController.h>
 #import <Preferences/PSSpecifier.h>
 
+#include <substrate.h>
+#include <mach-o/dyld.h>
+
 static NSBundle *wbSettingsBundle;
 static Class $WBSettingsController;
 
 static NSBundle *wbSettingsBundle;
 static Class $WBSettingsController;
 
@@ -181,9 +184,17 @@ static Class $WBSettingsController;
 
 @end
 
 
 @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]);
 
 int main(int argc, char *argv[]) {
     NSAutoreleasePool *pool( [[NSAutoreleasePool alloc] init]);
 
+    MSHookFunction(NSVersionOfLinkTimeLibrary, MSHake(NSVersionOfLinkTimeLibrary));
+
     int value = UIApplicationMain(argc, argv, @"WBApplication", @"WBApplication");
 
     [pool release];
     int value = UIApplicationMain(argc, argv, @"WBApplication", @"WBApplication");
 
     [pool release];
index 429d9528d20b5f7140fca8e5c094c0e214a63e5b..60946769e9716f4b011557d5222f9748d0fd6119 100644 (file)
--- a/makefile
+++ b/makefile
@@ -20,7 +20,7 @@ WinterBoard.dylib: Library.mm WBMarkup.mm WBMarkup.h makefile ../mobilesubstrate
        ldid -S $@
 
 WinterBoard: Application.mm makefile
        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
        ldid -S $@
 
 Optimize: Optimize.cpp makefile