Re-add busybox

Add check for proper install, install if not.  Needed for flashing zips.
This commit is contained in:
d8ahazard
2016-09-25 02:16:10 -05:00
parent 3b0cec9db6
commit dac85757b3
2 changed files with 29 additions and 0 deletions
@@ -91,6 +91,17 @@ public class Utils {
return Boolean.parseBoolean(ret.get(0));
}
public static boolean busyboxInstalled() {
List<String> ret;
String command = "if [ -d /data/busybox ]; then echo true; else echo false; fi";
if (Shell.rootAccess()) {
ret = Shell.su(command);
} else {
ret = Shell.sh(command);
}
return Boolean.parseBoolean(ret.get(0));
}
public static boolean rootEnabled() {
List<String> ret;
String command = "if [ -z $(which su) ]; then echo false; else echo true; fi";