Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Always run adb as root on a rooted device

Tags:

android

adb

root

So I have a rooted SGS3 running the lastest CyanogenMod nightly. I am trying to use DDMS while developing but have run into a problem. I do have root access on my phone (evident when I use an adb shell and use the su command), however DDMS does not use adb in root mode, forcing me to manually change permissions of files using the adb shell before being able to copy them. Is there a way to force ddms to use root all the time? I figured this must be some setting somewhere but I cannot find it.

Any help is gladly appreciated.

like image 361
pogo2065 Avatar asked Jan 14 '23 04:01

pogo2065


1 Answers

You can try this method, but be carefully as this allows any app to gain root, can you say, "Security Hole!"

Make your suid binary insecure by typing the following commands.

adb shell
su
mount -o remount,rw /system # or: adb remount
ls -la /system/bin/sh
lrwxr-xr-x root shell 2012-11-10 15:20 sh -> mksh
chmod 4755 /system/bin/sh
ls -la /system/bin/mksh
-rwsr-xr-x root shell 157520 2012-11-10 09:54 mksh # notice the suid bit is set
^D
adb shell
like image 126
Ajster1989 Avatar answered Jan 25 '23 20:01

Ajster1989