我基本上需要找出是否有一种方法可以使用 iPhone 的触摸屏捕捉游戏的动作或击键,例如“愤怒的小鸟”等,并将它们保存到设备上的文件中。
我确定这些手机存在安全问题并且不希望原生“击键记录”,但如果它是位于其他游戏之上的一层,应该没问题
请让我有什么办法可以达到同样的效果。您的帮助将不胜感激。提前致谢
我基本上需要找出是否有一种方法可以使用 iPhone 的触摸屏捕捉游戏的动作或击键,例如“愤怒的小鸟”等,并将它们保存到设备上的文件中。
我确定这些手机存在安全问题并且不希望原生“击键记录”,但如果它是位于其他游戏之上的一层,应该没问题
请让我有什么办法可以达到同样的效果。您的帮助将不胜感激。提前致谢
What you are trying to do can be very easily accomplished by using MobileSubstrate, a very powerful framework created by Jay Freeman that allows you to modify virtually any function of any process at runtime. The build environment theos, by Dustin Howett, can be used in place of Xcode, with its Logos preprocessor making all this seemingly complicated mischief a very, very simple task.
Something like this could be accomplished with a very small amount of code.
Example:
%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.
}
As you can see, it is actually quite simple.
Unfortunately, jailbroken devices are your only option. Obviously, you won't be able to put anything like this in the App Store. However, Cydia has become a very prominent part of iOS, and success through it can be reached just as easily, if not more easily, than something on the App Store could.