From e06a3b1a154e00752e2ffc73f38361e7389c7278 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Thu, 20 Sep 2012 01:09:28 -0700 Subject: Simulate Safe Mode inheritence using MobileSafety. --- MobileSafety.mm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/MobileSafety.mm b/MobileSafety.mm index caa12db..e4c23f9 100644 --- a/MobileSafety.mm +++ b/MobileSafety.mm @@ -51,6 +51,7 @@ MSClassHook(AAAccountManager) MSMetaClassHook(AAAccountManager) MSClassHook(BBSectionInfo) +MSClassHook(BKSApplicationLaunchSettings) MSClassHook(SBAlertItemsController) MSClassHook(SBButtonBar) @@ -282,3 +283,17 @@ MSInstanceMessageHook0(void, SBStatusBarTimeView, tile) { MSInstanceMessageHook0(BOOL, BBSectionInfo, showsInNotificationCenter) { return NO; } + + +// on iOS 6.0, Apple split parts of SpringBoard into a daemon called backboardd, including app launches +// in order to allow safe mode to propogate into applications, we need to then tell backboardd here +// XXX: (all of this should be replaced, however, with per-process launchd-mediated exception handling) + +MSInstanceMessageHook1(void, BKSApplicationLaunchSettings, setEnvironment, NSDictionary *, original) { + if (original == nil) + return MSOldCall(nil); + + NSMutableDictionary *modified([original mutableCopy]); + [modified setObject:@"1" forKey:@"_MSSafeMode"]; + return MSOldCall(modified); +} -- cgit v1.2.3