diff options
author | Ethan Yonker <dees_troy@teamw.in> | 2015-06-04 18:30:02 +0200 |
---|---|---|
committer | Dees Troy <dees_troy@teamw.in> | 2015-06-09 21:45:07 +0200 |
commit | 0e2c657cc8cff51044af11d82352d1bfef9957c3 (patch) | |
tree | 618c4a8f6c52a2a291a292f17eaa7e0afbe215f8 /twrp.cpp | |
parent | avoid possible dead loop for invalid utf8 (diff) | |
download | android_bootable_recovery-0e2c657cc8cff51044af11d82352d1bfef9957c3.tar android_bootable_recovery-0e2c657cc8cff51044af11d82352d1bfef9957c3.tar.gz android_bootable_recovery-0e2c657cc8cff51044af11d82352d1bfef9957c3.tar.bz2 android_bootable_recovery-0e2c657cc8cff51044af11d82352d1bfef9957c3.tar.lz android_bootable_recovery-0e2c657cc8cff51044af11d82352d1bfef9957c3.tar.xz android_bootable_recovery-0e2c657cc8cff51044af11d82352d1bfef9957c3.tar.zst android_bootable_recovery-0e2c657cc8cff51044af11d82352d1bfef9957c3.zip |
Diffstat (limited to 'twrp.cpp')
-rw-r--r-- | twrp.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
@@ -333,16 +333,22 @@ int main(int argc, char **argv) { #endif // Check if system has never been changed - if (DataManager::GetIntValue("tw_mount_system_ro") != 0 && DataManager::GetIntValue("tw_never_show_system_ro_page") == 0) { - TWPartition* sys = PartitionManager.Find_Partition_By_Path("/system"); - if (sys && sys->Check_Lifetime_Writes() == 0) { - LOGINFO("System writes is 0, show system_readonly page\n"); - DataManager::SetValue("tw_back", "main"); - if (gui_startPage("system_readonly", 1, 1) != 0) { - LOGERR("Failed to start system_readonly GUI page.\n"); + TWPartition* sys = PartitionManager.Find_Partition_By_Path("/system"); + if (sys) { + if (DataManager::GetIntValue("tw_mount_system_ro") != 0) { + if (sys->Check_Lifetime_Writes() == 0) { + if (DataManager::GetIntValue("tw_never_show_system_ro_page") == 0) { + DataManager::SetValue("tw_back", "main"); + if (gui_startPage("system_readonly", 1, 1) != 0) { + LOGERR("Failed to start system_readonly GUI page.\n"); + } + } + } else { + DataManager::SetValue("tw_mount_system_ro", 0); + sys->Change_Mount_Read_Only(false); } } else { - DataManager::SetValue("tw_mount_system_ro", 0); + sys->Change_Mount_Read_Only(false); } } |