Android NDK 本机权限
Android 操作系统如何处理在 NDK 编译的 .apk 中运行的本机代码的权限?在我看来,因为 JNI 只是调用本机函数,所以代码的实际本机部分不应受到 Android 权限的影响。例如,我正在开发一个在 data/system 下写入文件的 Android 应用程序 (.apk)。 AOS 已经将数据/系统安装为 RW,因此我已经能够开发一个可以轻松执行写入的本机程序。我的想法是,当我使用 NDK 实现此功能时,由于本机实现,我不必设置写入目录的权限。这个假设正确吗?
谢谢, 大卫
How does Android OS handle permissions with native code running within an NDK compiled .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. For example, I am looking to develop an Android app (.apk) that writes a file under data/system. AOS already mounts data/system as RW so I've already been able to develop a native program that performs the write easily. 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. Is this assumption correct?
Thanks,
David
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
绝对不是。无论您选择使用哪种编程语言编写,权限都会影响过程中的一切。
Absolutely not. Permissions affect everything in the process, no matter what programming language you choose to write in.