模拟所有物理按钮,例如iOS 7上的主页按钮上的压力(越狱)

我正在尝试模拟iOS 7上的“主页按钮”,但iOS 6上使用的上一个方法不起作用。 我说的是一个越狱装置。

#include "GSEvent.h" - (void)simulateHomeButton { struct GSEventRecord record; memset(&record, 0, sizeof(record)); record.type = kGSEventMenuButtonDown; record.timestamp = GSCurrentEventTimestamp(); GSSendSystemEvent(&record); record.type = kGSEventMenuButtonUp; GSSendSystemEvent(&record); } 

*更新我真正需要的是一个像旧的一样的通用方法,让我模拟所有物理按钮的压力

尝试这个。

[[%c(SBUIController)sharedInstance] clickedMenuButton];

我在BiometricKit的头转储中找到了一些对homeButtonPress引用https://github.com/MP0w/iOS-Headers/blob/6e220684809a8e581357c1622efcc002a1df5014/iOS7/PrivateFrameworks/BiometricKit/BiometricKit.h#L68