]> git.saurik.com Git - safemode-ios.git/commitdiff
iOS 7 alertSheet->alertView (thanks rpetrich!).
authorJay Freeman (saurik) <saurik@saurik.com>
Wed, 15 Jan 2014 12:25:53 +0000 (04:25 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Wed, 15 Jan 2014 12:27:04 +0000 (04:27 -0800)
Tweak.xm

index e63d8e7dccb420bc57c5e64fd7331940c256760e..69a6d27a53ec0237a2e89d0678306c0accad2052 100644 (file)
--- a/Tweak.xm
+++ b/Tweak.xm
@@ -55,7 +55,7 @@ Class $SafeModeAlertItem;
 - (void) setNumberOfRows:(NSInteger)rows;
 @end
 
-void SafeModeAlertItem$alertSheet$buttonClicked$(id self, SEL sel, id sheet, int button) {
+void SafeModeButtonClicked(int button) {
     switch (button) {
         case 1:
         break;
@@ -72,7 +72,15 @@ void SafeModeAlertItem$alertSheet$buttonClicked$(id self, SEL sel, id sheet, int
             [[UIApplication sharedApplication] applicationOpenURL:[NSURL URLWithString:@"http://cydia.saurik.com/safemode/"]];
         break;
     }
+}
+
+void SafeModeAlertItem$alertSheet$buttonClicked$(id self, SEL sel, id sheet, int button) {
+    SafeModeButtonClicked(button);
+    [self dismiss];
+}
 
+void SafeModeAlertItem$alertView$clickedButtonAtIndex$(id self, SEL sel, id sheet, NSInteger button) {
+    SafeModeButtonClicked(button + 1);
     [self dismiss];
 }
 
@@ -103,6 +111,7 @@ static void MSAlert() {
             return;
 
         class_addMethod($SafeModeAlertItem, @selector(alertSheet:buttonClicked:), (IMP) &SafeModeAlertItem$alertSheet$buttonClicked$, "v@:@i");
+        class_addMethod($SafeModeAlertItem, @selector(alertView:clickedButtonAtIndex:), (IMP) &SafeModeAlertItem$alertView$clickedButtonAtIndex$, "v@:@i");
         class_addMethod($SafeModeAlertItem, @selector(configure:requirePasscodeForActions:), (IMP) &SafeModeAlertItem$configure$requirePasscodeForActions$, "v@:cc");
         class_addMethod($SafeModeAlertItem, @selector(performUnlockAction), (IMP) SafeModeAlertItem$performUnlockAction, "v@:");
         objc_registerClassPair($SafeModeAlertItem);