Yaroslav Mytkalyk Yaroslav Mytkalyk - 9 months ago 61
Android Question

How to obtain file permission using roottools

I want to obtain linux file permissions without parsing ls -l.
Since I will be using RootTools, I see it has a Permissions class, but how should I obtain permission data of a File into that object?

Answer Source

RootToolsInternalMethods have getPermissions(String) method, but they can only be accessed in RootTools class

From RootTools source

private static final RootToolsInternalMethods getInternals() {
    if (rim == null) {
        return rim;
    } else {
        return rim;

Seems like I have to modify RootTools source and get the permissions from ls -l output

getInternals().getPermissions("ls -l output line");