I am building an "embedded" system, based on Android, and at the moment I'm trying to implement updating the firmware of an audio module.
There is a binary which does that, but the catch is that it needs root access to do it ( it can't access GPIOs otherwise ).
So the problem now has shifted to giving the executable ( and just that executable, mustn't do full root) root access.
I've been at this for a few days, and have tried a bunch of things, with no success.
Things I've already tried :
- https://stackoverflow.com/a/13892057/3801327 ( I did this, but still no root. I'm thinking its because of No setuid/setgid programs on since Android 4.3 )
- Read somewhere that you can create a system service, which you call, and have the code that requires root run there. Followed this guide to create a system service, but it turns out it doesn't have root access.
I have run out of ideas or things to try. What else can I do ?
EDIT
I was not able to make the binary run as root, but was able to run a shell script after boot from init.rc , where there is root access, and export/change the permissions of the specific gpio I needed. This made it possible to access it without root access needed later on.