summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-08-30 02:04:02 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2011-10-12 15:14:24 -0700
commitf7673201a860fde2a2fe6ee230dee94c9c4f3660 (patch)
tree04e4785defefe32fb622e924c343cf3f2721be55
parent22a7ee91ef4d3bdc443789c90c10126529aa52d0 (diff)
Fix the silly info popup on iOS 4.3 Safe Mode.
-rw-r--r--MobileSafety.mm29
1 files changed, 17 insertions, 12 deletions
diff --git a/MobileSafety.mm b/MobileSafety.mm
index d62cab4..a1d93cc 100644
--- a/MobileSafety.mm
+++ b/MobileSafety.mm
@@ -31,8 +31,12 @@ MSClassHook(UIStatusBar)
MSClassHook(UIImage)
MSMetaClassHook(UIImage)
+MSClassHook(AAAccountManager)
+MSMetaClassHook(AAAccountManager)
+
MSClassHook(SBAlertItemsController)
MSClassHook(SBButtonBar)
+MSClassHook(SBIconController)
MSClassHook(SBStatusBar)
MSClassHook(SBStatusBarDataManager)
MSClassHook(SBStatusBarTimeView)
@@ -156,14 +160,23 @@ MSInstanceMessageHook0(void, SBStatusBarDataManager, _updateTimeString) {
strcpy(timeString, "Exit Safe Mode");
}
-static void SBIconController$showInfoAlertIfNeeded(id self, SEL sel) {
- static bool loaded = false;
- if (loaded)
+static bool alerted_;
+
+static void AlertIfNeeded() {
+ if (alerted_)
return;
- loaded = true;
+ alerted_ = true;
MSAlert();
}
+MSClassMessageHook0(void, AAAccountManager, showMobileMeOfferIfNecessary) {
+ AlertIfNeeded();
+}
+
+MSInstanceMessageHook0(void, SBIconController, showInfoAlertIfNeeded) {
+ AlertIfNeeded();
+}
+
MSInstanceMessageHook0(int, SBButtonBar, maxIconColumns) {
static int max;
if (max == 0) {
@@ -244,13 +257,5 @@ MSInitialize {
}
}
- $SBAlertItemsController = objc_getClass("SBAlertItemsController");
-
- if (Class _class = objc_getClass("SBIconController")) {
- SEL sel(@selector(showInfoAlertIfNeeded));
- if (Method method = class_getInstanceMethod(_class, sel))
- method_setImplementation(method, (IMP) &SBIconController$showInfoAlertIfNeeded);
- }
-
[pool release];
}