FORUMS

Which OEM Would You Like to Help?

Most manufacturers have moments of greatness and moments of decadence, and in the past few years … more

Root T-Mobile S6/Edge on 5.1.1 Without Tripping Knox

If you purchase phones from a carrier, you may be no stranger to the difficulties … more

IonVR Coming Soon, HTC M9 Dev Edition Gets Android 5.1 – XDA TV

The HTC M9 Developer Edition has received Android 5.1. That and … more

Android 5.1.1 Omni ROM For Motorola Xoom

Back in Feb 2011, the Motorola Xoom became the first device to be sold with Android 3.0 … more

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

4 posts
Thanks Meter: 13
 
By Hexabit, Junior Member on 9th November 2010, 10:36 AM
Post Reply Subscribe to Thread Email Thread
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, 7273 views)
The Following 7 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
 
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
 
More
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
 
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 Developer / Recognized Contributor
Flag Sydney
Thanks Meter: 5,526
 
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
 
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.
2nd April 2015, 09:40 PM |#7  
Junior Member
Thanks Meter: 2
 
More
I am sorry but I don't understand how to use the file.
Post Reply Subscribe to Thread
Previous Thread Next Thread