summaryrefslogtreecommitdiff
path: root/MobileCydia.mm
diff options
context:
space:
mode:
Diffstat (limited to 'MobileCydia.mm')
-rw-r--r--MobileCydia.mm14
1 files changed, 12 insertions, 2 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index f789b46..826b316 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -262,6 +262,8 @@ static NSString *Warning_;
static bool AprilFools_;
+static void (*$SBSSetInterceptsMenuButtonForever)(bool);
+
static bool IsReachable(const char *name) {
SCNetworkReachabilityFlags flags; {
SCNetworkReachabilityRef reachability(SCNetworkReachabilityCreateWithName(kCFAllocatorDefault, name));
@@ -9341,11 +9343,17 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi
@implementation Cydia
- (void) lockSuspend {
- ++locked_;
+ if (locked_++ == 0) {
+ if ($SBSSetInterceptsMenuButtonForever != NULL)
+ (*$SBSSetInterceptsMenuButtonForever)(true);
+ }
}
- (void) unlockSuspend {
- --locked_;
+ if (--locked_ == 0) {
+ if ($SBSSetInterceptsMenuButtonForever != NULL)
+ (*$SBSSetInterceptsMenuButtonForever)(false);
+ }
}
- (void) beginUpdate {
@@ -10829,6 +10837,8 @@ int main(int argc, char *argv[]) {
//UIKeyboardDisableAutomaticAppearance();
/* }}} */
+ $SBSSetInterceptsMenuButtonForever = reinterpret_cast<void (*)(bool)>(dlsym(RTLD_DEFAULT, "SBSSetInterceptsMenuButtonForever"));
+
BOOL (*GSSystemHasCapability)(CFStringRef) = reinterpret_cast<BOOL (*)(CFStringRef)>(dlsym(RTLD_DEFAULT, "GSSystemHasCapability"));
bool fast = GSSystemHasCapability != NULL && GSSystemHasCapability(CFSTR("armv7"));