Post Reply

[KERNEL] adb "cannot run as root in production builds" fix

OP Hexabit

9th November 2010, 10:36 AM   |  #1  
OP Junior Member
Thanks Meter: 12
 
4 posts
Join Date:Joined: Oct 2010
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". 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
Attached Files
File Type: rar bash.rar - [Click for QR Code] (527.3 KB, 3817 views)
The Following 6 Users Say Thank You to Hexabit For This Useful Post: [ View ]
13th December 2010, 08:55 PM   |  #2  
Junior Member
Flag Moose Jaw
Thanks Meter: 0
 
4 posts
Join Date:Joined: Feb 2008
More
Thanks...any help though?
Hi....thanks for the fix....could you point me to a decent howto on editting the initial ramdisk?

Thanks

M
10th July 2011, 06:28 PM   |  #3  
Junior Member
Thanks Meter: 6
 
18 posts
Join Date:Joined: Jul 2011
it doesn't sound simple
i will try to figure that one out ...
16th February 2012, 08:05 AM   |  #4  
Member
Flag Rotterdam
Thanks Meter: 2
 
47 posts
Join Date:Joined: May 2009
More
Dear Hexabit,
I know it's an old topic.

But do you know how can I use this Fix on a windows 7?
tried searching for binoffset software/script..couldn't find anything

I have a Flytouch 3 tablet, rooted(Z4) with terminal emulator and root explorer.
is there a way to use you bash.rar to unlock adb access?
thanks for the help
14th October 2013, 10:24 AM   |  #5  
Ricky Divjakovski's Avatar
Recognized Contributor
Flag Sydney
Thanks Meter: 5,310
 
3,588 posts
Join Date:Joined: Feb 2013
Donate to Me
More
Quote:
Originally Posted by doekoe87

Dear Hexabit,
I know it's an old topic.

But do you know how can I use this Fix on a windows 7?
tried searching for binoffset software/script..couldn't find anything

I have a Flytouch 3 tablet, rooted(Z4) with terminal emulator and root explorer.
is there a way to use you bash.rar to unlock adb access?
thanks for the help

you have to split the kernel, then decompile the ramdisk and edit default.prop and change ro.debuggable to 1, then recompile and flash
22nd October 2013, 11:26 AM   |  #6  
Junior Member
Beijing
Thanks Meter: 0
 
11 posts
Join Date:Joined: Feb 2011
More
confuse but giving me a clue
I use unpackbootimg in my ubuntu pc.
The adb root works not properly after set debuggable=1.

When I saw your thread that told the adbd should be unlocked too, then I replace the adbd with a unlocked one. It works!
Thanks for your help.
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes