From c7c4341ed7b1823963989040219471a542d9afed Mon Sep 17 00:00:00 2001 From: Dees_Troy Date: Tue, 2 Oct 2012 23:03:01 -0400 Subject: Rename stock recovery file --- recovery.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/recovery.cpp b/recovery.cpp index 2459650f3..de6e10019 100644 --- a/recovery.cpp +++ b/recovery.cpp @@ -946,6 +946,10 @@ main(int argc, char **argv) { 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(); -- cgit v1.2.3