From 228351fc136326d225418de1893a3e5562436167 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sun, 10 Feb 2019 13:51:41 -0500 Subject: [PATCH] Prevent bootloop on non system-as-root devices Close #1058 --- native/jni/core/init.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native/jni/core/init.cpp b/native/jni/core/init.cpp index b26fc30ae..8011212a1 100644 --- a/native/jni/core/init.cpp +++ b/native/jni/core/init.cpp @@ -503,7 +503,7 @@ int main(int argc, char *argv[]) { excl_list = nullptr; } else { // Revert original init binary - link("/.backup/init", "/init"); + rename("/.backup/init", "/init"); rm_rf("/.backup"); // Do not go further if device is booting into recovery