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 (launching manually from /data/local/tmp
), then everything works fine.
I would like the App to programmatically do two things,
Copy the binary to
/data/local/tmp/
. Again this wont work as the normal android app doesnt have enough privileges.Start the binary as a shell user so I can have the necessary privileges. I have tried using
android:sharedUserId="android.uid.shell
, but that doesnt seem to work.
Please note that I don't need root to open the /sys
files.
All I need is to be shell user.
Any thoughts will be greatly appreciated.
Thanks