From 5530e23458e832a9840ce6f0182f1ebdb7c9021b Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Wed, 5 Nov 2014 03:20:57 -0800 Subject: Restart SpringBoard in the case that we MoveStash. --- postinst.mm | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'postinst.mm') diff --git a/postinst.mm b/postinst.mm index e5658d2..b380d64 100644 --- a/postinst.mm +++ b/postinst.mm @@ -79,11 +79,6 @@ static bool FixProtections() { } } - if (!MoveStash()) { - fprintf(stderr, "failed to move stash\n"); - return false; - } - return true; } @@ -188,9 +183,18 @@ int main(int argc, const char *argv[]) { NSAutoreleasePool *pool([[NSAutoreleasePool alloc] init]); - if (kCFCoreFoundationVersionNumber >= 1000) + bool restart(false); + + if (kCFCoreFoundationVersionNumber >= 1000) { if (!FixProtections()) return 1; + if (MoveStash()) + restart = true; + else { + fprintf(stderr, "failed to move stash\n"); + return 1; + } + } size_t size; sysctlbyname("kern.osversion", NULL, &size, NULL, 0); @@ -249,7 +253,9 @@ int main(int argc, const char *argv[]) { FixPermissions(); - if (FixApplications()) + restart |= FixApplications(); + + if (restart) Finish("restart"); [pool release]; -- cgit v1.2.3