]> git.saurik.com Git - uikittools.git/commitdiff
We need to kill installd in order for uicache to work. v1.0.3231
authorJay Freeman (saurik) <saurik@saurik.com>
Fri, 3 Dec 2010 09:47:12 +0000 (09:47 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Fri, 3 Dec 2010 09:47:12 +0000 (09:47 +0000)
control
uicache.mm

diff --git a/control b/control
index 5f7c6b5c0d9969560902bda84bd94390fa315ff8..4c0ecf89bd965130a0f0eadb005651c96b00b300 100644 (file)
--- a/control
+++ b/control
@@ -4,7 +4,7 @@ Section: Utilities
 Installed-Size: %S
 Maintainer: Jay Freeman (saurik) <saurik@saurik.com>
 Architecture: iphoneos-arm
-Version: 1.0.3227-1
+Version: 1.0.3231-1
 Description: UIKit/GraphicsServices command line access
 Name: UIKit Tools
 Author: Jay Freeman (saurik) <saurik@saurik.com>
index 8e690092512c437e17634e247946c8debbba801a..839770319c2a92d9e1c5439d47ea07ec7d01c27f 100644 (file)
 
 @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];