diff --git a/src/com/cyanogenmod/filemanager/console/shell/ShellConsole.java b/src/com/cyanogenmod/filemanager/console/shell/ShellConsole.java index 86542ce6c..fb3b5075b 100644 --- a/src/com/cyanogenmod/filemanager/console/shell/ShellConsole.java +++ b/src/com/cyanogenmod/filemanager/console/shell/ShellConsole.java @@ -299,12 +299,20 @@ public final void alloc() throws ConsoleAllocException { 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) {