Obtain root access via su on the Android emulator

后端 未结 3 518
忘掉有多难
忘掉有多难 2020-11-30 06:50

I need to get root access via su to lunch a TcpDump binary (I am working on a sort of android sniffer). I use this code :

try {
    Process process = Runtime         


        
相关标签:
3条回答
  • 2020-11-30 07:47

    Ok, I solve the problem by myself :/

    It works with sdk revision 10 and in an avd 2.2. The problem with the tip I have followed previously is the remount step. Here is the list of commands working for me (extract from http://forum.xda-developers.com/showthread.php?t=821742) :

    adb shell mount -o rw,remount -t yaffs2 /dev/block/mtdblock03 /system
    adb push su /system/xbin/su
    adb shell chmod 06755 /system
    adb shell chmod 06755 /system/xbin/su
    adb install superuser.apk
    

    You can get the su binary and the superuser app here : http://forum.xda-developers.com/showthread.php?t=682828

    You have to do that each time you start the emulator.

    0 讨论(0)
  • 2020-11-30 07:49

    I was able to get superuser.apk to stay between reboots by deleting /system/app/SdkSetup.apk

    I just checked again now and it was recreated, but I still have Superuser.apk between my reboots.

    I would also recommend pushing a busybox binary along with su.

    0 讨论(0)
  • 2020-11-30 07:49

    Note that the steps from a.b.d also worked for AVD emulator with OS 2.3.3 Gingerbread. I downloaded su-2.3.6.1-signed.zip from the link provided.

    Also, I created a .bat file containing the commands provided by a.b.d for instant execution.

    0 讨论(0)
提交回复
热议问题