Touch screen event input, Android 5.0, dev / input / eventX

I'm working on some kind of program that will have to enter touchscreen events into the phone inside the program, I use openource lib https://code.google.com/p/android-event-injector/ to manually send touchscreen events to root devices Android by directly entering the codes in dev / input / event3, but everything stops working when I upgrade the phone to Android 5.0 and can’t scan files of any input devices under dev / input /, who has an idea to work on this?

+5
source share
1 answer

This is SELinux enforcement introduced in Lollipop. One way is to invoke "setenforce Permissive" as root.

Edit: if SuperSU is installed on the device, the following policy will also provide access to / dev / input without having to reset SELinux to allow 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 }" 
+6
source

Source: https://habr.com/ru/post/1209188/


All Articles