-#define Dylib_ "/Library/MobileSubstrate/MobileSubstrate.dylib"
-
-MSInitialize {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
- NSLog(@"MS:Warning: Entering Safe Mode");
-
- _SBButtonBar$maxIconColumns = MSHookMessage(objc_getClass("SBButtonBar"), @selector(maxIconColumns), &$SBButtonBar$maxIconColumns);
- _SBUIController$init = MSHookMessage(objc_getClass("SBUIController"), @selector(init), &$SBUIController$init);
- _SBStatusBar$touchesEnded$withEvent$ = MSHookMessage(objc_getClass("SBStatusBar"), @selector(touchesEnded:withEvent:), &$SBStatusBar$touchesEnded$withEvent$);
- _SBStatusBar$mouseDown$ = MSHookMessage(objc_getClass("SBStatusBar"), @selector(mouseDown:), &$SBStatusBar$mouseDown$);
- _SBStatusBarTimeView$tile = MSHookMessage(objc_getClass("SBStatusBarTimeView"), @selector(tile), &$SBStatusBarTimeView$tile);
-
- _UIImage$defaultDesktopImage = MSHookMessage(object_getClass(objc_getClass("UIImage")), @selector(defaultDesktopImage), &$UIImage$defaultDesktopImage);
-
- char *dil = getenv("DYLD_INSERT_LIBRARIES");
- if (dil == NULL)
- NSLog(@"MS:Error: DYLD_INSERT_LIBRARIES is unset?");
- else {
- NSArray *dylibs([[NSString stringWithUTF8String:dil] componentsSeparatedByString:@":"]);
- NSUInteger index([dylibs indexOfObject:@ Dylib_]);
- if (index == NSNotFound)
- NSLog(@"MS:Error: dylib not in DYLD_INSERT_LIBRARIES?");
- else if ([dylibs count] == 1)
- unsetenv("DYLD_INSERT_LIBRARIES");
- else {
- NSMutableArray *value([[[NSMutableArray alloc] init] autorelease]);
- [value setArray:dylibs];
- [value removeObjectAtIndex:index];
- setenv("DYLD_INSERT_LIBRARIES", [[value componentsJoinedByString:@":"] UTF8String], !0);
- }
- }
-
- $SBAlertItemsController = objc_getClass("SBAlertItemsController");