Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

android

touch

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?

like image 742
Dorochi Okamoto Avatar asked Dec 16 '14 03:12

Dorochi Okamoto


1 Answers

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 }"
like image 199
Irwin Avatar answered Sep 29 '22 07:09

Irwin