From 0e371502fd57d5754c54d36d7ec29e8ef5bc6ae1 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Thu, 2 Dec 2010 06:23:02 -0800 Subject: [PATCH] Prefer SBReboot() (when available) to system("reboot"). --- MobileCydia.mm | 5 ++++- iPhonePrivate.h | 1 + makefile | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/MobileCydia.mm b/MobileCydia.mm index 872e818c..6121e6eb 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -4449,7 +4449,10 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { break; case 4: - system("reboot"); + if (void (*SBReboot)(mach_port_t) = reinterpret_cast(dlsym(RTLD_DEFAULT, "SBReboot"))) + SBReboot(SBSSpringBoardServerPort()); + else + system("reboot"); break; } } diff --git a/iPhonePrivate.h b/iPhonePrivate.h index e6a79dce..9778f9da 100644 --- a/iPhonePrivate.h +++ b/iPhonePrivate.h @@ -350,6 +350,7 @@ extern float const UIWebViewGrowsAndShrinksToFitHeight; extern float const UIWebViewScalesToFitScale; // }}} // extern "C" *(); {{{ +extern "C" mach_port_t SBSSpringBoardServerPort(); extern "C" UIImage *_UIImageWithName(NSString *name); extern "C" void UISetColor(CGColorRef color); // }}} diff --git a/makefile b/makefile index d9326179..70c54329 100644 --- a/makefile +++ b/makefile @@ -30,6 +30,7 @@ link += -framework GraphicsServices link += -framework IOKit link += -framework JavaScriptCore link += -framework QuartzCore +link += -framework SpringBoardServices link += -framework SystemConfiguration link += -framework WebCore link += -framework WebKit -- 2.45.2