Android NDK Superuser Permissions

I have a C program that I can run with my Android root phone. However, for the program to work properly, the program must run as superuser.

Now I want to call a method from this program using the Android NDK interface. What should I do to make my own code work as superuser?

+3
source share
2 answers

You must run the program su, and then script it (by writing to standard input) to run your program. On some rooted devices, this will β€œjust work”, and on others (in most cases) it will trigger activity from the SuperUser application to ask the user if they are allowed.

0
source
0
source

Source: https://habr.com/ru/post/1772401/


All Articles