Fix MagiskHide startup issue

This commit is contained in:
topjohnwu
2017-02-07 06:02:06 +08:00
parent 51b22d1ad4
commit 22a5c11f0d
10 changed files with 55 additions and 22 deletions
@@ -132,6 +132,13 @@ public class Shell {
process = Runtime.getRuntime().exec("su");
STDIN = new DataOutputStream(process.getOutputStream());
STDOUT = new StreamGobbler(process.getInputStream(), res);
// Run the new shell with busybox and proper umask
STDIN.write(("umask 022\n").getBytes("UTF-8"));
STDIN.flush();
STDIN.write(("PATH=`[ -e /dev/busybox ] && echo /dev/busybox || " +
"echo /data/busybox`:$PATH\n").getBytes("UTF-8"));
STDIN.flush();
} catch (IOException err) {
return null;
}