There's an unpleasant hacker way to trick Android into doing this for you (which I am doing successfully).
When the application is installed, Android will copy the appropriate libraries for your architecture from libs/$ARCH/libfoo.so to /data/data/$PACKAGE/libs for you. The hard bit is that it only copies files of the form lib$SOMETHING.so . It will even save execution permissions.
So, if you rename your su executable to libsu.so , Android will do all the work for you. Then you can find it using the paths available from Activity.
However, be careful! Android is not designed to run stand-alone applications, and Zygote really can't handle branching. I found that Runtime.exec() has race conditions and may crash. The only reliable method I've found is to use JNI to implement a small library that uses fork and exec without touching other data between the fork and exec. I had a question about this with all the details, but I can not find it.
I donโt have access to the code right now, but if you want, I can find part of it on Monday.
source share