From 7e0ec87a1c6cc62738348fe93656b5a4d81633a3 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Fri, 30 Jul 2010 10:06:49 +0000 Subject: [PATCH] Delete the icon caches. --- control | 2 +- uicache.mm | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/control b/control index bc6448d..029866b 100644 --- a/control +++ b/control @@ -4,7 +4,7 @@ Section: Utilities Installed-Size: %S Maintainer: Jay Freeman (saurik) Architecture: iphoneos-arm -Version: 1.0.3198-1 +Version: 1.0.3201-1 Description: UIKit/GraphicsServices command line access Name: UIKit Tools Author: Jay Freeman (saurik) diff --git a/uicache.mm b/uicache.mm index 4b477c6..cf88535 100644 --- a/uicache.mm +++ b/uicache.mm @@ -37,7 +37,8 @@ int main() { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - NSString *path([NSString stringWithFormat:@"%@/Library/Caches/com.apple.mobile.installation.plist", NSHomeDirectory()]); + NSString *home(NSHomeDirectory()); + NSString *path([NSString stringWithFormat:@"%@/Library/Caches/com.apple.mobile.installation.plist", home]); Class $LSApplicationWorkspace(objc_getClass("LSApplicationWorkspace")); LSApplicationWorkspace *workspace($LSApplicationWorkspace == nil ? nil : [$LSApplicationWorkspace defaultWorkspace]); @@ -84,6 +85,17 @@ int main() { fprintf(stderr, "%s\n", error == nil ? strerror(errno) : [[error localizedDescription] UTF8String]); } else fprintf(stderr, "cannot open cache file. incorrect user?\n"); + unlink([[NSString stringWithFormat:@"%@/Library/Caches/com.apple.springboard-imagecache-icons"] UTF8String]); + unlink([[NSString stringWithFormat:@"%@/Library/Caches/com.apple.springboard-imagecache-icons.plist"] UTF8String]); + + unlink([[NSString stringWithFormat:@"%@/Library/Caches/com.apple.springboard-imagecache-smallicons"] UTF8String]); + unlink([[NSString stringWithFormat:@"%@/Library/Caches/com.apple.springboard-imagecache-smallicons.plist"] UTF8String]); + + system([[NSString stringWithFormat:@"rm -rf %@/Library/Caches/SpringBoardIconCache"] UTF8String]); + system([[NSString stringWithFormat:@"rm -rf %@/Library/Caches/SpringBoardIconCache-small"] UTF8String]); + + system([[NSString stringWithFormat:@"rm -rf %@/Library/Caches/com.apple.IconsCache"] UTF8String]); + notify_post("com.apple.mobile.application_installed"); [pool release]; -- 2.45.2