yinggu / mobitest-agent

Automatically exported from code.google.com/p/mobitest-agent
0 stars 0 forks source link

JellyBean can't run Superuser #11

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Flash a device or emulator with the latest JB MR
2. Install Superuser and BZAgent as usual
3. Run BZAgent and click "Poll Now"

*** What is the expected output? ***

The initial BZAgent poll should trigger a Superuser prompt to allow/deny su 
access.  The run should succeed.

*** What do you see instead? ***

The Superuser prompt never occurs.  The ProcessManager testRootPermissions "su":
    echo blah > /system/sd/temporary.txt
returns an exitValue of 1, which is incorrectly declared success (since it's != 
255).  The "su" tcpdump also silently fails.  However, the end-of-run zip fails 
because the pcap dir is empty.

The above "/system/sd/" path doesn't exist on JB or ICS.  If I change it to a 
valid path, it still fails.

*** Please use labels and text to provide additional information. ***

The Eclipse log contains:
    01-08 20:40:02.957: I/ProcessManager(1700): Testing root permissions
    01-08 20:40:02.965: E/su(1813): sudb - Opening database
    01-08 20:40:02.965: E/su(1813): sudb - Database opened
    01-08 20:40:02.965: E/su(1813): sudb - Database closed
    ...
    01-08 20:40:03.293: W/ActivityManager(402): Permission Denial: broadcast asks to run as user -1 but is calling from user 0; this requires android.permission.INTERACT_ACROSS_USERS_FULL or android.permission.INTERACT_ACROSS_USERS
    ...
   01-08 20:40:23.668: W/su(1813): request rejected (10063->0 /system/bin/sh)

A web search found the above error:
    http://forum.xda-developers.com/showthread.php?t=1989261&page=2#postmenu_34063138
The proposed workaround is to use SuperSU instead of Superuser.  I tried that 
via:
    adb install SuperSU_0_99.apk
which installed, but when I used the app to update the su binary, it failed 
with:
    Installation Failed!
This might be because I installed via "adb install" instead of the playstore:  
(untested)
    http://forum.xda-developers.com/showthread.php?t=1989261&page=4#postmenu_34154143

*** Proposal ***

testRootPermissions should detect the above "su" error.

Warn users re: JB.  Recommend ICS until we have a fix.

BZAgent should work without a Superuser-like app on rooted images, provided 
tcpdump is chmod'd appropriately. The validation should be tweaked -- make sure 
tcpdump works, as opposed to indirectly checking that su works. It's still OK 
to run via su, it's just a no op without the superuser app, but tcpdump itself 
will work if chmod'd.

Original issue reported on code.google.com by z...@google.com on 9 Jan 2013 at 4:36