Skip to content

Commit

Permalink
Check root without busybox for all devices
Browse files Browse the repository at this point in the history
Since some manufacturers leave the busybox binary present in the rom, it's better to use [isRootedWithoutBusyBoxCheck()](https://github.com/scottyab/rootbeer#false-positives) for all devices rather than specifying certain brands to avoid false positives.
  • Loading branch information
geraintwhite committed Sep 4, 2019
1 parent d6aeee8 commit cefe9b5
Showing 1 changed file with 2 additions and 12 deletions.
Expand Up @@ -7,10 +7,6 @@

public class RootedCheck {

private static final String ONEPLUS = "oneplus";
private static final String MOTO = "moto";
private static final String XIAOMI = "xiaomi";

/**
* Checks if the device is rooted.
*
Expand All @@ -29,13 +25,7 @@ public static boolean isJailBroken(Context context) {

private static boolean rootBeerCheck(Context context) {
RootBeer rootBeer = new RootBeer(context);
Boolean rv;
final String brand = Build.BRAND.toLowerCase();
if(brand.contains(ONEPLUS) || brand.contains(MOTO) || brand.contains(XIAOMI)) {
rv = rootBeer.isRootedWithoutBusyBoxCheck();
} else {
rv = rootBeer.isRooted();
}
return rv;

return rootBeer.isRootedWithoutBusyBoxCheck();
}
}

0 comments on commit cefe9b5

Please sign in to comment.