diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2012-09-20 01:09:28 -0700 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2012-09-20 01:09:28 -0700 |
commit | e06a3b1a154e00752e2ffc73f38361e7389c7278 (patch) | |
tree | eaeddb24095087287a3480a59ad193cd253985a3 | |
parent | 30a4ee1aad656702f6c18612df82bfcb42a9ee71 (diff) |
Simulate Safe Mode inheritence using MobileSafety.
-rw-r--r-- | MobileSafety.mm | 15 |
1 files changed, 15 insertions, 0 deletions
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); +} |