It's well-known that every Android app is its own user. I have Android Terminal Emulator installed as user u0_a5.

u0_a5@android:/ $ whoami
u0_a5@android:/ $ groups
u0_a5 sdcard_rw sdcard_r inet all_a5

Under adb, any attempt to use the su command to log in as Android Terminal Emulator only partly succeeds. As the following adb session shows, the permission groups that Android Terminal Emulator belongs to aren't inherited, except for the default user u0_a5 group.

root@android:/ # su - u0_a5
Unknown id: u0_a5
1|root@android:/ # su - 10005
app_5@android:/ $ whoami
app_5@android:/ $ groups

As user 10005 I can delete files owned by user u0_a5. But I can't execute commands that require special Android permissions, such as "busybox wget protocol://some.uri", which requires an app to belong to the inet group.

So is there a way to impersonate and run an app under its specific permissions environment? Or is running with full root permissions my only (non)choice?

1 Answer 1


Yup using root is the only way to go.

All other groups or username are locked in userland of Android by a technique known as sandboxing. This is security feature implemented at the core so you will need to rework Android if you still want to succeed.

  • 2
    That "sandboxing" keeps one app from accessing another apps data etc., true. But once one becomes root, this does no longer matter (root can enter any sandbox). So the really interesting question is: why can't root enter a sandbox, and then "give up" all extra permissions but those belonging to this sandbox? This would be what the OP targets at.
    – Izzy
    Mar 19, 2013 at 7:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .