diff options
| author | Jorge Ruesga <jorge@ruesga.com> | 2012-12-16 02:31:38 +0100 |
|---|---|---|
| committer | Jorge Ruesga <jorge@ruesga.com> | 2012-12-16 02:49:18 +0100 |
| commit | 995e39a70e2bb091a47447a6dfdd606dd1b999df (patch) | |
| tree | 4a075019c1cd6cb9d8034af435b609cf674c0bb3 | |
| parent | 64aa1f4cbff99479927b356d78079285f294ab47 (diff) | |
| download | android_packages_apps_CMFileManager-995e39a70e2bb091a47447a6dfdd606dd1b999df.tar.gz android_packages_apps_CMFileManager-995e39a70e2bb091a47447a6dfdd606dd1b999df.tar.bz2 android_packages_apps_CMFileManager-995e39a70e2bb091a47447a6dfdd606dd1b999df.zip | |
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
| -rw-r--r-- | src/com/cyanogenmod/filemanager/console/shell/ShellConsole.java | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/com/cyanogenmod/filemanager/console/shell/ShellConsole.java b/src/com/cyanogenmod/filemanager/console/shell/ShellConsole.java index 86542ce6..fb3b5075 100644 --- a/src/com/cyanogenmod/filemanager/console/shell/ShellConsole.java +++ b/src/com/cyanogenmod/filemanager/console/shell/ShellConsole.java @@ -299,12 +299,20 @@ public abstract class ShellConsole extends Console implements Program.ProgramLis getExecutableFactory().newCreator().createIdentityExecutable(); execute(identityCmd); this.mIdentity = identityCmd.getResult(); - if (this.mIdentity.getGroups().size() == 0) { - //Try with groups - GroupsExecutable groupsCmd = - getExecutableFactory().newCreator().createGroupsExecutable(); - execute(groupsCmd); - this.mIdentity.setGroups(groupsCmd.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 = + getExecutableFactory().newCreator().createGroupsExecutable(); + execute(groupsCmd); + this.mIdentity.setGroups(groupsCmd.getResult()); + } + } catch (Exception ex) { + Log.w(TAG, "Groups command failed. Ignored.", ex); } } catch (Exception ex) { |
