使用iphone的触摸屏捕捉游戏(如《愤怒的小鸟》)的动作或按键



我基本上需要找出是否有一种方法来捕捉移动或击键的游戏,如"愤怒的小鸟"等使用iPhone的触摸屏,并将它们保存到设备上的一个文件。

我确信这些手机有安全问题,不想要原生的"击键记录",但如果它是一个位于其他游戏之上的层,它应该是ok的

请告诉我有什么方法可以达到同样的效果。非常感谢您的帮助。

你想做的事情可以很容易地通过使用mobilessubstrate来完成,这是一个由Jay Freeman创建的非常强大的框架,它允许你在运行时修改任何进程的几乎任何函数。构建环境theos,由Dustin Howett,可以用来代替Xcode,与它的logo预处理器使所有这些看似复杂的恶作剧一个非常,非常简单的任务。

这样的事情可以用非常少的代码完成。

的例子:

%hook UIApplication //Hooks into the UIApplication class.
- (void)sendEvent:(id)arg1{//Hook the sendEvent function, the function which handles all events passed to a UIApplication.
  if([arg1 isKindOfClass:%c(UITouchesEvent)]){//Make sure we're not processing other events, such as device rotation.
    for(UITouch *touch in [arg1 allTouches])
      NSLog(@"Touch recorded: %@", NSStringFromCGPoint([touch locationInView: [[UIApplication sharedApplication] keyWindow]]));
  }
  %orig;//Call the original function, so the app can still process the events, and we don't eat them all.
}

正如您所看到的,它实际上非常简单。

不幸的是,越狱设备是你唯一的选择。显然,你不可能把这样的东西放到App Store中。然而,Cydia已经成为iOS中非常重要的一部分,通过它获得成功并不比App Store更容易。

最新更新