Discovering "adb shell" gave joy, experiencing the shell as minimal bash with awful line handling (backspace and command recall) gave annoyance, experiencing "adb root" refusing access gave frustration.
After some tracking, it turns out that adbd behaviour is determined by the property "ro.debuggable" which is set during system init. The initial value is located in the file "/default.prop".
$ cat default.prop
cat default.prop
# ADDITIONAL_DEFAULT_PROPERTIES
ro.secure=1
ro.allow.mock.location=0
ro.debuggable=0
persist.service.adb.enable=0
In JP6 it is set to 0 resulting is adbd refusing access. However, set to 1, "adbd root" will give the much better response of "restarting adbd as root".
Once set, the property value cannot be changed. To get this fixed you need to change the contents of the file default.prop which is located in the initial ramdisk image.
Optionally, you can put a replacement shell in /sbin of in ramdisk image so that when connected "exec bash" will make things more relaxing. I attached the version I am using, which is statically linked with ncurses/readline.
There is also a simple patch to unlock adbd if you dislike opening and rebuilding the ramdisk image. However, you do need binoffset which is located in the scripts directory of the linux source tree.
Code:
ofs=`scripts/binoffset initramfs.cpio \`echo -n 'debuggable=0' | od -t u1 -An\` 2>/dev/null` echo 'debuggable=1' | dd bs=1 seek=$ofs conv=notrunc of=initramfs.cpio
'안드로이드 > ADB & Rooting' 카테고리의 다른 글
Root Your Samsung Galaxy S2: Here’s How! (0) | 2011.08.14 |
---|---|
이미지에 포함 할 product 설정하기 (0) | 2011.08.14 |
How To Use ADB: All Commands and Options (0) | 2011.08.14 |
How to Install BusyBox on Rooted Android Phone (0) | 2011.08.14 |
BusyBox for all shell commands (0) | 2011.08.14 |