public static boolean isSU(@NonNull String shell) {
      // Strip parameters
      int pos = shell.indexOf(' ');
      if (pos >= 0) {
        shell = shell.substring(0, pos);
      }

      // Strip path
      pos = shell.lastIndexOf('/');
      if (pos >= 0) {
        shell = shell.substring(pos + 1);
      }

      return shell.equals("su");
    }
Attempts to deduce if the shell command refers to a su shell

@param shell
    Shell command to run
@return Shell command appears to be su
imitate/src/main/java/com/engineer/imitate/shell/Shell.java