From 815725202a0a583111c3f34b14a0885df070d31f Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Wed, 2 Nov 2011 11:29:02 +0000 Subject: [PATCH] Support IconSupport and iOS 5.0. --- Tweak.mm | 26 ++++++++++++++++++++++++++ control | 4 ++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/Tweak.mm b/Tweak.mm index 9f492cb..0f83a4c 100644 --- a/Tweak.mm +++ b/Tweak.mm @@ -1,13 +1,23 @@ #include #import +#import #import + #import #import #import #import +@interface ISIconSupport : NSObject { +} + ++ (ISIconSupport *) sharedInstance; +- (void) addExtension:(NSString *)name; + +@end + @interface SBDockIconListView : NSObject { } - (NSArray *) icons; @@ -21,6 +31,12 @@ MSClassHook(SBIconModel) MSMetaClassHook(SBDockIconListView) MSMetaClassHook(SBIconModel) +__attribute__((__constructor__)) +static void MSFixClass() { + if ($SBIcon == nil) + $SBIcon = objc_getClass("SBIconView"); +} + MSInstanceMessageHook1(float, SBButtonBar, leftMarginForIconRowArray, NSArray *, row) { return [row indexOfObject:[NSNull null]] == NSNotFound ? 4 : MSOldCall(row); } @@ -105,3 +121,13 @@ MSInstanceMessageHook2(CGPoint, SBDockIconListView, originForIconAtX,Y, int, x, /*MSClassMessageHook0(int, SBIconModel, maxIconListCount) { return 16; }*/ + +MSInitialize { + NSAutoreleasePool *pool([[NSAutoreleasePool alloc] init]); + + if (dlopen("/Library/MobileSubstrate/DynamicLibraries/IconSupport.dylib", RTLD_GLOBAL | RTLD_LAZY) != NULL) + if (Class $ISIconSupport = objc_getClass("ISIconSupport")) + [[$ISIconSupport sharedInstance] addExtension:@"com.saurik.iphone.fid"]; + + [pool release]; +} diff --git a/control b/control index 3b6540a..1b19917 100644 --- a/control +++ b/control @@ -3,10 +3,10 @@ Priority: optional Section: Tweaks Maintainer: Jay Freeman (saurik) Architecture: iphoneos-arm -Version: 0.9.3202-1 +Version: 0.9.3381-1 Description: fits even more stuff right down there Name: Five Icon Dock -Depends: mobilesubstrate (>= 0.9.3005-1), firmware (>= 2.2) +Depends: mobilesubstrate (>= 0.9.3005-1), firmware (>= 2.2), firmware (<< 3.0) | com.chpwn.iconsupport (>= 1.7.3-1) Conflicts: gsc.wildcat Author: Jay Freeman (saurik) Depiction: http://cydia.saurik.com/info/com.saurik.iphone.fid/ -- 2.45.2