Dorochi Okamoto
Dorochi Okamoto

Reputation: 53

Inject touch screen events, Android 5.0 , dev/input/eventX

I am working on some program that will need to inject touch screen events to the phone within the program, i am using the opensource lib https://code.google.com/p/android-event-injector/ to manually send touch screen events on rooted Android devices, through direct injection of codes in dev/input/event3, but everything stops working when I updated the phone to Android 5.0 and can't event scan any input devices files under dev/input/, anyone has any idea to work this around?

Upvotes: 5

Views: 2823

Answers (1)

Irwin
Irwin

Reputation: 76

The full SELinux enforcement introduced in Lollipop causes this. One workaround is to invoke "setenforce Permissive" as root.

Edit: If you have SuperSU installed on the device, the following policy will also grant access to /dev/input without having to drop SELinux to permissive mode.

supolicy --live "allow appdomain input_device dir { ioctl read getattr search open }" "allow appdomain input_device chr_file { ioctl read write getattr lock append open }"

Upvotes: 6

Related Questions