Skip to content

Commit 54fa570

Browse files
authored
Use libsuperuser API
1 parent de44e5b commit 54fa570

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

app/src/main/java/com/devadvance/rootcloak2/NativeRootDetectionReceiver.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ private void applyNativeHooks(Context context) {
6565

6666
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
6767
// Allowing wrapping on Lollipop and newer
68-
mRootShell.runCommand("supolicy --live 'allow untrusted_app zygote fifo_file { write }'");
68+
WrappingSELinuxPolicy policy = new WrappingSELinuxPolicy();
69+
policy.inject();
6970
}
7071
}
7172
}
@@ -112,6 +113,13 @@ private void upgradeLibrary(Context context) {
112113
mRootShell.runCommand("cp '" + library + "' /data/local/");
113114
mRootShell.runCommand("chmod 755 /data/local/librootcloak.so");
114115
}
115-
116-
116+
117+
private class WrappingSELinuxPolicy extends eu.chainfire.libsuperuser.Policy {
118+
@Override
119+
protected String[] getPolicies() {
120+
return new String[]{
121+
"allow untrusted_app zygote fifo_file { write }"
122+
};
123+
}
124+
}
117125
}

0 commit comments

Comments
 (0)