diff --git a/carplayenableprefs/CPAppListController.m b/carplayenableprefs/CPAppListController.m index cfde3f0..b38a84c 100644 --- a/carplayenableprefs/CPAppListController.m +++ b/carplayenableprefs/CPAppListController.m @@ -99,9 +99,11 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N NSDictionary *currentApp = _appList[indexPath.row]; NSString *appName = currentApp[@"name"]; NSString *appIdentifier = currentApp[@"bundleID"]; + UIImage *appIcon = [UIImage imageWithData:currentApp[@"iconImage"]]; // Setup the cell [[cell textLabel] setText:appName]; + [[cell imageView] setImage:appIcon]; if ([self isAppCarplayEnabled:appIdentifier]) { [cell setAccessoryType:UITableViewCellAccessoryCheckmark]; diff --git a/src/hooks/SpringBoard.xm b/src/hooks/SpringBoard.xm index e882bbb..1fbd089 100644 --- a/src/hooks/SpringBoard.xm +++ b/src/hooks/SpringBoard.xm @@ -112,9 +112,14 @@ Invoked when SpringBoard finishes launching continue; } + // Grab icon data + UIImage *appIconImage = objcInvoke_3(objc_getClass("UIImage"), @"_applicationIconImageForBundleIdentifier:format:scale:", identifier, 0, [UIScreen mainScreen].scale); + NSData *iconImageData = UIImagePNGRepresentation(appIconImage); + NSDictionary *appInfoDict = @{ @"name": objcInvoke(appInfo, @"displayName"), - @"bundleID": identifier + @"bundleID": identifier, + @"iconImage": iconImageData }; [appList addObject:appInfoDict];