Skip to content

Instantly share code, notes, and snippets.

@jontelang
Created May 1, 2013 13:14
Show Gist options
  • Save jontelang/5495225 to your computer and use it in GitHub Desktop.
Save jontelang/5495225 to your computer and use it in GitHub Desktop.
asdasd'
%hook SBUIController
@interface SBIconController : NSObject
+(id)sharedInstance;
@end
@interface SBIconListView : UIView
@end
@interface SBIconListModel : NSObject
-(id)icons;
@end
@interface SBApplicationIcon
-(id)displayName;
-(void)setBadge:(id)arg;
@end
+(id)sharedInstance{
id s = %orig;
//NSLog(@" - - x x x x x x x x x x xx x x x x x x x x x x x x x x x x x x x x x accessing sharedInstance");
SBIconController *sbic = [objc_getClass("SBIconController") sharedInstance];
//NSLog(@"sbic: %@", sbic);
NSMutableArray *arr = MSHookIvar<NSMutableArray *>(sbic, "_rootIconLists");
//NSLog(@"arr: %@", arr);
if( [arr count] > 0 )
{
SBIconListView *ilv = [arr objectAtIndex:0];
//NSLog(@"ivl: %@", ilv);
SBIconListModel *model = MSHookIvar<SBIconListModel *>(ilv, "_model");
//NSLog(@"model: %@", model);
NSLog(@"model -icons: %@", [model icons]);
NSLog(@"%@",[[model icons] objectAtIndex:0]);
for(SBApplicationIcon *icon in [model icons])
{
//NSLog(@"")
//NSLog(@"icon: %@", [icon displayName]);
if( [[icon displayName] isEqual:@"Clock"] )
{
[icon setBadge:@"342"];
}
}
}
return s;
}
%end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment