summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MobileCydia.mm15
1 files changed, 14 insertions, 1 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index 290cf49..15a4f81 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -709,6 +709,7 @@ static const NSString *UI_;
static int Finish_;
static bool RestartSubstrate_;
+static bool UpgradeCydia_;
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];
+ UpgradeCydia_ = false;
+
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];
}
+ if ([name isEqualToString:@"cydia"])
+ UpgradeCydia_ = true;
+
substrate_ |= DepSubstrate(policy->GetCandidateVer(iterator));
substrate_ |= DepSubstrate(iterator.CurrentVer());
}
@@ -9362,7 +9368,14 @@ _end
- (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();
}