Support Magisk Manager boot image file patch

This commit is contained in:
topjohnwu
2017-08-31 03:08:09 +08:00
parent 189c671ce2
commit f63af0601c
3 changed files with 21 additions and 15 deletions

View File

@@ -553,18 +553,17 @@ void post_fs_data(int client) {
char *bin_path = NULL;
if (access("/cache/data_bin", F_OK) == 0)
bin_path = "/cache/data_bin";
else if (access("/data/local/tmp/magisk_inject", F_OK) == 0)
bin_path = "/data/local/tmp/magisk_inject";
else if (access("/data/data/com.topjohnwu.magisk/install", F_OK) == 0)
bin_path = "/data/data/com.topjohnwu.magisk/install";
if (bin_path) {
exec_command_sync("rm", "-rf", DATABIN, NULL);
exec_command_sync("cp", "-r", bin_path, DATABIN, NULL);
exec_command_sync("rm", "-rf", bin_path, NULL);
exec_command_sync("chmod", "-R", "755", bin_path, NULL);
// Lazy.... use shell blob to match files
exec_command_sync("sh", "-c", "mv /data/magisk/stock_boot* /data", NULL);
}
// Lazy.... use shell blob to match files
exec_command_sync("sh", "-c", "mv /data/magisk/stock_boot* /data", NULL);
// Link busybox
mount_mirrors();
link_busybox();