diff options
author | Ethan Yonker <dees_troy@teamw.in> | 2015-05-18 17:23:03 +0200 |
---|---|---|
committer | Ethan Yonker <dees_troy@teamw.in> | 2015-05-27 16:22:49 +0200 |
commit | eb32b1ff00878e7b01453450fcd04ecb9fcbba52 (patch) | |
tree | a25888903dd6c07d14afa46ccce41d1779b8e975 /twrp.cpp | |
parent | Only include uncrypt if not in system/core (diff) | |
download | android_bootable_recovery-eb32b1ff00878e7b01453450fcd04ecb9fcbba52.tar android_bootable_recovery-eb32b1ff00878e7b01453450fcd04ecb9fcbba52.tar.gz android_bootable_recovery-eb32b1ff00878e7b01453450fcd04ecb9fcbba52.tar.bz2 android_bootable_recovery-eb32b1ff00878e7b01453450fcd04ecb9fcbba52.tar.lz android_bootable_recovery-eb32b1ff00878e7b01453450fcd04ecb9fcbba52.tar.xz android_bootable_recovery-eb32b1ff00878e7b01453450fcd04ecb9fcbba52.tar.zst android_bootable_recovery-eb32b1ff00878e7b01453450fcd04ecb9fcbba52.zip |
Diffstat (limited to 'twrp.cpp')
-rw-r--r-- | twrp.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -332,13 +332,27 @@ int main(int argc, char **argv) { PartitionManager.Disable_MTP(); #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"); + } + } else { + DataManager::SetValue("tw_mount_system_ro", 0); + } + } + // 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)) { + if (PartitionManager.Mount_By_Path("/system", false) && DataManager::GetIntValue("tw_mount_system_ro") == 0) { 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); |