1 /* WinterBoard - Theme Manager for the iPhone
2 * Copyright (C) 2008 Jay Freeman (saurik)
6 * Redistribution and use in source and binary
7 * forms, with or without modification, are permitted
8 * provided that the following conditions are met:
10 * 1. Redistributions of source code must retain the
11 * above copyright notice, this list of conditions
12 * and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the
14 * above copyright notice, this list of conditions
15 * and the following disclaimer in the documentation
16 * and/or other materials provided with the
18 * 3. The name of the author may not be used to endorse
19 * or promote products derived from this software
20 * without specific prior written permission.
22 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS''
23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
24 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
28 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
29 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
32 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
33 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
34 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
35 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 #define _trace() NSLog(@"WB:_trace(%u)", __LINE__);
41 #import <CoreFoundation/CoreFoundation.h>
42 #import <Foundation/Foundation.h>
43 #import <CoreGraphics/CoreGraphics.h>
45 #include <substrate.h>
47 #import <UIKit/UIKit.h>
49 #import <SpringBoard/SBApplication.h>
50 #import <SpringBoard/SBApplicationIcon.h>
51 #import <SpringBoard/SBAppWindow.h>
52 #import <SpringBoard/SBBookmarkIcon.h>
53 #import <SpringBoard/SBButtonBar.h>
54 #import <SpringBoard/SBCalendarIconContentsView.h>
55 #import <SpringBoard/SBContentLayer.h>
56 #import <SpringBoard/SBIconController.h>
57 #import <SpringBoard/SBIconLabel.h>
58 #import <SpringBoard/SBSlidingAlertDisplay.h>
59 #import <SpringBoard/SBStatusBarContentsView.h>
60 #import <SpringBoard/SBStatusBarController.h>
61 #import <SpringBoard/SBStatusBarOperatorNameView.h>
62 #import <SpringBoard/SBStatusBarTimeView.h>
63 #import <SpringBoard/SBUIController.h>
65 #import <MobileSMS/mSMSMessageTranscriptController.h>
67 #import <MediaPlayer/MPVideoView.h>
68 #import <MediaPlayer/MPVideoView-PlaybackControl.h>
70 #import <CoreGraphics/CGGeometry.h>
72 extern "C" void __clear_cache (char *beg, char *end);
79 Class $WebCoreFrameBridge;
84 Class $UINavigationBar;
88 Class $SBApplicationIcon;
89 Class $SBBookmarkIcon;
91 Class $SBCalendarIconContentsView;
92 Class $SBContentLayer;
94 Class $SBIconController;
97 Class $SBSlidingAlertDisplay;
98 Class $SBStatusBarContentsView;
99 Class $SBStatusBarController;
100 Class $SBStatusBarOperatorNameView;
101 Class $SBStatusBarTimeView;
103 @interface NSDictionary (WinterBoard)
104 - (UIColor *) colorForKey:(NSString *)key;
105 - (BOOL) boolForKey:(NSString *)key;
108 @implementation NSDictionary (WinterBoard)
110 - (UIColor *) colorForKey:(NSString *)key {
111 NSString *value = [self objectForKey:key];
118 - (BOOL) boolForKey:(NSString *)key {
119 if (NSString *value = [self objectForKey:key])
120 return [value boolValue];
127 bool Engineer_ = false;
129 static UIImage *(*_UIApplicationImageWithName)(NSString *name);
130 static UIImage *(*_UIImageAtPath)(NSString *name, NSBundle *path);
131 static CGImageRef (*_UIImageRefAtPath)(NSString *name, bool cache, UIImageOrientation *orientation);
132 static UIImage *(*_UIImageWithNameInDomain)(NSString *name, NSString *domain);
133 static NSBundle *(*_UIKitBundle)();
134 static void (*_UISharedImageInitialize)(bool);
135 static int (*_UISharedImageNameGetIdentifier)(NSString *);
136 static UIImage *(*_UISharedImageWithIdentifier)(int);
138 static NSMutableDictionary *UIImages_;
139 static NSMutableDictionary *PathImages_;
140 static NSMutableDictionary *Cache_;
141 static NSMutableDictionary *Strings_;
142 static NSMutableDictionary *Themed_;
143 static NSMutableDictionary *Bundles_;
145 static NSFileManager *Manager_;
146 static NSDictionary *English_;
147 static NSMutableDictionary *Info_;
148 static NSMutableArray *themes_;
150 static NSString *$getTheme$(NSArray *files, bool parent = false) {
152 NSLog(@"WB:Debug: %@", [files description]);
154 for (NSString *theme in themes_)
155 for (NSString *file in files) {
156 NSString *path([NSString stringWithFormat:@"%@/%@", theme, file]);
157 if ([Manager_ fileExistsAtPath:path])
158 return parent ? theme : path;
164 static NSString *$pathForFile$inBundle$(NSString *file, NSBundle *bundle, bool ui) {
165 NSString *identifier = [bundle bundleIdentifier];
166 NSMutableArray *names = [NSMutableArray arrayWithCapacity:8];
168 if (identifier != nil)
169 [names addObject:[NSString stringWithFormat:@"Bundles/%@/%@", identifier, file]];
170 if (NSString *folder = [[bundle bundlePath] lastPathComponent])
171 [names addObject:[NSString stringWithFormat:@"Folders/%@/%@", folder, file]];
173 [names addObject:[NSString stringWithFormat:@"UIImages/%@", file]];
175 #define remapResourceName(oldname, newname) \
176 else if ([file isEqualToString:oldname]) \
177 [names addObject:[NSString stringWithFormat:@"%@.png", newname]]; \
179 if (identifier == nil);
180 else if ([identifier isEqualToString:@"com.apple.calculator"])
181 [names addObject:[NSString stringWithFormat:@"Files/Applications/Calculator.app/%@", file]];
182 else if (![identifier isEqualToString:@"com.apple.springboard"]);
183 remapResourceName(@"FSO_BG.png", @"StatusBar")
184 remapResourceName(@"SBDockBG.png", @"Dock")
185 remapResourceName(@"SBWeatherCelsius.png", @"Icons/Weather")
187 if (NSString *path = $getTheme$(names))
192 static NSString *$pathForIcon$(SBApplication *self) {
193 NSString *identifier = [self bundleIdentifier];
194 NSString *path = [self path];
195 NSString *folder = [path lastPathComponent];
196 NSString *dname = [self displayName];
197 NSString *didentifier = [self displayIdentifier];
200 NSLog(@"WB:Debug: [SBApplication(%@:%@:%@:%@) pathForIcon]", identifier, folder, dname, didentifier);
202 NSMutableArray *names = [NSMutableArray arrayWithCapacity:8];
204 if (identifier != nil)
205 [names addObject:[NSString stringWithFormat:@"Bundles/%@/icon.png", identifier]];
207 [names addObject:[NSString stringWithFormat:@"Folders/%@/icon.png", folder]];
209 #define testForIcon(Name) \
210 if (NSString *name = Name) \
211 [names addObject:[NSString stringWithFormat:@"Icons/%@.png", name]];
213 testForIcon(identifier);
216 if (didentifier != nil) {
217 testForIcon([English_ objectForKey:didentifier]);
219 NSArray *parts = [didentifier componentsSeparatedByString:@"-"];
220 if ([parts count] != 1)
221 if (NSDictionary *english = [[[NSDictionary alloc] initWithContentsOfFile:[path stringByAppendingString:@"/English.lproj/UIRoleDisplayNames.strings"]] autorelease])
222 testForIcon([english objectForKey:[parts lastObject]]);
225 if (NSString *path = $getTheme$(names))
230 @interface NSBundle (WinterBoard)
231 + (NSBundle *) wb$bundleWithFile:(NSString *)path;
234 @implementation NSBundle (WinterBoard)
236 + (NSBundle *) wb$bundleWithFile:(NSString *)path {
237 path = [path stringByDeletingLastPathComponent];
238 if (path == nil || [path length] == 0 || [path isEqualToString:@"/"])
241 NSBundle *bundle([Bundles_ objectForKey:path]);
242 if (reinterpret_cast<id>(bundle) == [NSNull null])
244 else if (bundle == nil) {
245 if ([Manager_ fileExistsAtPath:[path stringByAppendingPathComponent:@"Info.plist"]])
246 bundle = [NSBundle bundleWithPath:path];
248 bundle = [NSBundle wb$bundleWithFile:path];
250 NSLog(@"WB:Debug:PathBundle(%@, %@)", path, bundle);
251 [Bundles_ setObject:(bundle == nil ? [NSNull null] : reinterpret_cast<id>(bundle)) forKey:path];
259 @interface NSString (WinterBoard)
260 - (NSString *) wb$themedPath;
263 @implementation NSString (WinterBoard)
265 - (NSString *) wb$themedPath {
267 NSLog(@"WB:Debug:Bypass(\"%@\")", self);
269 if (NSBundle *bundle = [NSBundle wb$bundleWithFile:self]) {
270 NSString *file([self stringByResolvingSymlinksInPath]);
271 NSString *prefix([[bundle bundlePath] stringByResolvingSymlinksInPath]);
272 if ([file hasPrefix:prefix]) {
273 NSUInteger length([prefix length]);
274 if (length != [file length])
275 if (NSString *path = $pathForFile$inBundle$([file substringFromIndex:(length + 1)], bundle, false))
285 MSHook(void, SBIconModel$cacheImageForIcon$, SBIconModel *self, SEL sel, SBIcon *icon) {
286 _SBIconModel$cacheImageForIcon$(self, sel, icon);
287 NSString *key([icon displayIdentifier]);
289 if (UIImage *image = [icon icon]) {
290 CGColorSpaceRef space(CGColorSpaceCreateDeviceRGB());
291 CGRect rect = {CGPointMake(1, 1), [image size]};
292 CGSize size = {rect.size.width + 2, rect.size.height + 2};
294 CGContextRef context(CGBitmapContextCreate(NULL, size.width, size.height, 8, 4 * size.width, space, kCGBitmapByteOrder32Little | kCGImageAlphaPremultipliedFirst));
295 CGColorSpaceRelease(space);
297 CGContextDrawImage(context, rect, [image CGImage]);
298 CGImageRef ref(CGBitmapContextCreateImage(context));
299 CGContextRelease(context);
301 UIImage *image([UIImage imageWithCGImage:ref]);
304 [Cache_ setObject:image forKey:key];
308 MSHook(UIImage *, SBIconModel$getCachedImagedForIcon$, SBIconModel *self, SEL sel, SBIcon *icon) {
309 NSString *key([icon displayIdentifier]);
310 if (UIImage *image = [Cache_ objectForKey:key])
313 return _SBIconModel$getCachedImagedForIcon$(self, sel, icon);
316 MSHook(UIImage *, SBApplicationIcon$icon, SBApplicationIcon *self, SEL sel) {
317 if (![Info_ boolForKey:@"ComposeStoreIcons"])
318 if (NSString *path = $pathForIcon$([self application]))
319 return [UIImage imageWithContentsOfFile:path];
320 return _SBApplicationIcon$icon(self, sel);
323 MSHook(UIImage *, SBBookmarkIcon$icon, SBBookmarkIcon *self, SEL sel) {
325 NSLog(@"WB:Debug:Bookmark(%@:%@)", [self displayIdentifier], [self displayName]);
326 if (NSString *path = $getTheme$([NSArray arrayWithObject:[NSString stringWithFormat:@"Icons/%@.png", [self displayName]]]))
327 return [UIImage imageWithContentsOfFile:path];
328 return _SBBookmarkIcon$icon(self, sel);
331 MSHook(NSString *, SBApplication$pathForIcon, SBApplication *self, SEL sel) {
332 if (NSString *path = $pathForIcon$(self))
334 return _SBApplication$pathForIcon(self, sel);
337 static UIImage *CachedImageAtPath(NSString *path) {
338 path = [path stringByResolvingSymlinksInPath];
339 UIImage *image = [PathImages_ objectForKey:path];
341 return reinterpret_cast<id>(image) == [NSNull null] ? nil : image;
342 image = [[UIImage alloc] initWithContentsOfFile:path cache:true];
344 image = [image autorelease];
345 [PathImages_ setObject:(image == nil ? [NSNull null] : reinterpret_cast<id>(image)) forKey:path];
349 MSHook(CGImageRef, _UIImageRefAtPath, NSString *name, bool cache, UIImageOrientation *orientation) {
351 NSLog(@"WB:Debug: _UIImageRefAtPath(\"%@\", %s)", name, cache ? "true" : "false");
352 return __UIImageRefAtPath([name wb$themedPath], cache, orientation);
355 /*MSHook(UIImage *, _UIImageAtPath, NSString *name, NSBundle *bundle) {
357 return __UIImageAtPath(name, nil);
359 NSString *key = [NSString stringWithFormat:@"B:%@/%@", [bundle bundleIdentifier], name];
360 UIImage *image = [PathImages_ objectForKey:key];
362 return reinterpret_cast<id>(image) == [NSNull null] ? nil : image;
364 NSLog(@"WB:Debug: _UIImageAtPath(\"%@\", %@)", name, bundle);
365 if (NSString *path = $pathForFile$inBundle$(name, bundle, false))
366 image = CachedImageAtPath(path);
368 image = __UIImageAtPath(name, bundle);
369 [PathImages_ setObject:(image == nil ? [NSNull null] : reinterpret_cast<id>(image)) forKey:key];
374 MSHook(UIImage *, _UIApplicationImageWithName, NSString *name) {
375 NSBundle *bundle = [NSBundle mainBundle];
377 NSLog(@"WB:Debug: _UIApplicationImageWithName(\"%@\", %@)", name, bundle);
378 if (NSString *path = $pathForFile$inBundle$(name, bundle, false))
379 return CachedImageAtPath(path);
380 return __UIApplicationImageWithName(name);
383 #define WBDelegate(delegate) \
384 - (NSMethodSignature*) methodSignatureForSelector:(SEL)sel { \
386 NSLog(@"WB:MS:%s:(%s)", class_getName([self class]), sel_getName(sel)); \
387 if (NSMethodSignature *sig = [delegate methodSignatureForSelector:sel]) \
389 NSLog(@"WB:Error: [%s methodSignatureForSelector:(%s)]", class_getName([self class]), sel_getName(sel)); \
393 - (void) forwardInvocation:(NSInvocation*)inv { \
394 SEL sel = [inv selector]; \
395 if ([delegate respondsToSelector:sel]) \
396 [inv invokeWithTarget:delegate]; \
398 NSLog(@"WB:Error: [%s forwardInvocation:(%s)]", class_getName([self class]), sel_getName(sel)); \
401 MSHook(NSString *, NSBundle$pathForResource$ofType$, NSBundle *self, SEL sel, NSString *resource, NSString *type) {
402 NSString *file = type == nil ? resource : [NSString stringWithFormat:@"%@.%@", resource, type];
404 NSLog(@"WB:Debug: [NSBundle(%@) pathForResource:\"%@\"]", [self bundleIdentifier], file);
405 if (NSString *path = $pathForFile$inBundle$(file, self, false))
407 return _NSBundle$pathForResource$ofType$(self, sel, resource, type);
410 void $setBarStyle$_(NSString *name, int &style) {
412 NSLog(@"WB:Debug:%@Style:%d", name, style);
413 NSNumber *number = nil;
415 number = [Info_ objectForKey:[NSString stringWithFormat:@"%@Style-%d", name, style]];
417 number = [Info_ objectForKey:[NSString stringWithFormat:@"%@Style", name]];
419 style = [number intValue];
421 NSLog(@"WB:Debug:%@Style=%d", name, style);
425 MSHook(void, SBCalendarIconContentsView$drawRect$, SBCalendarIconContentsView *self, SEL sel, CGRect rect) {
426 NSBundle *bundle([NSBundle mainBundle]);
428 CFLocaleRef locale(CFLocaleCopyCurrent());
429 CFDateFormatterRef formatter(CFDateFormatterCreate(NULL, locale, kCFDateFormatterNoStyle, kCFDateFormatterNoStyle));
432 CFDateRef now(CFDateCreate(NULL, CFAbsoluteTimeGetCurrent()));
434 CFDateFormatterSetFormat(formatter, (CFStringRef) [bundle localizedStringForKey:@"CALENDAR_ICON_DAY_NUMBER_FORMAT" value:@"" table:@"SpringBoard"]);
435 CFStringRef date(CFDateFormatterCreateStringWithDate(NULL, formatter, now));
436 CFDateFormatterSetFormat(formatter, (CFStringRef) [bundle localizedStringForKey:@"CALENDAR_ICON_DAY_NAME_FORMAT" value:@"" table:@"SpringBoard"]);
437 CFStringRef day(CFDateFormatterCreateStringWithDate(NULL, formatter, now));
441 CFRelease(formatter);
443 NSString *datestyle(@""
444 "font-family: Helvetica; "
445 "font-weight: bold; "
451 NSString *daystyle(@""
452 "font-family: Helvetica; "
453 "font-weight: bold; "
456 "text-shadow: rgba(0, 0, 0, 0.2) -1px -1px 2px; "
459 if (NSString *style = [Info_ objectForKey:@"CalendarIconDateStyle"])
460 datestyle = [datestyle stringByAppendingString:style];
461 if (NSString *style = [Info_ objectForKey:@"CalendarIconDayStyle"])
462 daystyle = [daystyle stringByAppendingString:style];
464 float width([self bounds].size.width);
466 CGSize datesize = [(NSString *)date sizeWithStyle:datestyle forWidth:(width + leeway)];
467 CGSize daysize = [(NSString *)day sizeWithStyle:daystyle forWidth:(width + leeway)];
469 [(NSString *)date drawAtPoint:CGPointMake(
470 (width + 1 - datesize.width) / 2, (71 - datesize.height) / 2
471 ) withStyle:datestyle];
473 [(NSString *)day drawAtPoint:CGPointMake(
474 (width + 1 - daysize.width) / 2, (16 - daysize.height) / 2
475 ) withStyle:daystyle];
481 /*static id UINavigationBarBackground$initWithFrame$withBarStyle$withTintColor$(UINavigationBarBackground<WinterBoard> *self, SEL sel, CGRect frame, int style, UIColor *tint) {
484 if (NSNumber *number = [Info_ objectForKey:@"NavigationBarStyle"])
485 style = [number intValue];
487 if (UIColor *color = [Info_ colorForKey:@"NavigationBarTint"])
490 return [self wb$initWithFrame:frame withBarStyle:style withTintColor:tint];
493 /*static id UINavigationBar$initWithCoder$(SBAppWindow<WinterBoard> *self, SEL sel, CGRect frame, NSCoder *coder) {
494 self = [self wb$initWithCoder:coder];
497 UINavigationBar$setBarStyle$_(self);
501 static id UINavigationBar$initWithFrame$(SBAppWindow<WinterBoard> *self, SEL sel, CGRect frame) {
502 self = [self wb$initWithFrame:frame];
505 UINavigationBar$setBarStyle$_(self);
509 MSHook(void, UIToolbar$setBarStyle$, UIToolbar *self, SEL sel, int style) {
510 $setBarStyle$_(@"Toolbar", style);
511 return _UIToolbar$setBarStyle$(self, sel, style);
514 MSHook(void, UINavigationBar$setBarStyle$, UINavigationBar *self, SEL sel, int style) {
515 $setBarStyle$_(@"NavigationBar", style);
516 return _UINavigationBar$setBarStyle$(self, sel, style);
519 MSHook(void, SBButtonBar$didMoveToSuperview, UIView *self, SEL sel) {
520 [[self superview] setBackgroundColor:[UIColor clearColor]];
521 _SBButtonBar$didMoveToSuperview(self, sel);
524 MSHook(void, SBStatusBarContentsView$didMoveToSuperview, UIView *self, SEL sel) {
525 [[self superview] setBackgroundColor:[UIColor clearColor]];
526 _SBStatusBarContentsView$didMoveToSuperview(self, sel);
529 MSHook(UIImage *, UIImage$defaultDesktopImage, UIImage *self, SEL sel) {
531 NSLog(@"WB:Debug:DefaultDesktopImage");
532 if (NSString *path = $getTheme$([NSArray arrayWithObjects:@"LockBackground.png", @"LockBackground.jpg", nil]))
533 return [UIImage imageWithContentsOfFile:path];
534 return _UIImage$defaultDesktopImage(self, sel);
537 static NSArray *Wallpapers_;
538 static NSString *WallpaperFile_;
539 static UIImageView *WallpaperImage_;
540 static UIWebDocumentView *WallpaperPage_;
541 static NSURL *WallpaperURL_;
543 #define _release(object) \
544 do if (object != nil) { \
549 MSHook(id, SBContentLayer$initWithSize$, SBContentLayer *self, SEL sel, CGSize size) {
550 self = _SBContentLayer$initWithSize$(self, sel, size);
554 _release(WallpaperFile_);
555 _release(WallpaperImage_);
556 _release(WallpaperPage_);
557 _release(WallpaperURL_);
559 if (NSString *theme = $getTheme$(Wallpapers_, true)) {
560 NSString *mp4 = [theme stringByAppendingPathComponent:@"Wallpaper.mp4"];
561 if ([Manager_ fileExistsAtPath:mp4]) {
562 MPVideoView *video = [[[$MPVideoView alloc] initWithFrame:[self bounds]] autorelease];
563 [video setMovieWithPath:mp4];
564 [video setRepeatMode:1];
565 [video setRepeatGap:0];
566 [self addSubview:video];
567 [video playFromBeginning];;
570 NSString *png = [theme stringByAppendingPathComponent:@"Wallpaper.png"];
571 NSString *jpg = [theme stringByAppendingPathComponent:@"Wallpaper.jpg"];
574 if ([Manager_ fileExistsAtPath:png])
576 else if ([Manager_ fileExistsAtPath:jpg])
582 image = [[UIImage alloc] initWithContentsOfFile:path];
584 image = [image autorelease];
588 WallpaperFile_ = [path retain];
589 WallpaperImage_ = [[UIImageView alloc] initWithImage:image];
590 [self addSubview:WallpaperImage_];
593 NSString *html = [theme stringByAppendingPathComponent:@"Wallpaper.html"];
594 if ([Manager_ fileExistsAtPath:html]) {
595 CGRect bounds = [self bounds];
597 UIWebDocumentView *view([[[UIWebDocumentView alloc] initWithFrame:bounds] autorelease]);
598 [view setAutoresizes:true];
600 WallpaperPage_ = [view retain];
601 WallpaperURL_ = [[NSURL fileURLWithPath:html] retain];
603 [WallpaperPage_ loadRequest:[NSURLRequest requestWithURL:WallpaperURL_]];
605 [[view webView] setDrawsBackground:false];
606 [view setBackgroundColor:[UIColor clearColor]];
608 [self addSubview:view];
612 for (size_t i(0), e([themes_ count]); i != e; ++i) {
613 NSString *theme = [themes_ objectAtIndex:(e - i - 1)];
614 NSString *html = [theme stringByAppendingPathComponent:@"Widget.html"];
615 if ([Manager_ fileExistsAtPath:html]) {
616 CGRect bounds = [self bounds];
618 UIWebDocumentView *view([[[UIWebDocumentView alloc] initWithFrame:bounds] autorelease]);
619 [view setAutoresizes:true];
621 NSURL *url = [NSURL fileURLWithPath:html];
622 [view loadRequest:[NSURLRequest requestWithURL:url]];
624 [[view webView] setDrawsBackground:false];
625 [view setBackgroundColor:[UIColor clearColor]];
627 [self addSubview:view];
634 MSHook(void, SBSlidingAlertDisplay$updateDesktopImage$, SBSlidingAlertDisplay *self, SEL sel, UIImage *image) {
635 NSString *path = $getTheme$([NSArray arrayWithObject:@"LockBackground.html"]);
636 UIView *&_backgroundView(MSHookIvar<UIView *>(self, "_backgroundView"));
638 if (path != nil && _backgroundView != nil)
641 _SBSlidingAlertDisplay$updateDesktopImage$(self, sel, image);
644 CGRect bounds = [self bounds];
646 UIWebDocumentView *view([[[UIWebDocumentView alloc] initWithFrame:bounds] autorelease]);
647 [view setAutoresizes:true];
649 if (WallpaperPage_ != nil)
650 [WallpaperPage_ release];
651 WallpaperPage_ = [view retain];
653 if (WallpaperURL_ != nil)
654 [WallpaperURL_ release];
655 WallpaperURL_ = [[NSURL fileURLWithPath:path] retain];
657 [WallpaperPage_ loadRequest:[NSURLRequest requestWithURL:WallpaperURL_]];
659 [[view webView] setDrawsBackground:false];
660 [view setBackgroundColor:[UIColor clearColor]];
662 [self insertSubview:view aboveSubview:_backgroundView];
666 /*extern "C" CGColorRef CGGStateGetSystemColor(void *);
667 extern "C" CGColorRef CGGStateGetFillColor(void *);
668 extern "C" CGColorRef CGGStateGetStrokeColor(void *);
669 extern "C" NSString *UIStyleStringFromColor(CGColorRef);*/
671 /* WBTimeLabel {{{ */
672 @interface WBTimeLabel : NSProxy {
674 _transient SBStatusBarTimeView *view_;
677 - (id) initWithTime:(NSString *)time view:(SBStatusBarTimeView *)view;
681 @implementation WBTimeLabel
688 - (id) initWithTime:(NSString *)time view:(SBStatusBarTimeView *)view {
689 time_ = [time retain];
696 - (CGSize) drawAtPoint:(CGPoint)point forWidth:(float)width withFont:(UIFont *)font lineBreakMode:(int)mode {
697 if (NSString *custom = [Info_ objectForKey:@"TimeStyle"]) {
698 BOOL &_mode(MSHookIvar<BOOL>(view_, "_mode"));;
700 [time_ drawAtPoint:point withStyle:[NSString stringWithFormat:@""
701 "font-family: Helvetica; "
702 "font-weight: bold; "
705 "%@", _mode ? @"white" : @"black", custom]];
710 return [time_ drawAtPoint:point forWidth:width withFont:font lineBreakMode:mode];
715 /* WBBadgeLabel {{{ */
716 @interface WBBadgeLabel : NSProxy {
720 - (id) initWithBadge:(NSString *)badge;
724 @implementation WBBadgeLabel
731 - (id) initWithBadge:(NSString *)badge {
732 badge_ = [badge retain];
738 - (CGSize) drawAtPoint:(CGPoint)point forWidth:(float)width withFont:(UIFont *)font lineBreakMode:(int)mode {
739 if (NSString *custom = [Info_ objectForKey:@"BadgeStyle"]) {
740 [badge_ drawAtPoint:point withStyle:[NSString stringWithFormat:@""
741 "font-family: Helvetica; "
742 "font-weight: bold; "
750 return [badge_ drawAtPoint:point forWidth:width withFont:font lineBreakMode:mode];
756 MSHook(id, SBIconBadge$initWithBadge$, SBIconBadge *self, SEL sel, NSString *badge) {
757 if ((self = _SBIconBadge$initWithBadge$(self, sel, badge)) != nil) {
758 id &_badge(MSHookIvar<id>(self, "_badge"));
760 if (id label = [[WBBadgeLabel alloc] initWithBadge:[_badge autorelease]])
765 MSHook(void, SBStatusBarController$setStatusBarMode$orientation$duration$fenceID$animation$, SBStatusBarController *self, SEL sel, int mode, int orientation, float duration, int id, int animation) {
767 NSLog(@"WB:Debug:setStatusBarMode:%d", mode);
768 if (mode < 100) // 104:hidden 105:glowing
769 if (NSNumber *number = [Info_ objectForKey:@"StatusBarMode"])
770 mode = [number intValue];
771 return _SBStatusBarController$setStatusBarMode$orientation$duration$fenceID$animation$(self, sel, mode, orientation, duration, id, animation);
774 MSHook(id, SBStatusBarContentsView$initWithStatusBar$mode$, SBStatusBarContentsView *self, SEL sel, id bar, int mode) {
775 if (NSNumber *number = [Info_ objectForKey:@"StatusBarContentsMode"])
776 mode = [number intValue];
777 return _SBStatusBarContentsView$initWithStatusBar$mode$(self, sel, bar, mode);
780 MSHook(NSString *, SBStatusBarOperatorNameView$operatorNameStyle, SBStatusBarOperatorNameView *self, SEL sel) {
781 NSString *style(_SBStatusBarOperatorNameView$operatorNameStyle(self, sel));
783 NSLog(@"operatorNameStyle= %@", style);
784 if (NSString *custom = [Info_ objectForKey:@"OperatorNameStyle"])
785 style = [NSString stringWithFormat:@"%@; %@", style, custom];
789 MSHook(void, SBStatusBarOperatorNameView$setOperatorName$fullSize$, SBStatusBarOperatorNameView *self, SEL sel, NSString *name, BOOL full) {
791 NSLog(@"setOperatorName:\"%@\" fullSize:%u", name, full);
792 return _SBStatusBarOperatorNameView$setOperatorName$fullSize$(self, sel, name, NO);
795 // XXX: replace this with [SBStatusBarTimeView tile]
796 MSHook(void, SBStatusBarTimeView$drawRect$, SBStatusBarTimeView *self, SEL sel, CGRect rect) {
797 id &_time(MSHookIvar<id>(self, "_time"));
798 if (_time != nil && [_time class] != [WBTimeLabel class])
799 object_setInstanceVariable(self, "_time", reinterpret_cast<void *>([[WBTimeLabel alloc] initWithTime:[_time autorelease] view:self]));
800 return _SBStatusBarTimeView$drawRect$(self, sel, rect);
803 MSHook(void, SBIconController$appendIconList$, SBIconController *self, SEL sel, SBIconList *list) {
805 NSLog(@"appendIconList:%@", list);
806 return _SBIconController$appendIconList$(self, sel, list);
809 MSHook(id, SBIconLabel$initWithSize$label$, SBIconLabel *self, SEL sel, CGSize size, NSString *label) {
810 self = _SBIconLabel$initWithSize$label$(self, sel, size, label);
812 [self setClipsToBounds:NO];
816 MSHook(void, SBIconLabel$setInDock$, SBIconLabel *self, SEL sel, BOOL docked) {
817 id &_label(MSHookIvar<id>(self, "_label"));
818 if (![Info_ boolForKey:@"UndockedIconLabels"])
820 if (_label != nil && [_label respondsToSelector:@selector(setInDock:)])
821 [_label setInDock:docked];
822 return _SBIconLabel$setInDock$(self, sel, docked);
825 MSHook(NSString *, NSBundle$localizedStringForKey$value$table$, NSBundle *self, SEL sel, NSString *key, NSString *value, NSString *table) {
826 NSString *identifier = [self bundleIdentifier];
827 NSLocale *locale = [NSLocale currentLocale];
828 NSString *language = [locale objectForKey:NSLocaleLanguageCode];
830 NSLog(@"WB:Debug:[NSBundle(%@) localizedStringForKey:\"%@\" value:\"%@\" table:\"%@\"] (%@)", identifier, key, value, table, language);
831 NSString *file = table == nil ? @"Localizable" : table;
832 NSString *name = [NSString stringWithFormat:@"%@:%@", identifier, file];
833 NSDictionary *strings;
834 if ((strings = [Strings_ objectForKey:name]) != nil) {
835 if (static_cast<id>(strings) != [NSNull null]) strings:
836 if (NSString *value = [strings objectForKey:key])
838 } else if (NSString *path = $pathForFile$inBundle$([NSString stringWithFormat:@"%@.lproj/%@.strings",
841 if ((strings = [[NSDictionary alloc] initWithContentsOfFile:path]) != nil) {
842 [Strings_ setObject:[strings autorelease] forKey:name];
846 [Strings_ setObject:[NSNull null] forKey:name];
847 return _NSBundle$localizedStringForKey$value$table$(self, sel, key, value, table);
850 @class WebCoreFrameBridge;
851 MSHook(CGSize, WebCoreFrameBridge$renderedSizeOfNode$constrainedToWidth$, WebCoreFrameBridge *self, SEL sel, id node, float width) {
854 void **core(reinterpret_cast<void **>([node _node]));
855 if (core == NULL || core[6] == NULL)
857 return _WebCoreFrameBridge$renderedSizeOfNode$constrainedToWidth$(self, sel, node, width);
860 MSHook(void, SBIconLabel$drawRect$, SBIconLabel *self, SEL sel, CGRect rect) {
861 CGRect bounds = [self bounds];
863 static Ivar drawMoreLegibly = object_getInstanceVariable(self, "_drawMoreLegibly", NULL);
866 Ivar ivar = object_getInstanceVariable(self, "_inDock", reinterpret_cast<void **>(&docked));
867 docked = (docked & (ivar_getOffset(ivar) == ivar_getOffset(drawMoreLegibly) ? 0x2 : 0x1)) != 0;
869 NSString *&label(MSHookIvar<NSString *>(self, "_label"));
871 NSString *style = [NSString stringWithFormat:@""
872 "font-family: Helvetica; "
873 "font-weight: bold; "
876 "", docked ? @"white" : @"#b3b3b3"];
879 style = [style stringByAppendingString:@"text-shadow: rgba(0, 0, 0, 0.5) 0px -1px 0px; "];
880 float max = 75, width = [label sizeWithStyle:style forWidth:320].width;
882 style = [style stringByAppendingString:[NSString stringWithFormat:@"letter-spacing: -%f; ", ((width - max) / ([label length] - 1))]];
883 if (NSString *custom = [Info_ objectForKey:(docked ? @"DockedIconLabelStyle" : @"UndockedIconLabelStyle")])
884 style = [style stringByAppendingString:custom];
886 CGSize size = [label sizeWithStyle:style forWidth:bounds.size.width];
887 [label drawAtPoint:CGPointMake((bounds.size.width - size.width) / 2, 0) withStyle:style];
890 MSHook(void, mSMSMessageTranscriptController$loadView, mSMSMessageTranscriptController *self, SEL sel) {
891 _mSMSMessageTranscriptController$loadView(self, sel);
893 if (NSString *path = $getTheme$([NSArray arrayWithObjects:@"SMSBackground.png", @"SMSBackground.jpg", nil]))
894 if (UIImage *image = [[UIImage alloc] initWithContentsOfFile:path]) {
896 UIView *&_transcriptLayer(MSHookIvar<UIView *>(self, "_transcriptLayer"));
897 UIView *parent([_transcriptLayer superview]);
898 UIImageView *background([[[UIImageView alloc] initWithImage:image] autorelease]);
899 [parent insertSubview:background belowSubview:_transcriptLayer];
900 [_transcriptLayer setBackgroundColor:[UIColor clearColor]];
904 MSHook(UIImage *, _UIImageWithName, NSString *name) {
905 int id(_UISharedImageNameGetIdentifier(name));
907 NSLog(@"WB:Debug: _UIImageWithName(\"%@\", %d)", name, id);
910 return _UIImageAtPath(name, _UIKitBundle());
912 NSNumber *key([NSNumber numberWithInt:id]);
913 UIImage *image = [UIImages_ objectForKey:key];
915 return reinterpret_cast<id>(image) == [NSNull null] ? nil : image;
916 if (NSString *path = $pathForFile$inBundle$(name, _UIKitBundle(), true)) {
917 image = [[UIImage alloc] initWithContentsOfFile:path];
922 image = _UISharedImageWithIdentifier(id);
923 [UIImages_ setObject:(image == nil ? [NSNull null] : reinterpret_cast<id>(image)) forKey:key];
928 MSHook(UIImage *, _UIImageWithNameInDomain, NSString *name, NSString *domain) {
929 NSString *key = [NSString stringWithFormat:@"D:%zu%@%@", [domain length], domain, name];
930 UIImage *image = [PathImages_ objectForKey:key];
932 return reinterpret_cast<id>(image) == [NSNull null] ? nil : image;
934 NSLog(@"WB:Debug: UIImageWithNameInDomain(\"%@\", \"%@\")", name, domain);
935 if (NSString *path = $getTheme$([NSArray arrayWithObject:[NSString stringWithFormat:@"Domains/%@/%@", domain, name]])) {
936 image = [[UIImage alloc] initWithContentsOfFile:path];
941 image = __UIImageWithNameInDomain(name, domain);
942 [PathImages_ setObject:(image == nil ? [NSNull null] : reinterpret_cast<id>(image)) forKey:key];
946 #define AudioToolbox "/System/Library/Frameworks/AudioToolbox.framework/AudioToolbox"
947 #define UIKit "/System/Library/Frameworks/UIKit.framework/UIKit"
949 bool (*_Z24GetFileNameForThisActionmPcRb)(unsigned long a0, char *a1, bool &a2);
951 MSHook(bool, _Z24GetFileNameForThisActionmPcRb, unsigned long a0, char *a1, bool &a2) {
952 bool value = __Z24GetFileNameForThisActionmPcRb(a0, a1, a2);
954 NSLog(@"WB:Debug:GetFileNameForThisAction(%u, %s, %u) = %u", a0, value ? a1 : NULL, a2, value);
957 NSString *path = [NSString stringWithUTF8String:a1];
958 if ([path hasPrefix:@"/System/Library/Audio/UISounds/"]) {
959 NSString *file = [path substringFromIndex:31];
961 for (NSString *theme in themes_) {
962 NSString *path([NSString stringWithFormat:@"%@/UISounds/%@", theme, file]);
963 if ([Manager_ fileExistsAtPath:path]) {
964 strcpy(a1, [path UTF8String]);
973 static void ChangeWallpaper(
974 CFNotificationCenterRef center,
981 NSLog(@"WB:Debug:ChangeWallpaper!");
984 if (WallpaperFile_ != nil) {
985 image = [[UIImage alloc] initWithContentsOfFile:WallpaperFile_];
987 image = [image autorelease];
990 if (WallpaperImage_ != nil)
991 [WallpaperImage_ setImage:image];
992 if (WallpaperPage_ != nil)
993 [WallpaperPage_ loadRequest:[NSURLRequest requestWithURL:WallpaperURL_]];
997 #define WBRename(name, sel, imp) \
998 _ ## name ## $ ## imp = MSHookMessage($ ## name, @selector(sel), &$ ## name ## $ ## imp)
1000 extern "C" void WBInitialize() {
1001 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
1003 NSString *identifier([[NSBundle mainBundle] bundleIdentifier]);
1005 NSLog(@"WB:Notice: WinterBoard");
1008 memset(nl, 0, sizeof(nl));
1010 nl[0].n_un.n_name = (char *) "__UIApplicationImageWithName";
1011 nl[1].n_un.n_name = (char *) "__UIImageAtPath";
1012 nl[2].n_un.n_name = (char *) "__UIImageRefAtPath";
1013 nl[3].n_un.n_name = (char *) "__UIImageWithNameInDomain";
1014 nl[4].n_un.n_name = (char *) "__UIKitBundle";
1015 nl[5].n_un.n_name = (char *) "__UISharedImageInitialize";
1016 nl[6].n_un.n_name = (char *) "__UISharedImageNameGetIdentifier";
1017 nl[7].n_un.n_name = (char *) "__UISharedImageWithIdentifier";
1021 _UIApplicationImageWithName = (UIImage *(*)(NSString *)) nl[0].n_value;
1022 _UIImageAtPath = (UIImage *(*)(NSString *, NSBundle *)) nl[1].n_value;
1023 _UIImageRefAtPath = (CGImageRef (*)(NSString *, bool, UIImageOrientation *)) nl[2].n_value;
1024 _UIImageWithNameInDomain = (UIImage *(*)(NSString *, NSString *)) nl[3].n_value;
1025 _UIKitBundle = (NSBundle *(*)()) nl[4].n_value;
1026 _UISharedImageInitialize = (void (*)(bool)) nl[5].n_value;
1027 _UISharedImageNameGetIdentifier = (int (*)(NSString *)) nl[6].n_value;
1028 _UISharedImageWithIdentifier = (UIImage *(*)(int)) nl[7].n_value;
1030 MSHookFunction(_UIApplicationImageWithName, &$_UIApplicationImageWithName, &__UIApplicationImageWithName);
1031 MSHookFunction(_UIImageRefAtPath, &$_UIImageRefAtPath, &__UIImageRefAtPath);
1032 MSHookFunction(_UIImageWithName, &$_UIImageWithName, &__UIImageWithName);
1033 MSHookFunction(_UIImageWithNameInDomain, &$_UIImageWithNameInDomain, &__UIImageWithNameInDomain);
1035 if (dlopen(AudioToolbox, RTLD_LAZY | RTLD_NOLOAD) != NULL) {
1037 memset(nl, 0, sizeof(nl));
1038 nl[0].n_un.n_name = (char *) "__Z24GetFileNameForThisActionmPcRb";
1039 nlist(AudioToolbox, nl);
1040 _Z24GetFileNameForThisActionmPcRb = (bool (*)(unsigned long, char *, bool &)) nl[0].n_value;
1041 MSHookFunction(_Z24GetFileNameForThisActionmPcRb, &$_Z24GetFileNameForThisActionmPcRb, &__Z24GetFileNameForThisActionmPcRb);
1044 $NSBundle = objc_getClass("NSBundle");
1046 _NSBundle$localizedStringForKey$value$table$ = MSHookMessage($NSBundle, @selector(localizedStringForKey:value:table:), &$NSBundle$localizedStringForKey$value$table$);
1047 _NSBundle$pathForResource$ofType$ = MSHookMessage($NSBundle, @selector(pathForResource:ofType:), &$NSBundle$pathForResource$ofType$);
1049 $UIImage = objc_getClass("UIImage");
1050 $UINavigationBar = objc_getClass("UINavigationBar");
1051 $UIToolbar = objc_getClass("UIToolbar");
1053 _UIImage$defaultDesktopImage = MSHookMessage(object_getClass($UIImage), @selector(defaultDesktopImage), &$UIImage$defaultDesktopImage);
1055 //WBRename("UINavigationBar", @selector(initWithCoder:", (IMP) &UINavigationBar$initWithCoder$);
1056 //WBRename("UINavigationBarBackground", @selector(initWithFrame:withBarStyle:withTintColor:", (IMP) &UINavigationBarBackground$initWithFrame$withBarStyle$withTintColor$);
1058 _UINavigationBar$setBarStyle$ = MSHookMessage($UINavigationBar, @selector(setBarStyle:), &$UINavigationBar$setBarStyle$);
1059 _UIToolbar$setBarStyle$ = MSHookMessage($UIToolbar, @selector(setBarStyle:), &$UIToolbar$setBarStyle$);
1061 _UISharedImageInitialize(false);
1063 Manager_ = [[NSFileManager defaultManager] retain];
1064 UIImages_ = [[NSMutableDictionary alloc] initWithCapacity:16];
1065 PathImages_ = [[NSMutableDictionary alloc] initWithCapacity:16];
1066 Strings_ = [[NSMutableDictionary alloc] initWithCapacity:0];
1067 Bundles_ = [[NSMutableDictionary alloc] initWithCapacity:2];
1069 themes_ = [[NSMutableArray alloc] initWithCapacity:8];
1071 if (NSDictionary *settings = [[NSDictionary alloc] initWithContentsOfFile:[NSString stringWithFormat:@"/User/Library/Preferences/com.saurik.WinterBoard.plist"]]) {
1072 [settings autorelease];
1074 if (NSNumber *debug = [settings objectForKey:@"Debug"])
1075 Debug_ = [debug boolValue];
1077 NSArray *themes = [settings objectForKey:@"Themes"];
1079 if (NSString *theme = [settings objectForKey:@"Theme"])
1080 themes = [NSArray arrayWithObject:[NSDictionary dictionaryWithObjectsAndKeys:
1082 [NSNumber numberWithBool:true], @"Active",
1085 for (NSDictionary *theme in themes) {
1086 NSNumber *active = [theme objectForKey:@"Active"];
1087 if (![active boolValue])
1090 NSString *name = [theme objectForKey:@"Name"];
1094 NSString *theme = nil;
1096 #define testForTheme(format...) \
1097 if (theme == nil) { \
1098 NSString *path = [NSString stringWithFormat:format]; \
1099 if ([Manager_ fileExistsAtPath:path]) { \
1100 [themes_ addObject:path]; \
1105 testForTheme(@"/Library/Themes/%@.theme", name)
1106 testForTheme(@"/Library/Themes/%@", name)
1107 testForTheme(@"%@/Library/SummerBoard/Themes/%@", NSHomeDirectory(), name)
1111 Info_ = [[NSMutableDictionary dictionaryWithCapacity:16] retain];
1113 for (NSString *theme in themes_)
1114 if (NSDictionary *info = [[NSDictionary alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/Info.plist", theme]])
1115 for (NSString *key in [info allKeys])
1116 if ([Info_ objectForKey:key] == nil)
1117 [Info_ setObject:[info objectForKey:key] forKey:key];
1119 if ([identifier isEqualToString:@"com.apple.MobileSMS"]) {
1120 Class mSMSMessageTranscriptController = objc_getClass("mSMSMessageTranscriptController");
1121 _mSMSMessageTranscriptController$loadView = MSHookMessage(mSMSMessageTranscriptController, @selector(loadView), &$mSMSMessageTranscriptController$loadView);
1122 } else if ([identifier isEqualToString:@"com.apple.springboard"]) {
1123 CFNotificationCenterAddObserver(
1124 CFNotificationCenterGetDarwinNotifyCenter(),
1125 NULL, &ChangeWallpaper, (CFStringRef) @"com.saurik.winterboard.lockbackground", NULL, 0
1128 NSBundle *MediaPlayer = [NSBundle bundleWithPath:@"/System/Library/Frameworks/MediaPlayer.framework"];
1129 if (MediaPlayer != nil)
1132 $MPVideoView = objc_getClass("MPVideoView");
1133 $WebCoreFrameBridge = objc_getClass("WebCoreFrameBridge");
1135 $SBApplication = objc_getClass("SBApplication");
1136 $SBApplicationIcon = objc_getClass("SBApplicationIcon");
1137 $SBBookmarkIcon = objc_getClass("SBBookmarkIcon");
1138 $SBButtonBar = objc_getClass("SBButtonBar");
1139 $SBCalendarIconContentsView = objc_getClass("SBCalendarIconContentsView");
1140 $SBContentLayer = objc_getClass("SBContentLayer");
1141 $SBIconBadge = objc_getClass("SBIconBadge");
1142 $SBIconController = objc_getClass("SBIconController");
1143 $SBIconLabel = objc_getClass("SBIconLabel");
1144 $SBIconModel = objc_getClass("SBIconModel");
1145 $SBSlidingAlertDisplay = objc_getClass("SBSlidingAlertDisplay");
1146 $SBStatusBarContentsView = objc_getClass("SBStatusBarContentsView");
1147 $SBStatusBarController = objc_getClass("SBStatusBarController");
1148 $SBStatusBarOperatorNameView = objc_getClass("SBStatusBarOperatorNameView");
1149 $SBStatusBarTimeView = objc_getClass("SBStatusBarTimeView");
1151 WBRename(WebCoreFrameBridge, renderedSizeOfNode:constrainedToWidth:, renderedSizeOfNode$constrainedToWidth$);
1153 WBRename(SBApplication, pathForIcon, pathForIcon);
1154 WBRename(SBApplicationIcon, icon, icon);
1155 WBRename(SBBookmarkIcon, icon, icon);
1156 WBRename(SBButtonBar, didMoveToSuperview, didMoveToSuperview);
1157 WBRename(SBCalendarIconContentsView, drawRect:, drawRect$);
1158 WBRename(SBContentLayer, initWithSize:, initWithSize$);
1159 WBRename(SBIconBadge, initWithBadge:, initWithBadge$);
1160 WBRename(SBIconController, appendIconList:, appendIconList$);
1162 WBRename(SBIconLabel, drawRect:, drawRect$);
1163 WBRename(SBIconLabel, initWithSize:label:, initWithSize$label$);
1164 WBRename(SBIconLabel, setInDock:, setInDock$);
1166 WBRename(SBIconModel, cacheImageForIcon:, cacheImageForIcon$);
1167 WBRename(SBIconModel, getCachedImagedForIcon:, getCachedImagedForIcon$);
1169 WBRename(SBSlidingAlertDisplay, updateDesktopImage:, updateDesktopImage$);
1170 WBRename(SBStatusBarContentsView, didMoveToSuperview, didMoveToSuperview);
1171 WBRename(SBStatusBarContentsView, initWithStatusBar:mode:, initWithStatusBar$mode$);
1172 WBRename(SBStatusBarController, setStatusBarMode:orientation:duration:fenceID:animation:, setStatusBarMode$orientation$duration$fenceID$animation$);
1173 WBRename(SBStatusBarOperatorNameView, operatorNameStyle, operatorNameStyle);
1174 WBRename(SBStatusBarOperatorNameView, setOperatorName:fullSize:, setOperatorName$fullSize$);
1175 WBRename(SBStatusBarTimeView, drawRect:, drawRect$);
1177 English_ = [[NSDictionary alloc] initWithContentsOfFile:@"/System/Library/CoreServices/SpringBoard.app/English.lproj/LocalizedApplicationNames.strings"];
1178 if (English_ != nil)
1179 English_ = [English_ retain];
1181 Cache_ = [[NSMutableDictionary alloc] initWithCapacity:64];
1184 Wallpapers_ = [[NSArray arrayWithObjects:@"Wallpaper.mp4", @"Wallpaper.png", @"Wallpaper.jpg", @"Wallpaper.html", nil] retain];
1186 if ([Info_ objectForKey:@"UndockedIconLabels"] == nil)
1187 [Info_ setObject:[NSNumber numberWithBool:(
1188 $getTheme$(Wallpapers_) == nil ||
1189 [Info_ objectForKey:@"DockedIconLabelStyle"] != nil ||
1190 [Info_ objectForKey:@"UndockedIconLabelStyle"] != nil
1191 )] forKey:@"UndockedIconLabels"];
1194 NSLog(@"WB:Debug:Info = %@", [Info_ description]);