Understanding Android file permissions


  1. BH_MAN

    BH_MAN Well-Known Member

    Understanding Android file permissions

    Overview Of Permissions via ADB SHELL
    Example = drwxrwxrwx

    To Check Permission at anytime in ADB just Type:
    ls -l

    The First character defines the Directory, Link, Binary.
    Below are some examples

    Example = d---------
    d = Directory
    l = Link
    b = Binary



    The next 9 characters define the file permissions. These permissions are
    given in groups of 3 each.

    The first 3 characters are the permissions for the owner of the file or directory.
    Example = -rwx------

    The next 3 are permissions for the group that the file is owned by.
    Example = ----rwx---

    The final 3 characters define the access permissions for everyone not part of the group.
    Example = -------rwx

    There are 3 possible attributes that make up file access permissions.

    r - Read permission. Whether the file may be read. In the case of a
    directory, this would mean the ability to list the contents of the
    directory.

    w - Write permission. Whether the file may be written to or modified. For
    a directory, this defines whether you can make any changes to the contents
    of the directory. If write permission is not set then you will not be able
    to delete, rename or create a file.

    x - Execute permission. Whether the file may be executed. In the case of a
    directory, this attribute decides whether you have permission to enter,
    run a search through that directory or execute some program from that
    directory

    In addition to the file permission, you can also modify the owner and
    group of the file. The chown program is used here and its syntax is very
    simple. You need to be the owner of a file or root to do this.

    Understanding Owner Permissions:
    The first command is for
    owner ID, the Second Command is for Group ID.
    exp.
    root.root ( First Root is owner, Second Root is Group ).

    Chmod 644 some file, Like
    Build.prop For testing & then Veiw the Resulted Changes!
    Refer to the table below as a quick reference.

    Command Line for Both would look like this


    chmod 644 build.prop = -rw-r--r--
    \/
    Chmod Guide
    0 - ---
    1 - --x
    2 - -w-
    3 - -wx
    4 - r--
    5 - r-x
    6 - rw-
    7 - rwx

    Behold 2 SH Chown Guide
    \/

    chown root.root build.prop
    root.root = Root
    root.shell = Shell

    Busybox SH Chown Guide
    \/
    chown 0.0 build.prop
    0.0 = Root
    0.2000 = Shell

    I'll update the chmod with more with More Complex Commands Later

    Side Note:Always set owner ( chown ) before Setting Permissions ( Chmod )!

    Hope this Clears up things & is Helpful to everyone
    ~BH_MAN



    Advertisement
    :
  2. bionicgrape

    bionicgrape Well-Known Member

    I'm starting to learn enough to be dangerous to my phone :D
  3. rleal2010

    rleal2010 Well-Known Member

    Still waiting for MORE complex commands lol I know I'm a bug
  4. Nu11u5

    Nu11u5 Well-Known Member Developer

  5. BH_MAN

    BH_MAN Well-Known Member

    I never had any of these issue when I worked from my Rom's..

    Just use Busybox when changing permissions.. if they don't stick, but them again I never had issue.. As you as Root via sh which lets you change permission & have them stick after a reboot.
  6. droidzone

    droidzone Well-Known Member

    Of all the resources I've searched, this is the best resource so far. Others seem to be written under the assumption that people are brought up using linux/unix
  7. droidzone

    droidzone Well-Known Member

    Edited out
  8. akbaro

    akbaro New Member

    please s1 guide me i can't process my dodo tablet. it gives error ( The process android.acore has stopped unexpectedly, please try again ) wat can i do now......?
Loading...

Share This Page