summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2008-12-21 06:14:10 +0000
committerJay Freeman (saurik) <saurik@saurik.com>2008-12-21 06:14:10 +0000
commitdbbe0f326ffd44963497e60fbd53311312ab43de (patch)
tree1d32edab0191a4e415504b215f5266b4f2b35f26
parentd524c4d80fefa22e1403cb52212ead400e247424 (diff)
Added MobilePaper and replaced RESETHAND.
-rw-r--r--MobilePaper.jpgbin0 -> 14827 bytes
-rwxr-xr-xMobilePaper.pngbin0 -> 7411 bytes
-rw-r--r--MobileSafety.mm39
3 files changed, 37 insertions, 2 deletions
diff --git a/MobilePaper.jpg b/MobilePaper.jpg
new file mode 100644
index 0000000..c60e725
--- /dev/null
+++ b/MobilePaper.jpg
Binary files differ
diff --git a/MobilePaper.png b/MobilePaper.png
new file mode 100755
index 0000000..9da2d93
--- /dev/null
+++ b/MobilePaper.png
Binary files differ
diff --git a/MobileSafety.mm b/MobileSafety.mm
index af17ccf..367d06e 100644
--- a/MobileSafety.mm
+++ b/MobileSafety.mm
@@ -46,6 +46,8 @@
#import <SpringBoard/SBStatusBarController.h>
#import <SpringBoard/SBStatusBarTimeView.h>
+#import <SpringBoard/SBSlidingAlertDisplay.h>
+
#include <substrate.h>
@protocol MobileSubstrate
@@ -143,16 +145,46 @@ static id SBContentLayer$initWithSize$(SBContentLayer<MobileSubstrate> *self, SE
return self;
}
+/*MSHook(void, SBSlidingAlertDisplay$updateDesktopImage$, SBSlidingAlertDisplay *self, SEL sel, UIImage *image) {
+ NSString *text(@"\"Sad iPhone\" by Geoff Stearns");
+ UIView *&_backgroundView(MSHookIvar<UIView *>(self, "_backgroundView"));
+ if (_backgroundView != nil)
+ text = nil;
+ _SBSlidingAlertDisplay$updateDesktopImage$(self, sel, image);
+ if (text != nil) {
+ UIFont *font([UIFont systemFontOfSize:12]);
+ CGRect rect([self frame]);
+ CGSize size([text sizeWithFont:font]);
+ rect.origin.y = 385 - 3 - 14;//size.height;
+ rect.size.height = size.height;
+
+ UITextView *view([[UITextView alloc] initWithFrame:rect]);
+ [view setTextAlignment:UITextAlignmentCenter];
+ [view setMarginTop:0];
+ [view setFont:font];
+ [view setText:text];
+ [view setTextColor:[UIColor grayColor]];
+ [view setBackgroundColor:[UIColor clearColor]];
+
+ [self insertSubview:view aboveSubview:_backgroundView];
+ }
+}*/
+
+#define Paper_ "/Library/MobileSubstrate/MobilePaper.png"
+
+MSHook(UIImage *, UIImage$defaultDesktopImage, UIImage *self, SEL sel) {
+ return [UIImage imageWithContentsOfFile:@Paper_];
+}
+
MSHook(void, SBStatusBarTimeView$tile, SBStatusBarTimeView *self, SEL sel) {
NSString *&_time(MSHookIvar<NSString *>(self, "_time"));
CGRect &_textRect(MSHookIvar<CGRect>(self, "_textRect"));
if (_time != nil)
[_time release];
- _time = [@"Safe Mode, Click!" retain];
+ _time = [@"Exit Safe Mode" retain];
GSFontRef font([self textFont]);
CGSize size([_time sizeWithFont:(id)font]);
CGRect frame([self frame]);
- NSLog(@"%f:%f,%f:%f:%u", size.height, size.width, frame.size.height, frame.size.width, [[(id) objc_getClass("SBStatusBarController") sharedStatusBarController] statusBarOrientation]);
_textRect.size = size;
_textRect.origin.x = (frame.size.width - size.width) / 2;
_textRect.origin.y = (frame.size.height - size.height) / 2;
@@ -168,6 +200,9 @@ extern "C" void MSInitialize() {
_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);
+ //_SBSlidingAlertDisplay$updateDesktopImage$ = MSHookMessage(objc_getClass("SBSlidingAlertDisplay"), @selector(updateDesktopImage:), &$SBSlidingAlertDisplay$updateDesktopImage$);
+
char *dil = getenv("DYLD_INSERT_LIBRARIES");
if (dil == NULL)
NSLog(@"MS:Error: DYLD_INSERT_LIBRARIES is unset?");