Superuser
Superuser copied to clipboard
Only works when adb is enabled
I am running CyanogenMod 7 on an HTC G2. When adb over USB is enabled in Settings/Applications/Development, superuser works just fine. However, when adb is disabled there is trouble.
When Root Explorer is run, I get the popup "Root Explorer has been granted superuser permissions" but then after a couple of seconds I get "Root Explorer hos not yet managed to get root access" and the app exits.
From Android Terminal, when I run su (actually, I set the shell to be "/system/xbin/su root -c bash") the command just hangs until I press ctrl-C. After pressing ctrl-C, I am dropped to the root shell. Running "ps fauxww" from Debian chroot, I see that su is apparently stuck when running "am broadcast". I'll attach the logs and ps results.
logcat output when running /system/xbin/su and then hitting ctrl-C:
--------- beginning of /dev/log/main
E/su ( 5945): sudb - Opening database
E/su ( 5945): sudb - Database opened
E/su ( 5945): sudb - Database closed
I/Term ( 5542): waiting for: 5945
--------- beginning of /dev/log/system
W/InputManagerService( 1352): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@40a29750
D/AndroidRuntime( 5947):
D/AndroidRuntime( 5947): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
I/AndroidRuntime( 5947): Heap size: -Xmx32m
D/AndroidRuntime( 5947): CheckJNI is OFF
D/dalvikvm( 5947): creating instr width table
D/AndroidRuntime( 5947): Calling main entry com.android.commands.am.Am
D/AndroidRuntime( 5947): Shutting down VM
D/dalvikvm( 5947): GC_CONCURRENT freed 101K, 68% free 327K/1024K, external 0K/0K, paused 1ms+0ms
I/AndroidRuntime( 5947): NOTE: attach of thread 'Binder Thread #2' failed
D/su ( 5945): 10075 jackpal.androidterm executing 0 /system/bin/sh using shell /system/bin/sh : sh -c bash
D/dalvikvm( 1932): GC_EXPLICIT freed 555K, 39% free 5339K/8711K, external 0K/0K, paused 59ms
D/dalvikvm( 1961): GC_CONCURRENT freed 399K, 51% free 2936K/5959K, external 943K/958K, paused 2ms+2ms
D/dalvikvm( 1961): GC_EXTERNAL_ALLOC freed 14K, 51% free 2922K/5959K, external 415K/927K, paused 21ms
And this appeared in ps fauxx
:
10078 5916 0.0 0.0 760 344 ? S 01:08 0:00 /system/bin/sh
10078 5918 0.0 0.1 648 452 ? S 01:08 0:00 \_ su
10078 5919 0.0 0.0 756 328 ? S 01:08 0:00 \_ sh -c /system/bin/am broadcast -a 'com.noshufou.android.su.RESULT' --es socket '' --ei caller_uid '10078' --ei allow '1' --ei version_code '17' > /dev/null
10078 5920 0.2 3.3 77472 12804 ? Sl 01:08 0:00 \_ app_process /system/bin com.android.commands.am.Am broadcast -a com.noshufou.android.su.RESULT --es socket --ei caller_uid 10078 --ei allow 1 --ei version_code 17
see commit su-binary:dbe124982f950db932999cac1bfa57442ab91ea7 (it's in the gc branch).