如何获得Android 2.3的模拟器root访问权限 [英] how to get root access on android 2.3 emulator

查看:267
本文介绍了如何获得Android 2.3的模拟器root访问权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让我的Andr​​oid模拟器root权限来运行iptables的。我通过很多论坛去了,试过很多方法,但似乎没有任何工作。以下是我的设备规格,我尝试在仿真器的一切。

i am trying to get root access on my android emulator to run iptables. i went through many forums and tried many methods but nothing seems to work. the following is my device specification and i try everything on emulator.

版本 - 2.3
内核版本 - 2.6.29-00261-g0097074-dirtydigit@digit#20

version - 2.3 kernel version - 2.6.29-00261-g0097074-dirtydigit@digit #20

集结号 - SDK-ENG 2.3 GRH55 79397测试键

build number - sdk-eng 2.3 GRH55 79397 test-keys

所以如何成为Android的根。请帮助。

so how to become root in the android. please help.

推荐答案

在提供的SDK R10模拟器,你可以得到一个root shell从主机执行亚行壳。一旦你有这样的root shell,你的猫按照这个步骤来获取可以登录你作为根从终端仿真器的命令:

On the emulator provided with the SDK r10, you can get a root shell executing "adb shell" from your host computer. Once you have such root shell, you cat follow this steps to get a command that can log you as root from the terminal emulator:

# Remount /data to allow executables and setuids on it
mount -o remount,rw /dev/block/mtdblock1 /data

# There's no "cp" command on Android
cat /system/bin/sh > /data/su

# Give setuid permissions to the shell
chmod 7755 /data/su

现在,从仿真器,只需运行/数据/苏,就是这样,你的根。

Now, from the emulator, just run "/data/su" and that's it, you're root.

正常/系统/ XBIN /苏SDK中包含的命令执行内部用户ID检查,所以这些命令...

The normal "/system/xbin/su" command included in the SDK performs internal user id checks, so these commands...

mount -o remount,rw /dev/block/mtdblock0 /system
chmod 7755 /system/xbin/su

...只是将无法工作。有没有办法来欺骗/系统/ XBIN /苏允许普通用户(UID 10018在我的情况),以成为root。

...just won't work. There's no way to trick /system/xbin/su to allow the normal user (UID 10018 in my case) to become root.

请注意,处理setuid程序可能是一个安全风险(不低于具有普遍的苏命令越高,虽然)。需要您自担风险使用此解决方案。

Please note that dealing with setuid programs can be a security risk (not higher than having a universal "su" command, though). Use this solution at your own risk.

这篇关于如何获得Android 2.3的模拟器root访问权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆