public boolean checkForRWPaths(){
  boolean result=false;
  String[] lines=mountReader();
  for (  String line : lines) {
    String[] args=line.split(" ");
    if (args.length < 4) {
      QLog.e("Error formatting mount line: " + line);
      continue;
    }
    String mountPoint=args[1];
    String mountOptions=args[3];
    for (    String pathToCheck : Const.pathsThatShouldNotBeWrtiable) {
      if (mountPoint.equalsIgnoreCase(pathToCheck)) {
        for (        String option : mountOptions.split(",")) {
          if (option.equalsIgnoreCase("rw")) {
            QLog.v(pathToCheck + " path is mounted with rw permissions! " + line);
            result=true;
            break;
          }
        }
      }
    }
  }
  return result;
}

public boolean checkForRWPaths ( ) { boolean result = false ; String [ ] lines = mountReader ( ) ; for ( String line : lines ) { String [ ] args = line . split ( " " ) ; if ( args . length < 4 ) { QLog . e ( "Error formatting mount line: " + line ) ; continue ; } String mountPoint = args [ 1 ] ; String mountOptions = args [ 3 ] ; for ( String pathToCheck : Const . pathsThatShouldNotBeWrtiable ) { if ( mountPoint . equalsIgnoreCase ( pathToCheck ) ) { for ( String option : mountOptions . split ( "," ) ) { if ( option . equalsIgnoreCase ( "rw" ) ) { QLog . v ( pathToCheck + " path is mounted with rw permissions! " + line ) ; result = true ; break ; } } } } } return result ; }
when you ' re root you can change the permissions on common system directories , this method checks if any of these patha const . pathsthatshouldnotbewrtiable are writable .
