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?
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 }"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With