How to open /dev/diag with super user permissions?
问题 I am developing an application for One Plus 6. This applications is using a shared library(lib.so) to perform some task. For the task it needs to open dev/diag first and then send some commands through code. Below is the code to open dev/diag: fd = open("/dev/diag", O_RDWR|O_LARGEFILE|O_NONBLOCK); if (fd < 0) { perror("open diag dev"); return -8002; } I am able to build a executable with include $(BUILD_EXECUTABLE) written in Android.mk and with ndk-build command. I am able to run open the