From 2c75d26cc6ab1c489c280c9c2ba988327db50b11 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Mon, 23 Aug 2010 23:18:06 +0000 Subject: Do not require SpringBoard/ headers. --- MobileSafety.mm | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/MobileSafety.mm b/MobileSafety.mm index 4d0c0e0..0446a35 100644 --- a/MobileSafety.mm +++ b/MobileSafety.mm @@ -24,19 +24,32 @@ #import #import -#import -#import -#import -#import -#import -#import -#import - #include "CydiaSubstrate.h" +@class SBButtonBar; +@class SBStatusBar; +@class SBUIController; + Class $SafeModeAlertItem; Class $SBAlertItemsController; +@interface SBAlertItem : NSObject { +} +- (UIAlertView *) alertSheet; +- (void) dismiss; +@end + +@interface SBAlertItemsController : NSObject { +} ++ (SBAlertItemsController *) sharedInstance; +- (void) activateAlertItem:(SBAlertItem *)item; +@end + +@interface SBStatusBarTimeView : UIView { +} +- (id) textFont; +@end + @interface UIApplication (CydiaSubstrate) - (void) applicationOpenURL:(id)url; @end @@ -65,7 +78,7 @@ void SafeModeAlertItem$alertSheet$buttonClicked$(id self, SEL sel, id sheet, int } void SafeModeAlertItem$configure$requirePasscodeForActions$(id self, SEL sel, BOOL configure, BOOL require) { - id sheet([self alertSheet]); + UIAlertView *sheet([self alertSheet]); [sheet setDelegate:self]; [sheet setBodyText:@"We apologize for the inconvenience, but SpringBoard has just crashed.\n\nMobileSubstrate /did not/ cause this problem: it has protected you from it.\n\nYour device is now running in Safe Mode. All extensions that support this safety system are disabled.\n\nReboot (or restart SpringBoard) to return to the normal mode. To return to this dialog touch the status bar."]; [sheet addButtonWithTitle:@"OK"]; @@ -175,7 +188,7 @@ MSHook(void, SBStatusBarTimeView$tile, SBStatusBarTimeView *self, SEL sel) { if (_time != nil) [_time release]; _time = [@"Exit Safe Mode" retain]; - id font((id)[self textFont]); + id font([self textFont]); CGSize size([_time sizeWithFont:font]); CGRect frame([self frame]); _textRect.size = size; -- cgit v1.2.3