iphone - 使用 iPhone 的触摸屏捕捉游戏的 Action 或击键,例如(愤怒的小鸟)

标签 iphone ios objective-c touchscreen keystroke

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

我确定这些手机存在安全问题并且不想要原生“击键记录”,但如果它是位于其他游戏之上的一层,应该没问题

请让我有什么办法可以达到同样的效果。您的帮助将不胜感激。提前致谢

最佳答案

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

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

例子:

%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 上的东西一样容易,甚至更容易。

关于iphone - 使用 iPhone 的触摸屏捕捉游戏的 Action 或击键,例如(愤怒的小鸟),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15083990/

相关文章:

iphone - 使单元格 imageView 飞入动画

ios - AVPLAYER 不会显示在 View 上但会播放声音

ios - Facebook sdk 3.5.1 邀请好友请求在 ios 中进行双重选择

objective-c - 初始化期间存储到 'myKeyArray' 的值永远不会被读取

iOS:UIImage 上的 EXC_BAD_ACCESS:drawInRect 有 2 个图像

iphone - iOS 上的 RTMP 流

ios - 如何在 Objective-C/iOS 中线性或非线性加载图像?

iphone - NSString 中不同类型的 UTF8 解码

ios - initWithImage 工作正常 initWithFrame 被调用不止一次

iphone - Storyboard : Condition segue transition for navigation (push)