Objective
I'm developing a custom app for internal use on a rooted android mini-pc. The goal (between others... so...many...others...) is to be able to turn on and off a tv using the serial port embeeded on the tv. I'm using an FTDI UART RS232 serial usb cable for it.
Status
The application is working right now, using an android library (serial-driver) i can communicate with the tv, but the problem is that the device asks for permissions every install (and sometimes, weirdly, again on the same device), so it needs to be improved.
Issue
Since the device doesn't have mouse or keyboard by default, when this happens someone has to click the buttons, and since the device is normally hidden behind the screen, it can be really annoying.
My two bits
This problem, i feel, can be solved by two methods, but i still haven't been able to make them work.
- Since the device is rooted, i might be able to modify an unknown (to me) parameter that allows me to bypass the permission request. For this i have tried to make an intent filter for the usb device, and to rewrite the interface that controlls this behaviour, both without success. Is there a way to make this android version more lenient about permissions?
- I use for other reasons SuperSU inside the app, so i can use the full width of the might shell power. Using this i've been trying to send commands manually to the device (/dev/bus/usb/00X/00Y), but this haven't worked. My theory is that it's beacuse of the permissions of the device path, but even doing an unhealthy chmod 777 i cannot have them working.
So, that's my problem right now. I hope someone here can help me.
Additional data
- Running: Custom Android 4.4.2 (Cannot be changed)
- Needs to be doable solely from within the apk (but it can use shell commands)
- We don't have the manufacturer signature to install it as a system app
- We can use only one app, so i cannot have another one to move this one to /sys/apps, and i don't know if an app can do that to itself.
- using Busybox stty -F /dev/.../ returns "Operation not permitted"