LightBlog

mardi 28 juin 2016

[Help] Creating/Modifying touch events

I'd like to make a module that can either create or modify touch events on a specific app. I don't have access to the app's source.

An example of the usage would be to make every x value of a touch event in that app to have an offset of say 200 pixels, so if you tap the center, the touch will be registered as a bit more to the right.

I've tried to override the getX() method of the MotionEvent class. From logging, I can see that the method is called, but changing the return value has no effect.

Is there any other method within the framework that I should look into, or would my best bet be trying to find the exact view that will be affected?

And if I were to modify a framework method, how would I get it to only work for a specific view/activity? I haven't found a way to find which app is currently in view, as they may be loaded before being accessed.


from xda-developers http://ift.tt/291NZHz
via IFTTT

Aucun commentaire:

Enregistrer un commentaire