Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @interface SBApplicationIcon - (id)applicationBundleID; @end
- %hook SBApplicationIcon
- - (id)generateIconImage:(int)fp8 {
- NSLog(@"%@",[NSString stringWithFormat:@"/Library/Themes/Lotus Apps.theme/IconBundles/%@@2x.png",[self applicationBundleID]]);
- if([[NSFileManager defaultManager] fileExistsAtPath:[NSString stringWithFormat:@"/Library/Themes/Lotus Apps.theme/IconBundles/%@@2x.png",[self applicationBundleID]]
- isDirectory:nil]) {
- // Round the image and make it the correct size
- UIImage *image = [UIImage imageWithContentsOfFile:[NSString stringWithFormat:@"/Library/Themes/Lotus Apps.theme/IconBundles/%@@2x.png",[self applicationBundleID]]];
- CALayer *imageLayer = [CALayer layer];
- imageLayer.frame = CGRectMake(0,0,image.size.width - 3,image.size.height - 3);
- imageLayer.contents = (id)image.CGImage;
- imageLayer.masksToBounds = YES;
- imageLayer.cornerRadius = 12;
- UIGraphicsBeginImageContextWithOptions(image.size, NO, [UIScreen mainScreen].scale);
- [imageLayer renderInContext:UIGraphicsGetCurrentContext()];
- UIImage *roundedImage = UIGraphicsGetImageFromCurrentImageContext();
- UIGraphicsEndImageContext();
- return roundedImage;
- } else return %orig;
- }
- %end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement