AshikaseSendEvent(x_, y_);
}
+MSClassHook(SBAlertItem)
MSClassHook(SBAlertItemsController)
MSClassHook(SBStatusBarController)
@implementation VNCBridge
+ (void) askForConnection {
- [[$SBAlertItemsController sharedInstance] activateAlertItem:[[[$VNCAlertItem alloc] init] autorelease]];
+ if ($VNCAlertItem != nil)
+ [[$SBAlertItemsController sharedInstance] activateAlertItem:[[[$VNCAlertItem alloc] init] autorelease]];
+ else {
+ [condition_ lock];
+ action_ = RFB_CLIENT_REFUSE;
+ [condition_ signal];
+ [condition_ unlock];
+ }
}
+ (void) removeStatusBarItem {
if (wait_)
MSHookFunction(&IOMobileFramebufferSwapWait, MSHake(IOMobileFramebufferSwapWait));
- $VNCAlertItem = objc_allocateClassPair(objc_getClass("SBAlertItem"), "VNCAlertItem", 0);
- MSAddMessage2(VNCAlertItem, "v@:@i", alertSheet,buttonClicked);
- MSAddMessage2(VNCAlertItem, "v@:cc", configure,requirePasscodeForActions);
- MSAddMessage0(VNCAlertItem, "v@:", performUnlockAction);
- objc_registerClassPair($VNCAlertItem);
+ if ($SBAlertItem != nil) {
+ $VNCAlertItem = objc_allocateClassPair($SBAlertItem, "VNCAlertItem", 0);
+ MSAddMessage2(VNCAlertItem, "v@:@i", alertSheet,buttonClicked);
+ MSAddMessage2(VNCAlertItem, "v@:cc", configure,requirePasscodeForActions);
+ MSAddMessage0(VNCAlertItem, "v@:", performUnlockAction);
+ objc_registerClassPair($VNCAlertItem);
+ }
CFNotificationCenterAddObserver(
CFNotificationCenterGetDarwinNotifyCenter(),