X-Git-Url: https://git.saurik.com/cydia.git/blobdiff_plain/ad502f71d5cd68490d27171c98c0377a2a4ab6fc..604d019c1f550061ca0ebbc193186619e3d5c5da:/MobileCydia.mm diff --git a/MobileCydia.mm b/MobileCydia.mm index 86a36ff5..83783e36 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -247,11 +247,13 @@ struct Root { root_ = true; _trace(); _assert(setreuid(real ? 0 : 501, 0) != -1); + _assert(setregid(real ? 0 : 501, 0) != -1); } ~Root() { root_ = false; _trace(); + _assert(setregid(501, 501) != -1); _assert(setreuid(501, 501) != -1); } @@ -9059,7 +9061,7 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi } } - CydiaWriteSources(); + _root(true) CydiaWriteSources(); } // Navigation controller for the queuing badge. @@ -9509,6 +9511,21 @@ _end return true; } +- (void) suspendReturningToLastApp:(BOOL)returning { + if ([self isSafeToSuspend]) + [super suspendReturningToLastApp:returning]; +} + +- (void) suspend { + if ([self isSafeToSuspend]) + [super suspend]; +} + +- (void) applicationSuspend { + if ([self isSafeToSuspend]) + [super applicationSuspend]; +} + - (void) applicationSuspend:(__GSEvent *)event { if ([self isSafeToSuspend]) [super applicationSuspend:event]; @@ -10402,7 +10419,7 @@ int main(int argc, char *argv[]) { } broken = nil; /* }}} */ - CydiaWriteSources(); + _root(true) CydiaWriteSources(); _trace(); _root(true) MetaFile_.Open("/var/lib/cydia/metadata.cb0");