I have an Android application that call a native shared library by jni. This shared library invokes some loadable kernel modules .ko
My app run fail when jni calls the function in shared library that invokes kernel module. But when I write an executable using this shared library, it works fine when call above function.
I found that my app run with user name is "u0_axx" and my executable run by command line with root. So maybe it doesn't have permission to invokes kernel module.
My question is how does this native code run with root permission? Or some solution to solve such kind of issue?
Ps: I also tried to use Runtime.getRuntime().exec("su")
and added <uses-permission android:name="android.permission.ACCESS_SUPERUSER"/>
into manifest but it doesn't help and get an exception that permission denied. My device is rooted and my app is built as system app.