下载了最新的SimulateTouch.h文件和libsimulatetouch.dylib库,添加到我自己的Logos Tweak工程中,编译是通过了,但是并没有触发点击,下面是主要代码
%hook SpringBoard
- (void)applicationDidFinishLaunching:(id)application
{
%orig;
[self performSelector:@selector(touch66) withObject:nil afterDelay:4];
}
%new
- (void)touch66
{
CGPoint touchPoint = CGPointMake(26, 36);
int r = [SimulateTouch simulateTouch:0 atPoint:touchPoint withType:STTouchDown];
r = [SimulateTouch simulateTouch:r atPoint:touchPoint withType:STTouchUp];
// NSLog(@"r === %d",r);
[self performSelector:@selector(touch66) withObject:nil afterDelay:4];
}
%end
我的机器是5s 系统是8.1.2