开发者

Android NDK superuser permissions

开发者 https://www.devze.com 2023-01-23 01:42 出处:网络
I have开发者_开发技巧 a C program which I can run my rooted Android phone. However, in order to work correctly, the program must be run as superuser.

I have开发者_开发技巧 a C program which I can run my rooted Android phone. However, in order to work correctly, the program must be run as superuser.

I now wish to call a method from this program using the Android NDK interface. What must I do to have the native code run as superuser?


You should run the su program, and then script it (by writing to its standard input) to run your program. On some rooted devices, this will "just work", and on others (most, really) it will spawn an activity from an app called SuperUser to ask the user if it should be allowed.

0

精彩评论

暂无评论...
验证码 换一张
取 消