Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/src/main/java/com/devadvance/rootcloak2/DefaultLists.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class DefaultLists {
"root", "busybox", "titanium",
".tmpsu", "su", "rootcloak2"};

public static final String[] DEFAULT_COMMAND_LIST = new String[]{"su", "which", "busybox", "pm", "am", "sh", "ps"};
public static final String[] DEFAULT_COMMAND_LIST = new String[]{"su", "which", "busybox", "pm", "am", "sh", "ps", "getprop"};

public static final String[] DEFAULT_LIBNAME_LIST = new String[]{"tool-checker"}; // RootBearNative
public static final String[] DEFAULT_LIBNAME_LIST = new String[]{}; // off
}
23 changes: 19 additions & 4 deletions app/src/main/java/com/devadvance/rootcloak2/RootCloak.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam;
import de.robv.android.xposed.callbacks.XCallback;


import static de.robv.android.xposed.XposedHelpers.findAndHookMethod;
import static de.robv.android.xposed.XposedHelpers.findConstructorExact;

Expand Down Expand Up @@ -101,12 +100,12 @@ private void initOther(final LoadPackageParam lpparam) {
}
}

// Tell the app that SELinux is enforcing, even if it is not.
// Tell the app that SELinux is disabled
findAndHookMethod("android.os.SystemProperties", lpparam.classLoader, "get", String.class, new XC_MethodHook() {
@Override
protected void beforeHookedMethod(XC_MethodHook.MethodHookParam param) throws Throwable {
if (((String) param.args[0]).equals("ro.build.selinux")) {
param.setResult("1");
param.setResult("");
if (debugPref) {
XposedBridge.log("SELinux is enforced.");
}
Expand All @@ -128,6 +127,20 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
}
}
});

// RootBear checkForRoot hook
try {
findAndHookMethod("com.scottyab.rootbeer.RootBeerNative", lpparam.classLoader, "checkForRoot",
Object[].class,
new XC_MethodHook() {
@Override
public void beforeHookedMethod(MethodHookParam param) throws Throwable {
param.setResult(0);
}
});
} catch (XposedHelpers.ClassNotFoundError e) {
e.printStackTrace();
}
}

/**
Expand Down Expand Up @@ -248,7 +261,7 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable { // Ho
}

List<ApplicationInfo> packages = (List<ApplicationInfo>) param.getResult(); // Get the results from the method call
Iterator<ApplicationInfo> iter = packages.iterator();
Iterator<ApplicationInfo> iter = packages.iterator();
ApplicationInfo tempAppInfo;
String tempPackageName;

Expand Down Expand Up @@ -519,6 +532,8 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
param.setThrowable(new IOException());
} else if (commandSet.contains("sh") && (firstParam.equals("sh") || firstParam.endsWith("/sh"))) {
param.setThrowable(new IOException());
} else if (commandSet.contains("getprop") && (firstParam.equals("getprop") || firstParam.endsWith("/getprop"))) {
param.setResult(Runtime.getRuntime().exec("echo"));
} else {
param.setThrowable(new IOException());
}
Expand Down