Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

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
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
u0_a5
app_5@android:/ $ groups
u0_a5

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?

share|improve this question
add comment

1 Answer

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.

share|improve this answer
1  
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 '13 at 7:48
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.