Android ioctl - permissions and root usage

I am working on some routing features in an Android app and need to access ioctls. Since applications using ioctls need root permission to run, the only way I could name them is to link a separate executable and invoke it using Java with Runtime.getRuntime().exec().

Is there a way to access root permissions from the JNI in Android without creating a separate executable? Does an executable create a better approach for accessing ioctl?

+4
source share
2 answers

There is no means for a non-root process to become root (outside of exploits), so yes, you need a separate process.

This is inherited unchanged from linux - the difference is that there is no direct way to start the Android application process as root from the launch, since it sends the intention to the zygote, which rolls back and receives privileges, - it reduces the child who specializes in the application process. (There may be a roundabout method for manually creating an application process, but for this you will have to have an application process, so by definition it will be a secondary process. And it will be inefficient, since an application that was not child of zygote will not inherit the joint mapping of system libraries and so you have to load your own unique copies into memory)

ioctl() - syscall root, fd ( ). , , , . , Android- IPC Binder ioctl, .

+3

ioctl() root ( ). , . , , .

?

0

All Articles