From 9929e7d8e8d0dca3a55a83b9ff36d69189a91286 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 8 Jun 2018 22:58:00 +0200 Subject: [PATCH] Remove update file on boot It's not important to check the return value of unlink(2) or even verify that the file exists. If this code is running, it means the system has rebooted, and thus the update file, if any, should be removed so that MagiskManager doesn't keep displaying the same message. We also handle this before we handle "disable" so that disabled modules don't keep requesting a reboot to update. --- native/jni/core/bootstages.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/native/jni/core/bootstages.c b/native/jni/core/bootstages.c index 890698921..1bce7cbce 100644 --- a/native/jni/core/bootstages.c +++ b/native/jni/core/bootstages.c @@ -432,6 +432,8 @@ static int prepare_img() { rm_rf(buf); continue; } + snprintf(buf, PATH_MAX, "%s/%s/update", MOUNTPOINT, entry->d_name); + unlink(buf); snprintf(buf, PATH_MAX, "%s/%s/disable", MOUNTPOINT, entry->d_name); if (access(buf, F_OK) == 0) continue;