Rename stock recovery file
diff --git a/recovery.cpp b/recovery.cpp
index 2459650..de6e100 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -946,6 +946,10 @@
if (status != INSTALL_SUCCESS /*|| ui->IsTextVisible()*/) {
finish_recovery(NULL);
DataManager_ReadSettingsFile();
+ if (PartitionManager.Mount_By_Path("/system", false) && TWFunc::Path_Exists("/system/recovery-from-boot.p")) {
+ system("mv /system/recovery-from-boot.p /system/recovery-from-boot.bak");
+ ui_print("Renamed stock recovery file in /system to prevent\nthe stock ROM from replacing TWRP.\n");
+ }
if (DataManager_GetIntValue(TW_IS_ENCRYPTED) == 0 && OpenRecoveryScript::check_for_script_file()) {
gui_console_only();
OpenRecoveryScript::run_script_file();