summaryrefslogtreecommitdiff
path: root/MobileCydia.mm
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2015-07-11 22:20:17 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2015-07-11 22:23:00 -0700
commitd0a5ea5685a2c5e2f98b76fd771095ecf048a66f (patch)
tree53e286e368951be79d0276e202797f4f10709832 /MobileCydia.mm
parent375a4481b21835983ea4f32bd1847a46c1038c68 (diff)
Provide a way to get the icons for installed apps.
Diffstat (limited to 'MobileCydia.mm')
-rw-r--r--MobileCydia.mm14
1 files changed, 13 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];