public boolean checkSuExists() {
        Process process = null;
        try {
            process = Runtime.getRuntime().exec(new String[] { "which", BINARY_SU });
            BufferedReader in = new BufferedReader(new InputStreamReader(process.getInputStream()));
            return in.readLine() != null;
        } catch (Throwable t) {
            return false;
        } finally {
            if (process != null) process.destroy();
        }
    }
public boolean checkSuExists ( ) { Process process = null ; try { process = Runtime . getRuntime ( ) . exec ( new String [ ] { "which" , BINARY_SU } ) ; BufferedReader in = new BufferedReader ( new InputStreamReader ( process . getInputStream ( ) ) ) ; return in . readLine ( ) != null ; } catch ( Throwable t ) { return false ; } finally { if ( process != null ) process . destroy ( ) ; } }
A variation on the checking for SU, this attempts a 'which su'
@return true if su found