/* WinterBoard - Theme Manager for the iPhone
- * Copyright (C) 2008 Jay Freeman (saurik)
+ * Copyright (C) 2008-2010 Jay Freeman (saurik)
*/
/*
#import <CoreGraphics/CGGeometry.h>
+#import <ChatKit/CKMessageCell.h>
+
extern "C" void __clear_cache (char *beg, char *end);
@protocol WinterBoard
Class $UINavigationBar;
Class $UIToolbar;
+Class $CKMessageCell;
+Class $CKTimestampView;
Class $CKTranscriptController;
+Class $CKTranscriptTableView;
Class $SBApplication;
Class $SBApplicationIcon;
Class $SBUIController;
Class $SBWidgetApplicationIcon;
+static bool IsWild_;
+
@interface NSDictionary (WinterBoard)
- (UIColor *) wb$colorForKey:(NSString *)key;
- (BOOL) wb$boolForKey:(NSString *)key;
#define $GSFontGetUseLegacyFontMetrics() \
(_GSFontGetUseLegacyFontMetrics == NULL ? YES : _GSFontGetUseLegacyFontMetrics())
-bool Debug_ = false;
-bool Engineer_ = false;
+static bool Debug_ = false;
+static bool Engineer_ = false;
+static bool SummerBoard_ = true;
+static bool SpringBoard_;
static UIImage *(*_UIApplicationImageWithName)(NSString *name);
static UIImage *(*_UIImageAtPath)(NSString *name, NSBundle *path);
else if ([file isEqualToString:oldname]) \
[names addObject:[NSString stringWithFormat:@"%@.png", newname]]; \
+ bool summer(SpringBoard_ && SummerBoard_);
+
if (identifier == nil);
+ else if ([identifier isEqualToString:@"com.apple.chatkit"])
+ [names addObject:[NSString stringWithFormat:@"Bundles/com.apple.MobileSMS/%@", file]];
else if ([identifier isEqualToString:@"com.apple.calculator"])
[names addObject:[NSString stringWithFormat:@"Files/Applications/Calculator.app/%@", file]];
- else if (![identifier isEqualToString:@"com.apple.springboard"]);
+ else if (!summer);
remapResourceName(@"FSO_BG.png", @"StatusBar")
remapResourceName(@"SBDockBG.png", @"Dock")
remapResourceName(@"SBWeatherCelsius.png", @"Icons/Weather")
if (NSString *path = $getTheme$(names))
return path;
+
return nil;
}
NSMutableArray *names = [NSMutableArray arrayWithCapacity:8];
+ /* XXX: I might need to keep this for backwards compatibility
if (identifier != nil)
[names addObject:[NSString stringWithFormat:@"Bundles/%@/icon.png", identifier]];
if (folder != nil)
- [names addObject:[NSString stringWithFormat:@"Folders/%@/icon.png", folder]];
+ [names addObject:[NSString stringWithFormat:@"Folders/%@/icon.png", folder]]; */
#define testForIcon(Name) \
if (NSString *name = Name) \
[names addObject:[NSString stringWithFormat:@"Icons/%@.png", name]];
+ if (![didentifier isEqualToString:identifier])
+ testForIcon(didentifier);
+
testForIcon(identifier);
testForIcon(dname);
+ if ([identifier isEqualToString:@"com.apple.MobileSMS"])
+ testForIcon(@"SMS");
+
if (didentifier != nil) {
testForIcon([English_ objectForKey:didentifier]);
if (NSString *path = $getTheme$(names))
return path;
+
return nil;
}
void WBLogHierarchy(UIView *view, unsigned index = 0, unsigned indent = 0) {
CGRect frame([view frame]);
- NSLog(@"%*s|%2d:%s : {%f,%f+%f,%f} (%@)", indent * 3, "", index, class_getName([view class]), frame.origin.x, frame.origin.y, frame.size.width, frame.size.height, [view backgroundColor]);
+ NSLog(@"%*s|%2d:%p:%s : {%f,%f+%f,%f} (%@)", indent * 3, "", index, view, class_getName([view class]), frame.origin.x, frame.origin.y, frame.size.width, frame.size.height, [view backgroundColor]);
index = 0;
for (UIView *child in [view subviews])
WBLogHierarchy(child, index++, indent + 1);
return _SBApplicationIcon$icon(self, sel);
}
+MSHook(UIImage *, SBApplicationIcon$generateIconImage$, SBApplicationIcon *self, SEL sel, int type) {
+ if (type == 2)
+ if (![Info_ wb$boolForKey:@"ComposeStoreIcons"])
+ if (NSString *path = $pathForIcon$([self application]))
+ if (UIImage *image = [UIImage imageWithContentsOfFile:path])
+ return [image _imageScaledToProportion:1.2 interpolationQuality:5];
+ return _SBApplicationIcon$generateIconImage$(self, sel, type);
+}
+
MSHook(UIImage *, SBWidgetApplicationIcon$icon, SBWidgetApplicationIcon *self, SEL sel) {
if (Debug_)
NSLog(@"WB:Debug:Widget(%@:%@)", [self displayIdentifier], [self displayName]);
MSHook(CGImageRef, _UIImageRefAtPath, NSString *name, bool cache, UIImageOrientation *orientation) {
if (Debug_)
NSLog(@"WB:Debug: _UIImageRefAtPath(\"%@\", %s)", name, cache ? "true" : "false");
- return __UIImageRefAtPath([name wb$themedPath], cache, orientation);
+
+ NSString *themed([name wb$themedPath]);
+
+ if (false && SpringBoard_ && SummerBoard_ && themed == name) {
+ if ([name isEqualToString:@"/System/Library/CoreServices/SpringBoard.app/SBDockBGT-Portrait.png"])
+ if (NSString *path = $getTheme$([NSArray arrayWithObject:@"Dock.png"])) {
+ UIImage *image([UIImage imageWithContentsOfFile:path]);
+ CGImageRef ref([[image _imageScaledToProportion:2.4 interpolationQuality:5] imageRef]);
+ CGImageRetain(ref);
+ return ref;
+ }
+ }
+
+ return __UIImageRefAtPath(themed, cache, orientation);
}
/*MSHook(UIImage *, _UIImageAtPath, NSString *name, NSBundle *bundle) {
CFRelease(formatter);
- NSString *datestyle(@""
+ NSString *datestyle([@""
"font-family: Helvetica; "
"font-weight: bold; "
- "font-size: 39px; "
"color: #333333; "
"alpha: 1.0; "
- "");
+ "" stringByAppendingString:(IsWild_
+ ? @"font-size: 54px; "
+ : @"font-size: 39px; "
+ )]);
- NSString *daystyle(@""
+ NSString *daystyle([@""
"font-family: Helvetica; "
"font-weight: bold; "
- "font-size: 9px; "
"color: white; "
"text-shadow: rgba(0, 0, 0, 0.2) -1px -1px 2px; "
- "");
+ "" stringByAppendingString:(IsWild_
+ ? @"font-size: 11px; "
+ : @"font-size: 9px; "
+ )]);
if (NSString *style = [Info_ objectForKey:@"CalendarIconDateStyle"])
datestyle = [datestyle stringByAppendingString:style];
CGSize datesize = [(NSString *)date sizeWithStyle:datestyle forWidth:(width + leeway)];
CGSize daysize = [(NSString *)day sizeWithStyle:daystyle forWidth:(width + leeway)];
- unsigned base($GSFontGetUseLegacyFontMetrics() ? 71 : 70);
+ unsigned base(IsWild_ ? 89 : 70);
+ if ($GSFontGetUseLegacyFontMetrics())
+ base = base + 1;
[(NSString *)date drawAtPoint:CGPointMake(
(width + 1 - datesize.width) / 2, (base - datesize.height) / 2
) withStyle:datestyle];
[(NSString *)day drawAtPoint:CGPointMake(
- (width + 1 - daysize.width) / 2, (16 - daysize.height) / 2
+ (width + 1 - daysize.width) / 2, ((IsWild_ ? 18 : 16) - daysize.height) / 2
) withStyle:daystyle];
CFRelease(date);
}
static NSArray *Wallpapers_;
+static bool Papered_;
static NSString *WallpaperFile_;
static UIImageView *WallpaperImage_;
static UIWebDocumentView *WallpaperPage_;
if (self == nil)
return nil;
+ if (Papered_) {
+ UIWindow *&_wallpaperView(MSHookIvar<UIWindow *>(self, "_wallpaperView"));
+ if (&_wallpaperView != NULL) {
+ [_wallpaperView removeFromSuperview];
+ [_wallpaperView release];
+ _wallpaperView = nil;
+ }
+ }
+
UIWindow *&_window(MSHookIvar<UIWindow *>(self, "_window"));
UIView *&_contentLayer(MSHookIvar<UIView *>(self, "_contentLayer"));
UIView *&_contentView(MSHookIvar<UIView *>(self, "_contentView"));
layer = nil;
UIView *content([[[UIView alloc] initWithFrame:[layer frame]] autorelease]);
+
[content setBackgroundColor:[layer backgroundColor]];
[layer setBackgroundColor:[UIColor clearColor]];
[layer setFrame:[content bounds]];
[_window setContentView:content];
+ UIView *indirect;
+ if (!SummerBoard_ || !IsWild_)
+ indirect = content;
+ else {
+ CGRect bounds([content bounds]);
+ bounds.origin.y = -30;
+ indirect = [[[UIView alloc] initWithFrame:bounds] autorelease];
+ [content addSubview:indirect];
+ [indirect zoomToScale:2.4];
+ }
+
_release(WallpaperFile_);
_release(WallpaperImage_);
_release(WallpaperPage_);
AVQueue *queue([controller_ queue]);
- UIView *video([[[UIView alloc] initWithFrame:[content bounds]] autorelease]);
+ UIView *video([[[UIView alloc] initWithFrame:[indirect bounds]] autorelease]);
[controller_ setLayer:[video _layer]];
AVItem *item([[[AVItem alloc] initWithPath:mp4 error:&error] autorelease]);
[controller_ play:&error];
#elif UseMPMoviePlayerController
NSURL *url([NSURL fileURLWithPath:mp4]);
- MPMoviePlayerController *controller = [[MPMoviePlayerController alloc] initWithContentURL:url];
+ MPMoviePlayerController *controller = [[$MPMoviePlayerController alloc] initWithContentURL:url];
controller.movieControlMode = MPMovieControlModeHidden;
[controller play];
#else
- MPVideoView *video = [[[$MPVideoView alloc] initWithFrame:[content bounds]] autorelease];
+ MPVideoView *video = [[[$MPVideoView alloc] initWithFrame:[indirect bounds]] autorelease];
[video setMovieWithPath:mp4];
[video setRepeatMode:1];
[video setRepeatGap:-1];
[video playFromBeginning];;
#endif
- [content addSubview:video];
+ [indirect addSubview:video];
}
NSString *png = [theme stringByAppendingPathComponent:@"Wallpaper.png"];
WallpaperImage_ = [[UIImageView alloc] initWithImage:image];
if (NSNumber *number = [Info_ objectForKey:@"WallpaperAlpha"])
[WallpaperImage_ setAlpha:[number floatValue]];
- [content addSubview:WallpaperImage_];
+ [indirect addSubview:WallpaperImage_];
}
NSString *html = [theme stringByAppendingPathComponent:@"Wallpaper.html"];
if ([Manager_ fileExistsAtPath:html]) {
- CGRect bounds = [content bounds];
+ CGRect bounds = [indirect bounds];
UIWebDocumentView *view([[[UIWebDocumentView alloc] initWithFrame:bounds] autorelease]);
[view setAutoresizes:true];
[view setDrawsBackground:NO];
[[view webView] setDrawsBackground:NO];
- [content addSubview:view];
+ [indirect addSubview:view];
}
}
NSString *theme = [themes_ objectAtIndex:(e - i - 1)];
NSString *html = [theme stringByAppendingPathComponent:@"Widget.html"];
if ([Manager_ fileExistsAtPath:html]) {
- CGRect bounds = [content bounds];
+ CGRect bounds = [indirect bounds];
UIWebDocumentView *view([[[UIWebDocumentView alloc] initWithFrame:bounds] autorelease]);
[view setAutoresizes:true];
[view setDrawsBackground:NO];
[[view webView] setDrawsBackground:NO];
- [content addSubview:view];
+ [indirect addSubview:view];
}
}
[content addSubview:layer];
- WBLogHierarchy(_window);
return self;
}
}
- (id) initWithBadge:(NSString *)badge;
+- (NSString *) description;
@end
return self;
}
+- (NSString *) description {
+ return [badge_ description];
+}
+
WBDelegate(badge_)
- (CGSize) drawAtPoint:(CGPoint)point forWidth:(float)width withFont:(UIFont *)font lineBreakMode:(int)mode {
@interface UIView (WinterBoard)
- (bool) wb$isWBImageView;
+- (void) wb$logHierarchy;
@end
@implementation UIView (WinterBoard)
return false;
}
+- (void) wb$logHierarchy {
+ WBLogHierarchy(self);
+}
+
@end
@interface WBImageView : UIImageView {
NSString *style = [NSString stringWithFormat:@""
"font-family: Helvetica; "
"font-weight: bold; "
- "font-size: 11px; "
- "color: %@; "
- "", docked ? @"white" : @"#b3b3b3"];
-
- if (docked)
+ "color: %@; %@"
+ "", (docked || !SummerBoard_ ? @"white" : @"#b3b3b3"), (IsWild_
+ ? @"font-size: 12px; "
+ : @"font-size: 11px; "
+ )];
+
+ if (IsWild_)
+ style = [style stringByAppendingString:@"text-shadow: rgba(0, 0, 0, 0.5) 0px 1px 0px; "];
+ else if (docked)
style = [style stringByAppendingString:@"text-shadow: rgba(0, 0, 0, 0.5) 0px -1px 0px; "];
bool ellipsis(false);
[label drawAtPoint:CGPointMake((bounds.size.width - size.width) / 2, 0) withStyle:style];
}
+MSHook(void, CKMessageCell$addBalloonView$, id self, SEL sel, CKBalloonView *balloon) {
+ _CKMessageCell$addBalloonView$(self, sel, balloon);
+ [balloon setBackgroundColor:[UIColor clearColor]];
+}
+
+MSHook(id, CKMessageCell$initWithStyle$reuseIdentifier$, id self, SEL sel, int style, NSString *reuse) {
+ if ((self = _CKMessageCell$initWithStyle$reuseIdentifier$(self, sel, style, reuse)) != nil) {
+ [[self contentView] setBackgroundColor:[UIColor clearColor]];
+ } return self;
+}
+
+MSHook(id, CKTimestampView$initWithStyle$reuseIdentifier$, id self, SEL sel, int style, NSString *reuse) {
+ if ((self = _CKTimestampView$initWithStyle$reuseIdentifier$(self, sel, style, reuse)) != nil) {
+ UILabel *&_label(MSHookIvar<UILabel *>(self, "_label"));
+ [_label setBackgroundColor:[UIColor clearColor]];
+ } return self;
+}
+
+MSHook(void, CKTranscriptTableView$setSeparatorStyle$, id self, SEL sel, int style) {
+ _CKTranscriptTableView$setSeparatorStyle$(self, sel, UITableViewCellSeparatorStyleNone);
+}
+
+MSHook(id, CKTranscriptTableView$initWithFrame$style$, id self, SEL sel, CGRect frame, int style) {
+ _trace();
+ if ((self = _CKTranscriptTableView$initWithFrame$style$(self, sel, frame, style)) != nil) {
+ [self setSeparatorStyle:UITableViewCellSeparatorStyleNone];
+ } return self;
+}
+
MSHook(void, TranscriptController$loadView, mSMSMessageTranscriptController *self, SEL sel) {
_TranscriptController$loadView(self, sel);
[table setBackgroundColor:[UIColor clearColor]];
[placard insertSubview:background belowSubview:table];
}
-
- WBLogHierarchy(placard);
}
}
NSNumber *key([NSNumber numberWithInt:id]);
UIImage *image = [UIImages_ objectForKey:key];
if (image != nil)
- return reinterpret_cast<id>(image) == [NSNull null] ? nil : image;
+ return reinterpret_cast<id>(image) == [NSNull null] ? _UISharedImageWithIdentifier(id) : image;
if (NSString *path = $pathForFile$inBundle$(name, _UIKitBundle(), true)) {
image = [[UIImage alloc] initWithContentsOfFile:path cache:true];
if (image != nil)
[image autorelease];
}
- if (image == nil)
- image = _UISharedImageWithIdentifier(id);
[UIImages_ setObject:(image == nil ? [NSNull null] : reinterpret_cast<id>(image)) forKey:key];
- return image;
+ return image == nil ? _UISharedImageWithIdentifier(id) : image;
}
}
MSHook(UIImage *, _UIImageWithNameInDomain, NSString *name, NSString *domain) {
- NSString *key = [NSString stringWithFormat:@"D:%zu%@%@", [domain length], domain, name];
- UIImage *image = [PathImages_ objectForKey:key];
+ NSString *key([NSString stringWithFormat:@"D:%zu%@%@", [domain length], domain, name]);
+ UIImage *image([PathImages_ objectForKey:key]);
if (image != nil)
- return reinterpret_cast<id>(image) == [NSNull null] ? nil : image;
+ return reinterpret_cast<id>(image) == [NSNull null] ? __UIImageWithNameInDomain(name, domain) : image;
if (Debug_)
NSLog(@"WB:Debug: UIImageWithNameInDomain(\"%@\", \"%@\")", name, domain);
if (NSString *path = $getTheme$([NSArray arrayWithObject:[NSString stringWithFormat:@"Domains/%@/%@", domain, name]])) {
if (image != nil)
[image autorelease];
}
- if (image == nil)
- image = __UIImageWithNameInDomain(name, domain);
[PathImages_ setObject:(image == nil ? [NSNull null] : reinterpret_cast<id>(image)) forKey:key];
- return image;
+ return image == nil ? __UIImageWithNameInDomain(name, domain) : image;
}
MSHook(GSFontRef, GSFontCreateWithName, const char *name, GSFontSymbolicTraits traits, float size) {
NSLog(@"WB:Debug: GSFontCreateWithName(\"%s\", %f)", name, size);
if (NSString *font = [Info_ objectForKey:[NSString stringWithFormat:@"FontName-%s", name]])
name = [font UTF8String];
+ //if (NSString *scale = [Info_ objectForKey:[NSString stringWithFormat:@"FontScale-%s", name]])
+ // size *= [scale floatValue];
return _GSFontCreateWithName(name, traits, size);
}
}
extern "C" void WBInitialize() {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ NSAutoreleasePool *pool([[NSAutoreleasePool alloc] init]);
NSString *identifier([[NSBundle mainBundle] bundleIdentifier]);
_UIImage$defaultDesktopImage = MSHookMessage(object_getClass($UIImage), @selector(defaultDesktopImage), &$UIImage$defaultDesktopImage);
- //WBRename("UINavigationBar", @selector(initWithCoder:", (IMP) &UINavigationBar$initWithCoder$);
- //WBRename("UINavigationBarBackground", @selector(initWithFrame:withBarStyle:withTintColor:", (IMP) &UINavigationBarBackground$initWithFrame$withBarStyle$withTintColor$);
+ //WBRename("UINavigationBar", @selector(initWithCoder:), (IMP) &UINavigationBar$initWithCoder$);
+ //WBRename("UINavigationBarBackground", @selector(initWithFrame:withBarStyle:withTintColor:), (IMP) &UINavigationBarBackground$initWithFrame$withBarStyle$withTintColor$);
_UINavigationBar$setBarStyle$ = MSHookMessage($UINavigationBar, @selector(setBarStyle:), &$UINavigationBar$setBarStyle$);
_UIToolbar$setBarStyle$ = MSHookMessage($UIToolbar, @selector(setBarStyle:), &$UIToolbar$setBarStyle$);
themes_ = [[NSMutableArray alloc] initWithCapacity:8];
- if (NSDictionary *settings = [[NSDictionary alloc] initWithContentsOfFile:[NSString stringWithFormat:@"/User/Library/Preferences/com.saurik.WinterBoard.plist"]]) {
- [settings autorelease];
+ if (NSDictionary *settings = [NSDictionary dictionaryWithContentsOfFile:[NSString stringWithFormat:@"/User/Library/Preferences/com.saurik.WinterBoard.plist"]]) {
+ if (NSNumber *value = [settings objectForKey:@"SummerBoard"])
+ SummerBoard_ = [value boolValue];
+ if (NSNumber *value = [settings objectForKey:@"Debug"])
+ Debug_ = [value boolValue];
- if (NSNumber *debug = [settings objectForKey:@"Debug"])
- Debug_ = [debug boolValue];
-
- NSArray *themes = [settings objectForKey:@"Themes"];
+ NSArray *themes([settings objectForKey:@"Themes"]);
if (themes == nil)
if (NSString *theme = [settings objectForKey:@"Theme"])
themes = [NSArray arrayWithObject:[NSDictionary dictionaryWithObjectsAndKeys:
theme, @"Name",
[NSNumber numberWithBool:true], @"Active",
nil]];
+
if (themes != nil)
for (NSDictionary *theme in themes) {
- NSNumber *active = [theme objectForKey:@"Active"];
+ NSNumber *active([theme objectForKey:@"Active"]);
if (![active boolValue])
continue;
- NSString *name = [theme objectForKey:@"Name"];
+ NSString *name([theme objectForKey:@"Name"]);
if (name == nil)
continue;
- NSString *theme = nil;
+ NSString *theme(nil);
#define testForTheme(format...) \
if (theme == nil) { \
testForTheme(@"/Library/Themes/%@.theme", name)
testForTheme(@"/Library/Themes/%@", name)
testForTheme(@"%@/Library/SummerBoard/Themes/%@", NSHomeDirectory(), name)
+
}
}
Info_ = [[NSMutableDictionary dictionaryWithCapacity:16] retain];
for (NSString *theme in themes_)
- if (NSDictionary *info = [[NSDictionary alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/Info.plist", theme]]) {
- [info autorelease];
+ if (NSDictionary *info = [NSDictionary dictionaryWithContentsOfFile:[NSString stringWithFormat:@"%@/Info.plist", theme]])
for (NSString *key in [info allKeys])
if ([Info_ objectForKey:key] == nil)
[Info_ setObject:[info objectForKey:key] forKey:key];
- }
- $CKTranscriptController = objc_getClass("CKTranscriptController");
- _TranscriptController$loadView = MSHookMessage($CKTranscriptController, @selector(loadView), &$TranscriptController$loadView);
+ bool sms($getTheme$([NSArray arrayWithObjects:@"SMSBackground.png", @"SMSBackground.jpg", nil]) != nil);
+
+ SpringBoard_ = [identifier isEqualToString:@"com.apple.springboard"];
+
+ if ([NSBundle bundleWithIdentifier:@"com.apple.chatkit"])
+ if (sms) {
+ $CKMessageCell = objc_getClass("CKMessageCell");
+ _CKMessageCell$addBalloonView$ = MSHookMessage($CKMessageCell, @selector(addBalloonView:), &$CKMessageCell$addBalloonView$);
+ _CKMessageCell$initWithStyle$reuseIdentifier$ = MSHookMessage($CKMessageCell, @selector(initWithStyle:reuseIdentifier:), &$CKMessageCell$initWithStyle$reuseIdentifier$);
+
+ $CKTranscriptTableView = objc_getClass("CKTranscriptTableView");
+ _CKTranscriptTableView$setSeparatorStyle$ = MSHookMessage($CKTranscriptTableView, @selector(setSeparatorStyle:), &$CKTranscriptTableView$setSeparatorStyle$);
+ _CKTranscriptTableView$initWithFrame$style$ = MSHookMessage($CKTranscriptTableView, @selector(initWithFrame:style:), &$CKTranscriptTableView$initWithFrame$style$);
+
+ $CKTimestampView = objc_getClass("CKTimestampView");
+ _CKTimestampView$initWithStyle$reuseIdentifier$ = MSHookMessage($CKTimestampView, @selector(initWithStyle:reuseIdentifier:), &$CKTimestampView$initWithStyle$reuseIdentifier$);
+
+ $CKTranscriptController = objc_getClass("CKTranscriptController");
+ _TranscriptController$loadView = MSHookMessage($CKTranscriptController, @selector(loadView), &$TranscriptController$loadView);
+ }
if ([identifier isEqualToString:@"com.apple.MobileSMS"]) {
- if (_TranscriptController$loadView == NULL) {
- Class mSMSMessageTranscriptController = objc_getClass("mSMSMessageTranscriptController");
- _TranscriptController$loadView = MSHookMessage(mSMSMessageTranscriptController, @selector(loadView), &$TranscriptController$loadView);
+ if (sms) {
+ if (_TranscriptController$loadView == NULL) {
+ Class mSMSMessageTranscriptController = objc_getClass("mSMSMessageTranscriptController");
+ _TranscriptController$loadView = MSHookMessage(mSMSMessageTranscriptController, @selector(loadView), &$TranscriptController$loadView);
+ }
}
- } else if ([identifier isEqualToString:@"com.apple.springboard"]) {
+ } else if (SpringBoard_) {
CFNotificationCenterAddObserver(
CFNotificationCenterGetDarwinNotifyCenter(),
NULL, &ChangeWallpaper, (CFStringRef) @"com.saurik.winterboard.lockbackground", NULL, 0
);
- NSBundle *MediaPlayer = [NSBundle bundleWithPath:@"/System/Library/Frameworks/MediaPlayer.framework"];
- if (MediaPlayer != nil)
- [MediaPlayer load];
+ if ($getTheme$([NSArray arrayWithObject:@"Wallpaper.mp4"]) != nil) {
+ NSBundle *MediaPlayer([NSBundle bundleWithPath:@"/System/Library/Frameworks/MediaPlayer.framework"]);
+ if (MediaPlayer != nil)
+ [MediaPlayer load];
+
+ $MPMoviePlayerController = objc_getClass("MPMoviePlayerController");
+ $MPVideoView = objc_getClass("MPVideoView");
+ }
- $MPMoviePlayerController = objc_getClass("MPMoviePlayerController");
- $MPVideoView = objc_getClass("MPVideoView");
$WebCoreFrameBridge = objc_getClass("WebCoreFrameBridge");
$SBApplication = objc_getClass("SBApplication");
WBRename(WebCoreFrameBridge, renderedSizeOfNode:constrainedToWidth:, renderedSizeOfNode$constrainedToWidth$);
- WBRename(SBApplication, pathForIcon, pathForIcon);
- WBRename(SBApplicationIcon, icon, icon);
+ if (SummerBoard_) {
+ WBRename(SBApplication, pathForIcon, pathForIcon);
+ WBRename(SBApplicationIcon, icon, icon);
+ WBRename(SBApplicationIcon, generateIconImage:, generateIconImage$);
+ }
+
WBRename(SBBookmarkIcon, icon, icon);
WBRename(SBButtonBar, didMoveToSuperview, didMoveToSuperview);
WBRename(SBCalendarIconContentsView, drawRect:, drawRect$);
WBRename(SBStatusBarOperatorNameView, setOperatorName:fullSize:, setOperatorName$fullSize$);
WBRename(SBStatusBarTimeView, drawRect:, drawRect$);
- English_ = [[NSDictionary alloc] initWithContentsOfFile:@"/System/Library/CoreServices/SpringBoard.app/English.lproj/LocalizedApplicationNames.strings"];
+ if (SummerBoard_)
+ English_ = [[NSDictionary alloc] initWithContentsOfFile:@"/System/Library/CoreServices/SpringBoard.app/English.lproj/LocalizedApplicationNames.strings"];
+
Cache_ = [[NSMutableDictionary alloc] initWithCapacity:64];
}
Wallpapers_ = [[NSArray arrayWithObjects:@"Wallpaper.mp4", @"Wallpaper.png", @"Wallpaper.jpg", @"Wallpaper.html", nil] retain];
+ Papered_ = $getTheme$(Wallpapers_) != nil;
+
+ UIDevice *device([UIDevice currentDevice]);
+ IsWild_ = [device respondsToSelector:@selector(isWildcat)] && [device isWildcat];
if ([Info_ objectForKey:@"UndockedIconLabels"] == nil)
[Info_ setObject:[NSNumber numberWithBool:(
- $getTheme$(Wallpapers_) == nil ||
+ Papered_ ||
[Info_ objectForKey:@"DockedIconLabelStyle"] != nil ||
[Info_ objectForKey:@"UndockedIconLabelStyle"] != nil
)] forKey:@"UndockedIconLabels"];