Commit b1dbbdef authored by topjohnwu's avatar topjohnwu

Remove unneeded busybox redirection

parent 3e479726
......@@ -99,13 +99,6 @@ static void mount_mirrors() {
link_mirror(system_ext)
}
constexpr char bb_script[] = R"EOF(
#!/system/bin/sh
BB=%s
[ -x $BB ] && exec $BB "$@"
exec /data/adb/magisk/busybox.bin "$@"
)EOF";
static bool magisk_env() {
char buf[4096];
......@@ -153,20 +146,12 @@ static bool magisk_env() {
unlink("/sbin/magiskhide");
}
if (access(DATABIN "/busybox.bin", X_OK)) {
if (access(DATABIN "/busybox", X_OK))
return false;
rename(DATABIN "/busybox", DATABIN "/busybox.bin");
}
sprintf(buf, "%s/" BBPATH "/busybox", MAGISKTMP.data());
{
auto fp = open_file(DATABIN "/busybox", "we");
fprintf(fp.get(), bb_script, buf);
}
chmod(DATABIN "/busybox", 0755);
mkdir(dirname(buf), 0755);
cp_afc(DATABIN "/busybox.bin", buf);
cp_afc(DATABIN "/busybox", buf);
exec_command_async(buf, "--install", "-s", dirname(buf));
return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment