summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-10-13 13:06:42 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2011-10-13 14:15:00 -0700
commit9065bb4466b38159a8fdfd57ce047ed27ab647f2 (patch)
tree862eb1feadd850519c9f21d5301cbb2384ccfacc
parenta67123617006a03a4d6b2813c46ce5b8e1cdf4e3 (diff)
Refactor SafeMode to a separate package.
-rw-r--r--.gitignore1
-rw-r--r--MobileSafety.mm44
-rwxr-xr-xmake.sh5
3 files changed, 18 insertions, 32 deletions
diff --git a/.gitignore b/.gitignore
index e5d0467..63dc3ec 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
*.dylib
+*.deb
diff --git a/MobileSafety.mm b/MobileSafety.mm
index 834b1ef..3bc5b41 100644
--- a/MobileSafety.mm
+++ b/MobileSafety.mm
@@ -19,6 +19,22 @@
**/
/* }}} */
+%apt Package: com.saurik.substrate.safemode
+%apt Author: Jay Freeman (saurik) <saurik@saurik.com>
+
+%apt Name: Substrate Safe Mode
+%apt Description: safe mode safety extension (safe)
+
+%apt Depends: mobilesubstrate (>= 0.9.3367+38)
+
+%fflag 1
+%fflag 2
+
+%bundle com.apple.springboard
+
+%flag -framework Foundation
+%flag -framework UIKit
+
#import <CoreFoundation/CoreFoundation.h>
#import <Foundation/Foundation.h>
#import <CoreGraphics/CGGeometry.h>
@@ -231,31 +247,3 @@ MSInstanceMessageHook0(void, SBStatusBarTimeView, tile) {
_textRect.origin.x = (frame.size.width - size.width) / 2;
_textRect.origin.y = (frame.size.height - size.height) / 2;
}
-
-#define Dylib_ "/Library/MobileSubstrate/MobileSubstrate.dylib"
-
-MSInitialize {
- NSAutoreleasePool *pool([[NSAutoreleasePool alloc] init]);
-
- NSLog(@"MS:Warning: Entering Safe Mode");
-
- 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);
- }
- }
-
- [pool release];
-}
diff --git a/make.sh b/make.sh
index 88cb898..d7e88f5 100755
--- a/make.sh
+++ b/make.sh
@@ -1,5 +1,2 @@
#!/bin/bash
-flags=(-O2 -g0 -fno-exceptions -fvisibility=hidden)
-cycc -i2.0 -oMobileSafety.dylib -- "${flags[@]}" -dynamiclib MobileSafety.mm \
- -framework CoreFoundation -framework Foundation -framework UIKit \
- -L. -lsubstrate -lobjc
+CYCC_APT_VERSION=$(./version.sh) cycc -i2.0 -s -p MobileSafety.mm