From 9132d9125314874957f5565c194727ab4ce66733 Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Mon, 2 Feb 2015 10:32:49 -0600 Subject: Disable stock recovery replacing TWRP during ORS -Create a separate function to disable stock recovery flashing -Add a call to that function to the reboot section of the ORS action so that an OTA update will not inadvertantly replace TWRP Change-Id: I43eae81e0e76971b6e8d34c38785dc73772242d2 --- twrp.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'twrp.cpp') diff --git a/twrp.cpp b/twrp.cpp index 4a8b1fbf1..ef694bf24 100644 --- a/twrp.cpp +++ b/twrp.cpp @@ -337,13 +337,10 @@ int main(int argc, char **argv) { // Launch the main GUI gui_start(); + // Disable flashing of stock recovery + TWFunc::Disable_Stock_Recovery_Replace(); // Check for su to see if the device is rooted or not if (PartitionManager.Mount_By_Path("/system", false)) { - // Disable flashing of stock recovery - if (TWFunc::Path_Exists("/system/recovery-from-boot.p")) { - rename("/system/recovery-from-boot.p", "/system/recovery-from-boot.bak"); - gui_print("Renamed stock recovery file in /system to prevent\nthe stock ROM from replacing TWRP.\n"); - } if (TWFunc::Path_Exists("/supersu/su") && !TWFunc::Path_Exists("/system/bin/su") && !TWFunc::Path_Exists("/system/xbin/su") && !TWFunc::Path_Exists("/system/bin/.ext/.su")) { // Device doesn't have su installed DataManager::SetValue("tw_busy", 1); -- cgit v1.2.3