Skip to content

Commit

Permalink
Change paths and added Magisk check to 2 methods
Browse files Browse the repository at this point in the history
  • Loading branch information
altvnv committed Mar 16, 2018
1 parent 1853c45 commit bfba456
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ protected Boolean doInBackground(Boolean... params) {
mIsCheck = Utils.isSelinuxFlagInEnabled();
Log.d(TAG, "Selinux Flag Is Enabled " + (mIsCheck ? "true" : "false"));
break;
case 89:
mIsCheck = check.checkForMagiskBinary();
Log.d(TAG, "Magisk " + (mIsCheck ? "deteced" : "not deteced"));
break;
}
publishProgress(i);
}
Expand Down
5 changes: 3 additions & 2 deletions rootbeerlib/src/main/java/com/scottyab/rootbeer/Const.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ private Const() throws InstantiationException {
"/system/sd/xbin/",
"/system/usr/we-need-root/",
"/system/xbin/",
"/cache/magisk",
"/data/busybox"
"/cache",
"/data",
"/dev"
};


Expand Down
11 changes: 8 additions & 3 deletions rootbeerlib/src/main/java/com/scottyab/rootbeer/RootBeer.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public boolean isRooted() {

return detectRootManagementApps() || detectPotentiallyDangerousApps() || checkForBinary("su")
|| checkForBinary("busybox") || checkForDangerousProps() || checkForRWPaths()
|| detectTestKeys() || checkSuExists() || checkForRootNative();
|| detectTestKeys() || checkSuExists() || checkForRootNative() || checkForMagiskBinary();
}

/**
Expand All @@ -54,7 +54,7 @@ public boolean isRootedWithoutBusyBoxCheck() {

return detectRootManagementApps() || detectPotentiallyDangerousApps() || checkForBinary("su")
|| checkForDangerousProps() || checkForRWPaths()
|| detectTestKeys() || checkSuExists() || checkForRootNative();
|| detectTestKeys() || checkSuExists() || checkForRootNative() || checkForMagiskBinary();
}

/**
Expand Down Expand Up @@ -143,7 +143,6 @@ public boolean detectRootCloakingApps(String[] additionalRootCloakingApps) {
return isAnyPackageFromListInstalled(packages);
}


/**
* Checks various (Const.suPaths) common locations for the SU binary
* @return true if found
Expand All @@ -152,6 +151,12 @@ public boolean checkForSuBinary(){
return checkForBinary("su");
}

/**
* Checks various (Const.suPaths) common locations for the Magisk binary
* @return true if found
*/
public boolean checkForMagiskBinary(){ return checkForBinary("magisk"); }

/**
* Checks various (Const.suPaths) common locations for the busybox binary (a well know root level program)
* @return true if found
Expand Down

0 comments on commit bfba456

Please sign in to comment.