1. Download our Official Android App: Forums for Android!

Mods Android permissions w.r.t linux groups

Discussion in 'Android Development' started by popya, Jan 14, 2014.

  1. popya

    popya Lurker
    Thread Starter
    Rank:
    None
    Points:
    26
    Posts:
    4
    Joined:
    Jan 14, 2014

    Jan 14, 2014
    4
    3
    26
    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!
     

    Advertisement

  2. iowabowtech

    iowabowtech root@android:/ #
    Rank:
    None
    Points:
    1,493
    Posts:
    12,182
    Joined:
    May 2, 2010

    May 2, 2010
    12,182
    8,680
    1,493
    Making the Establishment nervous
    Iowa|USA
    scary alien likes this.
  3. popya

    popya Lurker
    Thread Starter
    Rank:
    None
    Points:
    26
    Posts:
    4
    Joined:
    Jan 14, 2014

    Jan 14, 2014
    4
    3
    26
    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.
     
    scary alien and iowabowtech like this.
  4. iowabowtech

    iowabowtech root@android:/ #
    Rank:
    None
    Points:
    1,493
    Posts:
    12,182
    Joined:
    May 2, 2010

    May 2, 2010
    12,182
    8,680
    1,493
    Making the Establishment nervous
    Iowa|USA
    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? :thinking:

    /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.
     
    scary alien likes this.

Share This Page

Loading...