java.io.IOException: Error running exec(). Command: [/system/xbin/su] Working Directory: null Environment: null
``
public SerialPort(File device, int baudrate, int flags) throws SecurityException, IOException {
if (!(device.canRead() && device.canWrite())) {
try {
Process su = Runtime.getRuntime().exec("/system/bin/su");
su.getOutputStream().write(new StringBuilder("chmod 06755 ").append(device.getAbsolutePath()).append("\n").append("exit\n").toString().getBytes());
if (!(su.waitFor() == 0 && device.canRead() && device.canWrite())) {
throw new SecurityException();
}
} catch (Exception e) {
e.printStackTrace();
throw new SecurityException();
}
}