From 954601904a5da6a1d7d606b2f067d2b3d574c741 Mon Sep 17 00:00:00 2001 From: Matt Mower Date: Wed, 18 Nov 2015 10:31:33 -0600 Subject: Fix short circuit on tw_mount_system_ro Before mounting /system to check if supersu should be installed (a feature which really needs to be stripped from TWRP), check if tw_mount_system_ro is set to zero, not the other way around. Change-Id: I38386b4c88fab112de5b6b752ecd4eed308efa5a --- twrp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'twrp.cpp') diff --git a/twrp.cpp b/twrp.cpp index ff7d55fcb..d49ae801c 100644 --- a/twrp.cpp +++ b/twrp.cpp @@ -375,7 +375,7 @@ int main(int argc, char **argv) { // 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) && DataManager::GetIntValue("tw_mount_system_ro") == 0) { + if (DataManager::GetIntValue("tw_mount_system_ro") == 0 && PartitionManager.Mount_By_Path("/system", false)) { if (TWFunc::Path_Exists("/supersu/su") && TWFunc::Path_Exists("/system/bin") && !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