获得“根"为Android应用程序的权限应用程序、权限、QUOT、Android

2023-09-06 04:51:56 作者:别来无恙

我想知道我们怎样才能从Android应用程序root权限?是否有任何应用程序赫然出现在Android的市场呢?

我尝试了下面的一行code,列出文件,但什么都没有发生。

 工艺过程=调用Runtime.getRuntime()EXEC(新的String [] {苏, - ,根});
 

我试着给TEST_FACTORY许可,在我的清单文件,但我得到一个错误允许系统应用程序

我怎样才能让我的应用程序的系统的应用程序?

我要帮助开始使用这些东西(使应用程序如果有可能获得root权限)有这方面的帮助是非常AP preciated。在此先感谢:)

解决方案

第一:注意,您只能执行使用su(=只能使用shell命令为根,而不是Java code)shell命令

二:不知道这是否适用于所有的应用服务肃在那里,但是这是我的手机上的帮助信息:

 用法:苏[选项] [ - ] [ - ] [登录] [ - ] [参数...]

选项​​:
  --daemon启动苏守护剂
  -c,--command命令传递命令来调用的壳
  -h,--help显示此帮助信息并退出
   - ,-l,--login pretend外壳是一个登录shell
  -m,-p,
   -  preserve环境不改变环境变量
  -s,--shell SHELL使用,而不是缺省的/系统/ bin / sh的SHELL
  -u显示多用户模式和退出
  -v,--version显示版本号并退出
  -V显示版本code和退出,
                                这是用来几乎完全由Superuser.apk
 

这意味着:你需要运行苏-c东西(或苏-c东西 - 根,但是默认反正)。本质上,这是等于肃在大多数Linux系统中,除了守护程序的事情,因为没有守护ahndling在普通Linux系统调用苏

hosts开机就被篡改

如果其他苏命令表现不同(这是可能的),它是更安全的打开一个流一个空壳,执行,评价它的收益code,然后继续执行其他命令,最后执行退出

I would like to know how can we get root permission from android app? Are there any app out there in android market?

I tried out the below line of code to list out files but nothing happened

Process process = Runtime.getRuntime().exec(new String[] { "su", "-", "root"});

I tried to give TEST_FACTORY permission in my manifest file but I got an error "permitted to system app"

How can I make my app system app?

I want help to get started with these stuff (make app if possible to get root permission) any help on this is very much appreciated. Thanks in advance :)

解决方案

First: note that you can only execute shell commands using su (= you can only use shell commands as root, not java code).

Second: Not sure if this applies to all su apps out there, but this is the help message of su on my phone:

Usage: su [options] [--] [-] [LOGIN] [--] [args...]

Options:  
  --daemon                      start the su daemon agent  
  -c, --command COMMAND         pass COMMAND to the invoked shell  
  -h, --help                    display this help message and exit  
  -, -l, --login                pretend the shell to be a login shell  
  -m, -p,  
  --preserve-environment        do not change environment variables  
  -s, --shell SHELL             use SHELL instead of the default /system/bin/sh  
  -u                            display the multiuser mode and exit  
  -v, --version                 display version number and exit  
  -V                            display version code and exit,  
                                this is used almost exclusively by Superuser.apk  

This means: you have to run su -c something (or su -c something - root, but rootis the default anyway). essentially this is equal to su on most Linux systems, except the daemon-thing, as there is no daemon ahndling su calls on regular linux systems.

If other su commands behave differently (which is possible), it's more secure to open a stream to a shell, execute su, evaluate it's return code, then proceed to execute other commands, finally execute exit.