]> git.saurik.com Git - uikittools.git/blobdiff - uicache.mm
Sometimes, the capabilities aren't ready yet.
[uikittools.git] / uicache.mm
index 904b1752b55c6654799df2fa898e63b7d483d770..8e690092512c437e17634e247946c8debbba801a 100644 (file)
@@ -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]);
@@ -75,13 +76,26 @@ int main() {
         [cache writeToFile:path atomically:YES];
 
         if (workspace != nil)
-            for (NSString *bundle in bundles)
+            for (NSString *bundle in bundles) {
+                [workspace unregisterApplication:[NSURL fileURLWithPath:bundle]];
                 [workspace registerApplication:[NSURL fileURLWithPath:bundle]];
+            }
 
         if (false) error:
             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]);
+
+    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/com.apple.IconsCache", home] UTF8String]);
+
     notify_post("com.apple.mobile.application_installed");
 
     [pool release];