From 38efdc42fa081d994ccb3dfdb0f506895c1e00d1 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Thu, 4 Dec 2014 00:54:35 -0800 Subject: [PATCH] Move double-theme protection into bundleWithFile:. --- Library.mm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Library.mm b/Library.mm index 3372ddd..016eaca 100644 --- a/Library.mm +++ b/Library.mm @@ -492,7 +492,7 @@ static NSString *$pathForIcon$(SBApplication *self, NSString *suffix = @"") { @implementation NSBundle (WinterBoard) -+ (NSBundle *) wb$bundleWithFile:(NSString *)path { ++ (NSBundle *) _wb$bundleWithFile:(NSString *)path { path = [path stringByDeletingLastPathComponent]; if (path == nil || [path length] == 0 || [path isEqualToString:@"/"]) return nil; @@ -508,7 +508,7 @@ static NSString *$pathForIcon$(SBApplication *self, NSString *suffix = @"") { if ([Manager_ fileExistsAtPath:[path stringByAppendingPathComponent:@"Info.plist"]]) bundle = [NSBundle bundleWithPath:path]; if (bundle == nil) - bundle = [NSBundle wb$bundleWithFile:path]; + bundle = [NSBundle _wb$bundleWithFile:path]; if (Debug_) NSLog(@"WB:Debug:PathBundle(%@, %@)", path, bundle); @@ -520,6 +520,12 @@ static NSString *$pathForIcon$(SBApplication *self, NSString *suffix = @"") { return bundle; } ++ (NSBundle *) wb$bundleWithFile:(NSString *)path { + if ([path hasPrefix:@"/Library/Themes"]) + return nil; + return [self _wb$bundleWithFile:path]; +} + @end // }}} // -[NSString wb$themedPath] {{{ @@ -530,9 +536,6 @@ static NSString *$pathForIcon$(SBApplication *self, NSString *suffix = @"") { @implementation NSString (WinterBoard) - (NSString *) wb$themedPath { - if ([self hasPrefix:@"/Library/Themes/"]) - return self; - if (Debug_) NSLog(@"WB:Debug:Bypass(\"%@\")", self); -- 2.45.2