ingemaradahl / remote-input

Simple tool for forwarding mouse and keyboard input over a TCP connection
GNU General Public License v3.0
54 stars 6 forks source link

can run remote-input on unrooted android devices? #5

Open fallaha opened 3 years ago

fallaha commented 3 years ago

hi! can i run this program on my android phone without root access? there is not any way to do this?

ingemaradahl commented 3 years ago

No, not unless you somehow change the file permission of /dev/uinput to be writable by the user intended to be running the program. I'm assuming this would be tricky (impossible) without root access, unless you build your own image of Android which sets up the file permissions accordingly.

fallaha commented 3 years ago

does only this file need root permission?

ingemaradahl commented 3 years ago

I think so, yes, but it's been a while since I messed with this so I could be wrong. But note that on some devices the file is at /dev/input/uinput and possibly other locations, so it varies. I think the input_device.c stuff tries to figure this stuff out. By glancing through the file it also seems that it tries to read /sys to find out the "event device" to be able to read which keys are pressed and so on. I think it handles not being able to open that file but things might get weird.

fallaha commented 3 years ago

so, how this work without root? https://github.com/Genymobile/scrcpy

ingemaradahl commented 3 years ago

I don't know. As I said it's been a while (5 years?) since I ran this on Android. But it looks like scrcpy uses the Android JDK APIs to do the work which probably gives a better experience. Perhaps they would be better at answering this? Maybe running as shell is enough? (https://github.com/Genymobile/scrcpy/blob/master/DEVELOP.md#privileges)