]> git.saurik.com Git - cydia.git/commitdiff
SpringBoard kills apps that are being reinstalled. v1.1.14
authorJay Freeman (saurik) <saurik@saurik.com>
Thu, 30 Oct 2014 14:47:11 +0000 (07:47 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Thu, 30 Oct 2014 14:47:11 +0000 (07:47 -0700)
MobileCydia.mm

index 290cf49c0e688cd0bb4ed2022a77f9014e44be21..15a4f8154552d99f58ff71d12c1c660ebf8ee956 100644 (file)
@@ -709,6 +709,7 @@ static const NSString *UI_;
 
 static int Finish_;
 static bool RestartSubstrate_;
 
 static int Finish_;
 static bool RestartSubstrate_;
+static bool UpgradeCydia_;
 static NSArray *Finishes_;
 
 #define SpringBoard_ "/System/Library/LaunchDaemons/com.apple.SpringBoard.plist"
 static NSArray *Finishes_;
 
 #define SpringBoard_ "/System/Library/LaunchDaemons/com.apple.SpringBoard.plist"
@@ -5167,6 +5168,8 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
 
         issues_ = [NSMutableArray arrayWithCapacity:4];
 
 
         issues_ = [NSMutableArray arrayWithCapacity:4];
 
+        UpgradeCydia_ = false;
+
         for (Package *package in packages) {
             pkgCache::PkgIterator iterator([package iterator]);
             NSString *name([package id]);
         for (Package *package in packages) {
             pkgCache::PkgIterator iterator([package iterator]);
             NSString *name([package id]);
@@ -5278,6 +5281,9 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
                 [removes addObject:name];
             }
 
                 [removes addObject:name];
             }
 
+            if ([name isEqualToString:@"cydia"])
+                UpgradeCydia_ = true;
+
             substrate_ |= DepSubstrate(policy->GetCandidateVer(iterator));
             substrate_ |= DepSubstrate(iterator.CurrentVer());
         }
             substrate_ |= DepSubstrate(policy->GetCandidateVer(iterator));
             substrate_ |= DepSubstrate(iterator.CurrentVer());
         }
@@ -9362,7 +9368,14 @@ _end
 
 - (void) _uicache {
     _trace();
 
 - (void) _uicache {
     _trace();
-    system("/usr/bin/uicache");
+
+    if (UpgradeCydia_ && Finish_ > 0) {
+        setreugid(0, 0);
+        system("su -c /usr/bin/uicache mobile");
+    } else {
+        system("/usr/bin/uicache");
+    }
+
     _trace();
 }
 
     _trace();
 }