简体   繁体   English

正确的Android根目录访问命令

[英]Correct command for root access in Android

I have next example: 我有下一个示例:

RootTools.isRootAvailable()
Command command = new Command(0, "echo this is a command", "echo this is another command");
try {
    RootTools.getShell(true).add(command);
}catch (IOException | RootDeniedException | TimeoutException ex) {
    ex.printStackTrace();
}

But i don't know what to write to "echo this is a command", "echo this is another command " and how to apply it for my folder without permission. 但是我不知道该如何写“ echo this is a command”,“ echo this is another command ”以及如何在未经许可的情况下将其应用于我的文件夹。 Maybe you know? 也许你知道吗? Thanks. 谢谢。

This placeholder this is a command should be replaced with bash code. 此占位符, this is a command应替换为bash代码。

You (most likely, assuming it's not specific to Android) could run it in a Linux terminal. 您(很可能假设它不是特定于Android)可以在Linux终端中运行它。

The placholder echo this is a command is a perfectly valid command, and will simply echo , or print the text. placholder echo this is a command是完全有效的命令,将简单地echo或打印文本。

Some other command you could run are: 您可以运行的其他命令是:

  1. cp copy file cp复制文件
  2. mv move file mv移动文件
  3. touch create an empty file touch创建一个空文件

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

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