/** * @param file String that represent the file, including the full path to the file and its name. * @return File permissions as String, for example: 777, returns null on error * @throws IOException * @throws TimeoutException * @throws BrokenBusyboxException */ public String getFilePermissions(String file) throws FailedExecuteCommand, BrokenBusyboxException, IOException { Log.d(RootCommands.TAG, "Checking permissions for " + file); String permissions = null; if (fileExists(file)) { Log.d(RootCommands.TAG, file + " was found."); LsCommand lsCommand = new LsCommand(file); shell.execCommand(lsCommand); permissions = lsCommand.getPermissions(); } return permissions; }