• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Mods Android permissions w.r.t linux groups

popya

Lurker
Hi all,
I have been playing around with Nexus 7 with AOSP 4.4. I have added USB flash support with minor changes. Referred: Typical Configuration Examples | Android Developers

However I with these changes apps don't have write permission to /storage/sdcard1

So I decided to provided write access to /storage/sdcard1.

Simple solution is to modify platform.xml and add "media_rw" group for android.permission.WRITE_EXTERNAL_STORAGE permission.

Hard ways is to put all apps in media_rw group before they are started:
Now as we know that this permission is based on linux-groups (reference) I decided to manually add this media_rw (gid=1023) group to list of group ids before an application starts. This can be done in startProcessLocked() of ActivityManagerService.java. Now process is member of media_rw group. Still it can not access /storage/sdcard1/. I checked this from java code as well as native library.
Anybody knows why is this behavior? Am I missing something?

Thanks!
 
Thanks iowabowtech for useful link.
But currently I am not worried about different ways google is behaving with SD-cards.

I am trying to understand permissions. I thought adding an application process (Lets say ES file explorer) into media_rw group (1023) would give it write access to /storage/sdcard1. Somehow this isn't working out. Trying to understand what else is blocking the access.
 
I just found out about this issue today between your post and the linked thread. I'm no coding expert by any means but I've been trying to investigate API 19 and glean what I can. If I'm getting this right, it seems what Chainfire and others were talking about was back in 2012 whereas now, a full enforcement of writing to secondary external storage is underway.

I may have just rehashed what you already know there but yeah, it seems there may be a deeper level change necessary than modifying the platform.xml that seems may have worked in API level 16-18. I just don't know yet what that is. I'm not sure anybody does? :confused:

/still investigating

Sorry for the lack of detail earlier. I see where you're at now. Took me awhile to get onto what's going on here. I asked Medion in that thread if he knows what the ES devs were planning as a root workaround. He may have some insight.
 
Back
Top Bottom