在安卓中进行root。程序执行错误“权限被拒绝”

发布于 2025-01-17 19:55:00 字数 624 浏览 3 评论 0原文

我程序的可执行文件和库已安装在目录中 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

回心转意 2025-01-24 19:55:00

我的问题是通过使用 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)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文