You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
Add several options
This commit is contained in:
@@ -350,28 +350,6 @@ public class Async {
|
||||
}
|
||||
}
|
||||
|
||||
public static class LinkBusyBox extends RootTask<Void, Void, Void> {
|
||||
|
||||
private boolean link;
|
||||
|
||||
public LinkBusyBox(boolean b) {
|
||||
link = b;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Void doInBackground(Void... voids) {
|
||||
if (link) {
|
||||
Shell.su(
|
||||
"rm -rf /magisk/.core/busybox",
|
||||
"ln -s /data/busybox /magisk/.core/busybox"
|
||||
);
|
||||
} else {
|
||||
Shell.su("rm -rf /magisk/.core/busybox");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static class MagiskHide extends RootTask<Object, Void, Void> {
|
||||
@Override
|
||||
protected Void doInBackground(Object... params) {
|
||||
|
||||
@@ -39,6 +39,9 @@ public class Shell {
|
||||
rootSTDOUT = new StreamGobbler(rootShell.getInputStream(), rootOutList, true);
|
||||
rootSTDOUT.start();
|
||||
|
||||
// Setup umask
|
||||
su("umask 022");
|
||||
|
||||
List<String> ret = su("echo -BOC-", "id");
|
||||
|
||||
if (ret == null) {
|
||||
|
||||
@@ -55,7 +55,8 @@ public class Utils {
|
||||
}
|
||||
|
||||
public static boolean createFile(String path) {
|
||||
String command = "touch " + path + " 2>/dev/null; if [ -f " + path + " ]; then echo true; else echo false; fi";
|
||||
String folder = path.substring(0, path.lastIndexOf('/'));
|
||||
String command = "mkdir -p " + folder + " 2>/dev/null; touch " + path + " 2>/dev/null; if [ -f \"" + path + "\" ]; then echo true; else echo false; fi";
|
||||
return Shell.rootAccess() && Boolean.parseBoolean(Shell.su(command).get(0));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user