diff options
-rw-r--r-- | MobileCydia.mm | 14 | ||||
-rw-r--r-- | iPhonePrivate.h | 1 |
2 files changed, 14 insertions, 1 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm index fc3598b..b039213 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -7177,7 +7177,19 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi Database *database([Database sharedInstance]); - if ([command isEqualToString:@"package-icon"]) { + if (false); + else if ([command isEqualToString:@"application-icon"]) { + if (path == nil) + goto fail; + path = [path stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; + NSData *data([SBSCopyIconImagePNGDataForDisplayIdentifier(path) autorelease]); + UIImage *icon; + if (data == nil) + icon = [UIImage imageNamed:@"unknown.png"]; + else + icon = [UIImage imageWithData:data]; + [self _returnPNGWithImage:icon forRequest:request]; + } else if ([command isEqualToString:@"package-icon"]) { if (path == nil) goto fail; path = [path stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; diff --git a/iPhonePrivate.h b/iPhonePrivate.h index 2c9239c..70eef38 100644 --- a/iPhonePrivate.h +++ b/iPhonePrivate.h @@ -440,6 +440,7 @@ extern "C" mach_port_t SBSSpringBoardServerPort(); extern "C" int SBBundlePathForDisplayIdentifier(mach_port_t port, const char *identifier, char *path); extern "C" NSSet *SBSCopyDisplayIdentifiers(); extern "C" NSString *SBSCopyLocalizedApplicationNameForDisplayIdentifier(NSString *); +extern "C" NSData *SBSCopyIconImagePNGDataForDisplayIdentifier(NSString *); extern "C" UIImage *_UIImageWithName(NSString *name); extern "C" void UISetColor(CGColorRef color); // }}} |