简体   繁体   English

Android NDK原生权限

[英]Android NDK Native Permissions

How does Android OS handle permissions with native code running within an NDK compiled .apk? Android OS如何处理在NDK编译的.apk中运行的本机代码的权限? It seems to me that because the JNI is just calling upon native functions, the actual NATIVE portion of the code shouldn't be affected by Android permissions. 在我看来,因为JNI只是调用本机函数,所以代码的实际NATIVE部分不应受Android权限的影响。 For example, I am looking to develop an Android app (.apk) that writes a file under data/system. 例如,我正在寻找开发一个在数据/系统下编写文件的Android应用程序(.apk)。 AOS already mounts data/system as RW so I've already been able to develop a native program that performs the write easily. AOS已经将数据/系统安装为RW,因此我已经能够开发一个可以轻松执行写入的本机程序。 My thinking is that when I implement this using the NDK, I will not have to set permissions to write to the directory because of the native implemenation. 我的想法是,当我使用NDK实现它时,由于本机实现,我不必设置写入目录的权限。 Is this assumption correct? 这个假设是否正确?

Thanks, David 谢谢,大卫

My thinking is that when I implement this using the NDK, I will not have to set permissions to write to the directory because of the native implemenation. 我的想法是,当我使用NDK实现它时,由于本机实现,我不必设置写入目录的权限。 Is this assumption correct? 这个假设是否正确?

Absolutely not. 绝对不。 Permissions affect everything in the process, no matter what programming language you choose to write in. 无论您选择使用何种编程语言,权限都会影响流程中的所有内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM