summaryrefslogtreecommitdiffstats
path: root/twrp-functions.cpp
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2015-02-02 17:32:49 +0100
committerDees Troy <dees_troy@teamw.in>2015-02-02 18:23:25 +0100
commit9132d9125314874957f5565c194727ab4ce66733 (patch)
tree74fd8541c10feb8056ec092b106cb8c12f197664 /twrp-functions.cpp
parentAllow wiping f2fs to reserve space for a crypto footer (diff)
downloadandroid_bootable_recovery-9132d9125314874957f5565c194727ab4ce66733.tar
android_bootable_recovery-9132d9125314874957f5565c194727ab4ce66733.tar.gz
android_bootable_recovery-9132d9125314874957f5565c194727ab4ce66733.tar.bz2
android_bootable_recovery-9132d9125314874957f5565c194727ab4ce66733.tar.lz
android_bootable_recovery-9132d9125314874957f5565c194727ab4ce66733.tar.xz
android_bootable_recovery-9132d9125314874957f5565c194727ab4ce66733.tar.zst
android_bootable_recovery-9132d9125314874957f5565c194727ab4ce66733.zip
Diffstat (limited to 'twrp-functions.cpp')
-rw-r--r--twrp-functions.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/twrp-functions.cpp b/twrp-functions.cpp
index f5bf1b0f0..55f795c6f 100644
--- a/twrp-functions.cpp
+++ b/twrp-functions.cpp
@@ -864,7 +864,7 @@ void TWFunc::Fixup_Time_On_Boot()
}
- LOGINFO("TWFunc::Fixup_Time: will attempt to use the ats files now.\n", sepoch.c_str());
+ LOGINFO("TWFunc::Fixup_Time: will attempt to use the ats files now.\n");
// Devices with Qualcomm Snapdragon 800 do some shenanigans with RTC.
// They never set it, it just ticks forward from 1970-01-01 00:00,
@@ -1038,4 +1038,16 @@ std::string TWFunc::to_string(unsigned long value) {
return os.str();
}
+void TWFunc::Disable_Stock_Recovery_Replace(void) {
+ 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");
+ sync();
+ }
+ PartitionManager.UnMount_By_Path("/system", false);
+ }
+}
+
#endif // ndef BUILD_TWRPTAR_MAIN