]> git.saurik.com Git - winterboard.git/blobdiff - Library.mm
Fix critical/stupid iOS 5 regression in WBMarkup.
[winterboard.git] / Library.mm
index 36cca9e1e6e3b51617378bcf099983d1ec595745..f6cc67840999f2b6880594e5d5a2c60443226f47 100644 (file)
@@ -678,6 +678,8 @@ MSHook(UIImage *, _UIApplicationImageWithName, NSString *name) {
 // %hook -[NSBundle pathForResource:ofType:] {{{
 MSInstanceMessageHook2(NSString *, NSBundle, pathForResource,ofType, NSString *, resource, NSString *, type) {
     NSString *file = type == nil ? resource : [NSString stringWithFormat:@"%@.%@", resource, type];
+    if ([file isEqualToString:@"Info.plist"])
+        return MSOldCall(resource, type);
     if (Debug_)
         NSLog(@"WB:Debug: [NSBundle(%@) pathForResource:\"%@\"]", [self bundleIdentifier], file);
     if (NSString *path = $pathForFile$inBundle$(file, self, false, false))
@@ -860,7 +862,7 @@ MSInstanceMessageHook7(CGSize, NSString, _drawInRect,withFont,lineBreakMode,alig
 }
 
 MSInstanceMessage2(void, NSString, drawInRect,withAttributes, CGRect, rect, NSDictionary *, attributes) {
-    NSLog(@"XXX: *\"%@\" %@", self, attributes);
+    //NSLog(@"XXX: *\"%@\" %@", self, attributes);
 
     WBStringDrawingState *state(stringDrawingState_);
     if (state == NULL)
@@ -886,7 +888,7 @@ MSInstanceMessage2(void, NSString, drawInRect,withAttributes, CGRect, rect, NSDi
 extern "C" NSString *NSStringFromCGSize(CGSize size);
 
 MSInstanceMessage4(CGRect, NSString, boundingRectWithSize,options,attributes,context, CGSize, size, NSInteger, options, NSDictionary *, attributes, id, context) {
-    NSLog(@"XXX: $\"%@\" %@ 0x%x %@ %@", self, NSStringFromCGSize(size), unsigned(options), attributes, context);
+    //NSLog(@"XXX: $\"%@\" %@ 0x%x %@ %@", self, NSStringFromCGSize(size), unsigned(options), attributes, context);
 
     WBStringDrawingState *state(stringDrawingState_);
     if (state == NULL)
@@ -2277,8 +2279,10 @@ static void SBInitialize() {
     if (SummerBoard_)
         English_ = [[NSDictionary alloc] initWithContentsOfFile:@"/System/Library/CoreServices/SpringBoard.app/English.lproj/LocalizedApplicationNames.strings"];
 
-    WBRename(NSString, drawInRect:withAttributes:, drawInRect$withAttributes$);
-    WBRename(NSString, boundingRectWithSize:options:attributes:context:, boundingRectWithSize$options$attributes$context$);
+    if (kCFCoreFoundationVersionNumber >= 800) {
+        WBRename(NSString, drawInRect:withAttributes:, drawInRect$withAttributes$);
+        WBRename(NSString, boundingRectWithSize:options:attributes:context:, boundingRectWithSize$options$attributes$context$);
+    }
 }
 
 /*MSHook(int, open, const char *path, int oflag, mode_t mode) {