Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,813,801 Members 39,799 Now Online
XDA Developers Android and Mobile Development Forum

Can't get ADB Root Access in certain ROMs?

Tip us?
 
espionage724
Old
(Last edited by espionage724; 5th September 2012 at 12:08 AM.)
#1  
espionage724's Avatar
Senior Member - OP
Thanks Meter 506
Posts: 2,503
Join Date: Feb 2010
Location: Charleroi, PA

 
DONATE TO ME
Default Can't get ADB Root Access in certain ROMs?

I've noticed with a lot of CM10-based ROM's (possibly even others), I am unable to get root ADB access.

On the ROM's that have it, I set the Root access to Apps and ADB


I can reboot, fix permissions, clear caches, but no matter what, Android Commander is never able to get Root access


This isn't the case on some ROM's I've tried though. Android Commander is able to get Root access just fine without me needing to do anything.

To name some ROM's that I can't get Root access with:
CyanogenMod 10 Nightly (9/4)
AndroidME CM10 N7 1.0.0

As for what ROM's had working Root access, I can't exactly recall correctly :/ But I think these had it working:
Codename Android 3.4.1
Team EOS 3 *JELLYBEAN* Nightlies (confirmed working ADB root)

Is there something else I should possibly be doing to get Root access on CM10-based ROM's?


Device Ownership:
 

Current Devices:
None
Side Devices:
Nexus 7 (grouper) (franco.Kernel + Rasbeanjelly)
Galaxy Rush (SPH-M830) (Stock)

Ex Devices:
Galaxy Tab 7.0 (SGH-T849)
Galaxy Tab 2 7.0 (GT-P3113)
Galaxy Prevail (SPH-M820) (KoumaKernel + CTMod)
Nexus 4 (LGE960/mako) (franco.Kernel + RasSaber)
Nexus 10 (GT-P8110/manta) (franco.Kernel + RasSaber
 
jamesst20
Old
#2  
jamesst20's Avatar
Senior Member
Thanks Meter 2,105
Posts: 1,495
Join Date: Jan 2012

 
DONATE TO ME
Boot a unsigned kernel then ./adb remount

PS: it is effective until you reboot

Sent from my Nexus 7 using Tapatalk 2
If I helped you, dont forget to press thanks !

Like my work ? Feel free to donate

Donate Me (Click Here)

SmoothROM - Google Nexus 7
JROMFlasher - Google Nexus 7
 
tamahouse
Old
#3  
Junior Member
Thanks Meter 4
Posts: 2
Join Date: Sep 2012
"The Root access : No" because you'r using the rom which have a "secured adb" (even when you'r rooted)

Download the "adbd insecure" in this thread and "Enable insecure adbd", you can get "Root access: OK" in any rom
http://forum.xda-developers.com/show....php?t=1687590
The Following User Says Thank You to tamahouse For This Useful Post: [ Click to Expand ]
 
HEXcube
Old
(Last edited by HEXcube; 12th November 2012 at 11:02 AM.)
#4  
HEXcube's Avatar
Senior Member
Thanks Meter 35
Posts: 113
Join Date: Aug 2012
Prompt adb root

The real reason behind adb root or insecure adb is the adb daemon in the device running at root permissions. In pre-Android 4.1 versions, this is usually decided by some initialisation script(like init.rc) at boot time. The script checks for value in default.prop,local.propand other environment variables.
If it finds build.prop,default.prop or local.prop property file with ro.secure=0 adbd is allowed to run as root. You'll get adb root and hence will be able to do commands like adb remount,adb root and adb shell's prompt'll be # by default. The user may be displayed as root@root or root@shell. adb GUIs like Android Commander and QtADB will get to work in Root mode.
But,if it's ro.secure=1, adb daemon is made to work in secure mode, and adb won't change to root mode on issuing adb root command. However, if su binary is present in $PATH, u can still call su command from adb shell. But, it's not enough for Android Commander to get Root Access. It is possible to attain adb root through any one of the following methods:
1.For CyanoGenMod based ROMs there is an option in Settings->Developer Settings->Root access to control root access. Choose ADB only or Apps and ADB in options to get adb root.
2.Else use adbd Insecure app by chainfire if you have a rooted device. This is useful, especially for Android 4.1+ devices.
3.Or, you may manually edit default.prop to set it's value to 0, but original default.prop will be restored from boot partition everytime you reboot(this is the reason why adb Insecure cannot permanently do adb root, though there is an option to repeat the rooting procedure everytime the device boots). This method is called temporary adb root. On pre-Android 4.0 ROMs default.prop file was located in / directory. I read that from Android 4.x this file is in ramdisk and so more difficult to edit. But Android 4.0 has local.prop which is easier to modify than default.prop( See method 5)
4.For permanent adb root, you'll have to extract boot.img, change default.prop, repack and then flash it back to device.
5. In Android 4.0 there's local.prop file in /data partition. Setting ro.secure=0 in this file will do adb root permanently. Else you can set another property ro.kernel.qemu=1 in the same file. But, this value makes the system think that it is running in an android emulator. Many exploits and root methods set this property temporarily to gain root. But, it may cause side effects if used permanently. Setting ro.secure=0 is recommended. Do this command in terminal app or adb shell:
echo ro.secure=0 >/data/local.prop
or you can manually copy a local.prop file with ro.secure=0 as it's content to /data.
6.Note that method 3,4 and 5 won't work in Android 4.0 Jelly Bean onwards. According to Dan Rosenburg(drjbliss in XDA),the researcher who discovered adb root emulator exploit and many other exploits, Jelly Bean doesn't parse any property files to set the ownership of adb daemon. The stock adbd will have to be replaced with an insecure one to gain adb root. But still,as adbd is located in /sbin whose contents are reloaded everytime on reboot from boot.img, it won't be permanent.
7. For permanent adb root, you may flash an insecure boot.img(one that contains and insecure adbd)
8. If you're really desperate and can't get adb root to work with any of the above methods use an exploit. Most of the adb based rooting methods utilise some exploit to make the adb daemon run as root. By studying the exploit and implementing it you could gain adb root atleast temporarily.I'm not recommending this method but as a last resort you could try them.
Acknowledgements: Thanks to Dan Rosenberg for explaining the reasons behind adb root, especially the one in Jelly Bean.
Offline(almost!),due to Xams.I'll be back soon to Cube the Fun.

Device List
INTEX iTab
OS - Official Android 4.0.4 Ice Cream Sandwich
Rooted! (How?)
chipset- Rockchip rk2918

Nokia 6303i Classic
OS - Nokia OS/ Series40 6th Ed
hacked/rooted/jailbroken(what do you call a nokia device with elevated privileges?)
The Following 8 Users Say Thank You to HEXcube For This Useful Post: [ Click to Expand ]
 
Bempa68
Old
#5  
Junior Member
Thanks Meter 0
Posts: 3
Join Date: Feb 2013
Default get root access with root commander

Question to that fantastic answer above.http://forum.xda-developers.com/images/smilies/good.gif

How do I push back my modified build.prop?
I have HDC S3 Ex v2 hung in bootloop, after changing vm heapsize to 60 from 64.(Tried 128 but it didnīt stick, so tried this and it unfortunately worked)
I have managed to start in recovery mode even though itīs chinese there, donīt understand, I can communicate through Android commander to pull the files but cannot push them back due to no "root access".
I installed the "insecure ADB" via Commander but it does no good when I canīt load android.
I have no backup. It is rooted Android 4.1.2 by Fastcardtech. has busybox installed
 
HEXcube
Old
(Last edited by HEXcube; 20th February 2013 at 05:04 PM.) Reason: Added how to remount /system
#6  
HEXcube's Avatar
Senior Member
Thanks Meter 35
Posts: 113
Join Date: Aug 2012
Prompt Use su in adb shell

Use adb shell and elevate to root access by using su
Code:
su
.
Now, if you get # prompt instead of $ sign you have root on adb shell. But, still you don't have adb root. So, don't try to push the files or use Android Commander. Instead we use shell commands to do the same.
First Remount /system partition as writeable.
i.To do this first type
Code:
mount
and find out system's device name and file system from the list. In case of my device (and many Stock ICS devices) this device name would be /dev/block/mtdblock?. ? varies for each device. I had /system as mtdblock8 with ext3 file system.
ii. Now type the following command
Code:
mount -o remount,rw -t <filesys> /dev/block/mtdblock? /system
use the number you have for '?' and the filesystem for <filesys>.
Now Copy the modified file to some readable location on the device, say /sdcard or /data/local/tmp. Then copy the build.prop to /system using cat command
Code:
cat /sdcard/build.prop > /system/build.prop
Hope it works!
Offline(almost!),due to Xams.I'll be back soon to Cube the Fun.

Device List
INTEX iTab
OS - Official Android 4.0.4 Ice Cream Sandwich
Rooted! (How?)
chipset- Rockchip rk2918

Nokia 6303i Classic
OS - Nokia OS/ Series40 6th Ed
hacked/rooted/jailbroken(what do you call a nokia device with elevated privileges?)
The Following User Says Thank You to HEXcube For This Useful Post: [ Click to Expand ]
 
Bempa68
Old
#7  
Junior Member
Thanks Meter 0
Posts: 3
Join Date: Feb 2013
Default Closer...

Quote:
Originally Posted by HEXcube View Post
Use adb shell and elevate to root access by using su
Code:
su
.
Now, if you get # prompt instead of $ sign you have root on adb shell. But, still you don't have adb root. So, don't try to push the files or use Android Commander.
Copy the modified file to some readable location on the device, say /sdcard or /data/local/tmp. Then copy the build.prop to /system using cat command
Code:
cat /sdcard/build.prop > /system/build.prop
Hope it works!
Thank you! But...
After more than one hour installing android-sdk, I got the # ( I thought the shell through android-commander was the same first)
but it says Read only file system
Another thread suggested "remount rw" before pushing but thats not something adb shell recognices "not found".
Am I only missing the adress of my device when trying remount?
Any suggestions?
 
HEXcube
Old
(Last edited by HEXcube; 21st February 2013 at 08:18 AM.)
#8  
HEXcube's Avatar
Senior Member
Thanks Meter 35
Posts: 113
Join Date: Aug 2012
Default Renount /system as rw

Oh, i forgot! You've to remount /system as Read Write. I've edited the above post to include that.
You need not have installed the whole Android SDK(unless you develop for Android). It's the same adb that Android Commander or QtADB uses. You can even use adb as a standalone tool along with the required libraries(dlls on windows). Now that you have installed the Android SDK, it doesn't matter.
Offline(almost!),due to Xams.I'll be back soon to Cube the Fun.

Device List
INTEX iTab
OS - Official Android 4.0.4 Ice Cream Sandwich
Rooted! (How?)
chipset- Rockchip rk2918

Nokia 6303i Classic
OS - Nokia OS/ Series40 6th Ed
hacked/rooted/jailbroken(what do you call a nokia device with elevated privileges?)
The Following User Says Thank You to HEXcube For This Useful Post: [ Click to Expand ]
 
Bempa68
Old
#9  
Junior Member
Thanks Meter 0
Posts: 3
Join Date: Feb 2013
Talking Yes! Yes! Yes!

Quote:
Originally Posted by HEXcube View Post
Oh, i forgot! You've to remount /system as Read Write. I've edited the above post to include that.

It worked! Thank you so much! A new phone useless was really disappointing, but happy again

Set heap size back to 64. Maybe Iīll dare set it to 128 another day... The phone has horrible ram performance, hoping that would cure it.
Uninstallation of an app of 6-7 mb takes at least 45 sec. My old Blade with cyanogen does that in less than 10.

Hard part was understanding my system name /dev/block/mmcblk1p1 cause it wrote /storage/sdcard vfat after it.
I saw ext4 in other part and asssumed it was that system cause it had "ro" after it.

Thank you again. You now introduced me into some new territory. Not just flashing modded roms in recovery mode.
But I will search out one modded rom so I can overclock some.

Tags
access, adb, commander, root
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes