Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 995e39a7 authored by Jorge Ruesga's avatar Jorge Ruesga
Browse files

CMFileManager: Make groups command optional

Groups command command is causing problems on some implementations (maybe toolbox?)
which don't recognize the root AID and returns an error, and avoid to get root access.

Patchset 2: Fix typo

Change-Id: Idc17b18c34b8be263a1739dbad2921f60101fa09
parent 64aa1f4c
Loading
Loading
Loading
Loading
+14 −6
Original line number Diff line number Diff line
@@ -299,6 +299,11 @@ public abstract class ShellConsole extends Console implements Program.ProgramLis
                    getExecutableFactory().newCreator().createIdentityExecutable();
            execute(identityCmd);
            this.mIdentity = identityCmd.getResult();
            // Identity command is required for root console detection,
            // but Groups command is not used for now. Also, this command is causing
            // problems on some implementations (maybe toolbox?) which don't
            // recognize the root AID and returns an error. Safely ignore on error.
            try {
                if (this.mIdentity.getGroups().size() == 0) {
                    //Try with groups
                    GroupsExecutable groupsCmd =
@@ -306,6 +311,9 @@ public abstract class ShellConsole extends Console implements Program.ProgramLis
                    execute(groupsCmd);
                    this.mIdentity.setGroups(groupsCmd.getResult());
                }
            } catch (Exception ex) {
                Log.w(TAG, "Groups command failed. Ignored.", ex);
            }

        } catch (Exception ex) {
            try {