In my application, I need to start a native binary that opens and read from some /sys/kernel files
. If I launch the native binary by connecting using adb shell
The shell
UID is reserved for development and testing. Running an app with shell
privileges is circumventing Google's security model. So you will not be able do it on a secured commercial device without rooting it.
A possible temporary (non-persistent between reboots) workaround would be:
Use adb shell
to start a background service process, running as shell UID
In your application, using IPC to ask the service to perform special task for you