diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2010-12-03 09:47:12 +0000 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2010-12-03 09:47:12 +0000 |
commit | a7cec9cfeb283f276f4e9b427a3187e9f94f9779 (patch) | |
tree | f74a0c8c7f16383891bf75b1dc77e55d32a58060 /uicache.mm | |
parent | 04ee9f372e9a9d91accf5ffedf6bafebfd9cdadd (diff) |
We need to kill installd in order for uicache to work.v1.0.3231
Diffstat (limited to 'uicache.mm')
-rw-r--r-- | uicache.mm | 27 |
1 files changed, 18 insertions, 9 deletions
@@ -34,9 +34,11 @@ @end -int main() { +int main(int argc, const char *argv[]) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + bool respring(false); + NSString *home(NSHomeDirectory()); NSString *path([NSString stringWithFormat:@"%@/Library/Caches/com.apple.mobile.installation.plist", home]); @@ -85,18 +87,25 @@ 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", home] UTF8String]); - unlink([[NSString stringWithFormat:@"%@/Library/Caches/com.apple.springboard-imagecache-icons.plist", home] UTF8String]); + if (respring || kCFCoreFoundationVersionNumber >= 550.32) { + unlink([[NSString stringWithFormat:@"%@/Library/Caches/com.apple.springboard-imagecache-icons", home] UTF8String]); + unlink([[NSString stringWithFormat:@"%@/Library/Caches/com.apple.springboard-imagecache-icons.plist", home] UTF8String]); + + unlink([[NSString stringWithFormat:@"%@/Library/Caches/com.apple.springboard-imagecache-smallicons", home] UTF8String]); + unlink([[NSString stringWithFormat:@"%@/Library/Caches/com.apple.springboard-imagecache-smallicons.plist", home] UTF8String]); - unlink([[NSString stringWithFormat:@"%@/Library/Caches/com.apple.springboard-imagecache-smallicons", home] UTF8String]); - unlink([[NSString stringWithFormat:@"%@/Library/Caches/com.apple.springboard-imagecache-smallicons.plist", home] UTF8String]); + system([[NSString stringWithFormat:@"rm -rf %@/Library/Caches/SpringBoardIconCache", home] UTF8String]); + system([[NSString stringWithFormat:@"rm -rf %@/Library/Caches/SpringBoardIconCache-small", home] UTF8String]); - system([[NSString stringWithFormat:@"rm -rf %@/Library/Caches/SpringBoardIconCache", home] UTF8String]); - system([[NSString stringWithFormat:@"rm -rf %@/Library/Caches/SpringBoardIconCache-small", home] UTF8String]); + system([[NSString stringWithFormat:@"rm -rf %@/Library/Caches/com.apple.IconsCache", home] UTF8String]); + } - system([[NSString stringWithFormat:@"rm -rf %@/Library/Caches/com.apple.IconsCache", home] UTF8String]); + system("killall installd"); - notify_post("com.apple.mobile.application_installed"); + if (respring) + system("launchctl stop com.apple.SpringBoard"); + else + notify_post("com.apple.mobile.application_installed"); [pool release]; |