简体   繁体   English

在 Android 根目录上运行 su

[英]Running su on Android root

Hi so my application runs some commands using the su in android root.嗨,我的应用程序使用 android 根目录中的 su 运行一些命令。

It works fine in JellyBean on the Galaxy Nexus but when I try to run it on the LG Nexus 5 (kitkat), I get an error saying:它在 Galaxy Nexus 上的 JellyBean 中运行良好,但是当我尝试在 LG Nexus 5 (kitkat) 上运行它时,我收到一条错误消息:

su: uid 10069 not allowed to su su: uid 10069 不允许 su

I'm not really sure what I'm missing here.我不确定我在这里错过了什么。 I have root access (it runs su fine on the Galaxy Nexus).我有 root 访问权限(它在 Galaxy Nexus 上运行良好)。

Basically the application reads in a command from a TextEdit, strips it, appends the necessary parameters etc. and then calls the script which is put on the phone.基本上,应用程序从 TextEdit 中读取命令,将其删除,附加必要的参数等,然后调用放在手机上的脚本。 I use the ProcessBuilder to build the call for the script.我使用 ProcessBuilder 来构建脚本调用。

Any fixes or ideas as to where I should look would be appreciated.关于我应该在哪里看的任何修复或想法将不胜感激。 Thank you谢谢

The issue was SuperSu not being properly installed and granting permission to the application.问题是 SuperSu 没有正确安装和授予应用程序权限。 Once I changed that there were no permissions issues.一旦我改变了没有权限问题。

If you have problem with rooting to super user.如果您在 root 超级用户时遇到问题。

You can use "run-as" command to access files of your application.您可以使用“run-as”命令来访问应用程序的文件。

ex: run-as com.your.package例如: run-as com.your.package

It will drop you to the shell@android:/data/data/com.your.package $它会将您带到shell@android:/data/data/com.your.package $

now you can use commands ls Then it will display the list of file folders现在你可以使用命令ls然后它会显示文件夹列表

  cache
  databases
  lib
  shared_prefs

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

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