在安卓中进行root。程序执行错误“权限被拒绝”
我程序的可执行文件和库已安装在目录中 bindir =/data/app/ru.testapp/lib/x86_64/,此目录已在SELINUX中执行权限。 该程序的其余部分(附加文件)安装在EnviroMent = /data/user/0/ru.testapp/files/files/enviroment Directory中: bin dev et et lib proc root rut sys系统USR var。 Enviroment目录在Selinux中没有执行权利。 我正在尝试使用proot运行该应用程序:
proot\
--link2symlink\
-w /root\
-r $Environment \
-b $BinDir:/bin\
-b $BinDir:/lib \
-b /sys\
-b /system/ \
-b /apex\
-b /proc/ \
-b /dev\
/bin/test
正如您可以看到我“ bind” $ bindir到$ enviroment/lib和$ enviroment/bin。在这种情况下,执行SELinux的权利在这些目录中丢失了,我遇到了“允许拒绝”错误。绝对没有其他错误,因为在SU下,整个机制起作用。
在这种情况下可以做什么?
The executables and libraries of my program are installed in the directory
BinDir=/data/app/ru.testapp/lib/x86_64/, this directory has execute permission in SELinux.
The rest of the program (additional files) is installed in the Enviroment= /data/user/0/ru.testapp/files/enviroment directory:
bin dev etc lib proc root run sys system usr var.
The Enviroment directory does not have execute rights in SELinux.
I am trying to run the application using proot:
proot\
--link2symlink\
-w /root\
-r $Environment \
-b $BinDir:/bin\
-b $BinDir:/lib \
-b /sys\
-b /system/ \
-b /apex\
-b /proc/ \
-b /dev\
/bin/test
As you can see I "bind" $BinDir to $Enviroment/lib and $Enviroment/bin. In this case, the right to execute SELinux is lost in these directories and I get a "permisiion denied" error. There are definitely no other errors, since under su this whole mechanism works.
What can be done in this situation?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的问题是通过使用 PROOT_UNBUNDLE_LOADER 环境变量集构建 proot 来解决的,以便加载程序位于 SELinux 允许执行的 $BinDir 位置。一般来说,错误出在原始加载程序上。
(安卓10)
My problem was solved by building proot with the PROOT_UNBUNDLE_LOADER environment variable set so that the loader is in the $BinDir location where SELinux allows execution. In general, the error was with the proot loader.
(Android 10)