diff --git a/RootTools.iml b/RootTools.iml deleted file mode 100644 index a193a56..0000000 --- a/RootTools.iml +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build.gradle b/build.gradle index b496ef4..292ac15 100644 --- a/build.gradle +++ b/build.gradle @@ -23,6 +23,11 @@ android { } } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_7 + targetCompatibility JavaVersion.VERSION_1_7 + } + buildTypes { release { runProguard false diff --git a/src/main/java/com/stericson/RootTools/RootTools.java b/src/main/java/com/stericson/RootTools/RootTools.java index 285bf36..eeb64f0 100644 --- a/src/main/java/com/stericson/RootTools/RootTools.java +++ b/src/main/java/com/stericson/RootTools/RootTools.java @@ -602,6 +602,7 @@ public static List findBinaryPaths(@NonNull final String binaryName) public static String findBinaryPath(@NonNull final String binaryName) { List binaryPaths = RootTools.findBinaryPaths(binaryName); + String[] modes = new String[] {"0755", "0775", "0777", "1755", "1775", "1777"}; if (binaryPaths.isEmpty()) { @@ -617,12 +618,10 @@ public static String findBinaryPath(@NonNull final String binaryName) if (fileStat != null) { - switch (fileStat.mode.permissions.getValue()) - { - case 755: - case 775: - case 777: + for (String mode : modes) { + if (fileStat.mode.permissions.toOctalString().equals(mode)) { return fullPath; + } } } } diff --git a/src/main/java/com/stericson/RootTools/internal/Remounter.java b/src/main/java/com/stericson/RootTools/internal/Remounter.java index e8759ab..792e06d 100644 --- a/src/main/java/com/stericson/RootTools/internal/Remounter.java +++ b/src/main/java/com/stericson/RootTools/internal/Remounter.java @@ -60,10 +60,16 @@ public boolean remount(String file, String mountType) { if (file.endsWith("/") && !file.equals("/")) { file = file.substring(0, file.lastIndexOf("/")); } + //Make sure that what we are trying to remount is in the mount list. boolean foundMount = false; while (!foundMount) { + //Check for symlinks + String symlink = RootTools.getSymlink(file); + if (symlink != null && symlink.length() > 0) { + file = symlink; + } try { for (Mount mount : RootTools.getMounts()) { RootTools.log(mount.getMountPoint().toString());