Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix development options and adb detect #179

Open
wants to merge 1 commit into
base: 3.0beta
Choose a base branch
from
Open
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
28 changes: 27 additions & 1 deletion app/src/main/java/com/devadvance/rootcloak2/RootCloak.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public void handleLoadPackage(final LoadPackageParam lpparam) throws Throwable {
initRuntime(lpparam);
initProcessBuilder(lpparam);
initSettingsGlobal(lpparam);
initSettingsSecure(lpparam);
}
}

Expand Down Expand Up @@ -609,7 +610,32 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
}
}

if (Settings.Global.DEVELOPMENT_SETTINGS_ENABLED.equals(setting)) { // Hide development options being on from an app
if (Settings.Global.ADB_ENABLED.equals(setting)) { // Hide development options being on from an app
param.setResult(0);
if (debugPref) {
XposedBridge.log("Hooked development options info, development options status is off");
}
}
}
});
}

private void initSettingsSecure(final LoadPackageParam lpparam) {
// Hooks android.provider.Settings.Secure.getInt. For this method we will prevent the package info from being obtained for any app in the lis
findAndHookMethod(android.provider.Settings.Secure.class, "getInt", ContentResolver.class, String.class, int.class, new XC_MethodHook() {
@Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {

String setting = (String) param.args[1];
if (setting == null) return;
if (Settings.Secure.ADB_ENABLED.equals(setting)) { // Hide ADB being on from an app
param.setResult(0);
if (debugPref) {
XposedBridge.log("Hooked ADB debugging info, adb status is off");
}
}

if (Settings.Secure.DEVELOPMENT_SETTINGS_ENABLED.equals(setting)) { // Hide development options being on from an app
param.setResult(0);
if (debugPref) {
XposedBridge.log("Hooked development options info, development options status is off");
Expand Down