在iOS上模拟系统宽触摸事件 [英] Simulating System Wide Touch Events on iOS

查看:120
本文介绍了在iOS上模拟系统宽触摸事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要以编程方式将触摸事件添加到iOS设备系统范围,而不使用越狱;我该怎么办?

I need to programmatically add touch events to iOS devices system wide without using a jailbreak; how do I do this?

我最好使用私有API来在后台的应用程序中运行。我知道这样做可以防止我的应用在应用商店中的可用性;这是一个私人应用程序,所以它不是一个问题。

Preferably I'd like to use a private API to do this running in an app in the background. I am aware that doing this prevents my app's availability on the app store; this is however a private app so it isn't a problem.

推荐答案

你需要做的是先创建事件你想要,然后通过紫色端口将它们发送到SpringBoard,例如。马赫港口。要使它们在系统范围内,您必须通过端口将它们转发到每个应用程序。这意味着您需要实际执行windowmanager所做的事情并查看哪个应用程序处于活动状态,屏幕锁定等。

What you need to do is first create the events you want, and then send them to SpringBoard over the "purple port" eg. mach port. To make them system wide you must forward them to each application over the port. That means you need to actually do what the windowmanager does and looking at which app is active, screen locked, etc.

有一个完整的私有框架API可用(IOSurface,GraphicServices,SpringBoardServices等)为您提供所需的部分。

There are a hand full of private framework APIs that work (IOSurface, GraphicServices, SpringBoardServices, etc.) to get you the pieces you need.

您必须在运行时使用dlopen()之类的东西加载这些私有框架。

You will have to load these private frameworks at runtime using something like dlopen().

从iOS 6.1.4(当前的ATM)开始,这是100%可能没有越狱,但是你将加载苹果AppAppore不允许的私有框架;)

This is 100% possible without jailbreak as of iOS 6.1.4 (current ATM), but you will be loading private frameworks which is not allowed by apple for AppStore ;)

这篇关于在iOS上模拟系统宽触摸事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆