]> git.saurik.com Git - safemode-ios.git/commitdiff
Simulate Safe Mode inheritence using MobileSafety. v0.9.3999
authorJay Freeman (saurik) <saurik@saurik.com>
Thu, 20 Sep 2012 08:09:28 +0000 (01:09 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Thu, 20 Sep 2012 08:09:28 +0000 (01:09 -0700)
MobileSafety.mm

index caa12db6c6d1f4e65d35382280d7e3641bd7fc8d..e4c23f975d5da46a0abcbd2a6ef3b92e272c5640 100644 (file)
@@ -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);
+}