如何使用xamarin模拟android上的屏幕触摸?

时间:2017-06-06 09:30:19

标签: c# android xamarin

我正在制作一个自动化某些内容的应用程序,例如在打开第三方应用程序时,我的应用程序在后台运行,会在给定坐标处模拟屏幕上的点击,这看起来像常规屏幕点按第三方应用。

但是我坚持实际的屏幕点击模拟,我怎样才能用Xamarin for Android实现它?

该应用具有root权限。

谢谢。

2 个答案:

答案 0 :(得分:0)

I'm gonna make this as simple as possible. Also, this will be a good start for where you wanna start.

1- Your app must have root access.

2- Create an Activity with a service to sniff or clicks.

3- Recorde click points in an ArrayList, and reflect them back by feeding the touch event in android.

At the end, you shouldn't ask this kind of questions.

答案 1 :(得分:0)

您也可以在没有root权限的情况下执行此操作。对不起代码,因为我没有xamrin经验。但是你可以实现辅助服务来模拟按钮,textview ......点击。您可以查看Grenify应用程序以获取示例。 Greenify应用程序以programitically方式打开应用程序信息,并以编程方式单击强制关闭按钮。即使没有root访问权限 这是应用程序链接。 https://play.google.com/store/apps/details?id=com.oasisfeng.greenify&hl=en

注意:我还阅读了几篇帖子,告诉我这是不可能的,但在使用Greenify应用程序后我不相信。

My Own Research on accessibility services(监控父母间谍应用程序项目的whatsapp消息): 使用辅助功能服务我已经从他们的textView.getText()函数调用监视WhatsApp消息。 如果需要,我可以分享我的Android代码以获取帮助。 谢谢, Jawad Zeb

相关问题