FORUMS

Google Teaches You to Use Wear Gestures

Now that the Watch Urbane is out with the latest firmware, we have new information regarding the … more

Samsung Galaxy Alpha (SM-G850) Gets Android 5.0

An Android 5.0 Lollipop update is finally available to download for the Samsung Galaxy … more

Do You Use 4:3 or 16:9 in the Camera App?

Every person has their own method of taking the best photos on their devices, but which aspect … more

LG G4 XDA Forum Opened

LG’s latest & greatest is just a few hours away from launching, and with so many power users that are … more
Post Reply Subscribe to Thread Email Thread

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

9th November 2010, 10:36 AM |#1  
OP Junior Member
Thanks Meter: 12
 
More
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, 6311 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
 
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,487
 
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes