twrp: use ANDROID_ROOT environment variable

instead of hard-coded /system path

I updated most of the references I found,
but there might be more

For devices that have to mount system at /system_root,
this allows system to be bind mounted to /system
and detected properly by TWRP

Change-Id: I9f142fd8cec392f5b88e95476258dab9c21a9aac
diff --git a/gui/action.cpp b/gui/action.cpp
index fb05d77..d708dd4 100644
--- a/gui/action.cpp
+++ b/gui/action.cpp
@@ -1819,14 +1819,14 @@
 int GUIAction::mountsystemtoggle(std::string arg)
 {
 	int op_status = 0;
-	bool remount_system = PartitionManager.Is_Mounted_By_Path("/system");
+	bool remount_system = PartitionManager.Is_Mounted_By_Path(PartitionManager.Get_Android_Root_Path());
 	bool remount_vendor = PartitionManager.Is_Mounted_By_Path("/vendor");
 
 	operation_start("Toggle System Mount");
-	if (!PartitionManager.UnMount_By_Path("/system", true)) {
+	if (!PartitionManager.UnMount_By_Path(PartitionManager.Get_Android_Root_Path(), true)) {
 		op_status = 1; // fail
 	} else {
-		TWPartition* Part = PartitionManager.Find_Partition_By_Path("/system");
+		TWPartition* Part = PartitionManager.Find_Partition_By_Path(PartitionManager.Get_Android_Root_Path());
 		if (Part) {
 			if (arg == "0") {
 				DataManager::SetValue("tw_mount_system_ro", 0);
@@ -1910,9 +1910,9 @@
 			DataManager::SetValue("tw_app_install_status", 1); // 0 = no status, 1 = not installed, 2 = already installed or do not install
 			goto exit;
 		}
-		if (PartitionManager.Mount_By_Path("/system", false)) {
-			string base_path = "/system";
-			if (TWFunc::Path_Exists("/system/system"))
+		if (PartitionManager.Mount_By_Path(PartitionManager.Get_Android_Root_Path(), false)) {
+			string base_path = PartitionManager.Get_Android_Root_Path();
+			if (TWFunc::Path_Exists(PartitionManager.Get_Android_Root_Path() + "/system"))
 				base_path += "/system"; // For devices with system as a root file system (e.g. Pixel)
 			string install_path = base_path + "/priv-app";
 			if (!TWFunc::Path_Exists(install_path))
@@ -2007,9 +2007,9 @@
 				sync();
 			}
 		} else {
-			if (PartitionManager.Mount_By_Path("/system", true)) {
-				string base_path = "/system";
-				if (TWFunc::Path_Exists("/system/system"))
+			if (PartitionManager.Mount_By_Path(PartitionManager.Get_Android_Root_Path(), true)) {
+				string base_path = PartitionManager.Get_Android_Root_Path();
+				if (TWFunc::Path_Exists(PartitionManager.Get_Android_Root_Path() + "/system"))
 					base_path += "/system"; // For devices with system as a root file system (e.g. Pixel)
 				string install_path = base_path + "/priv-app";
 				string context = "u:object_r:system_file:s0";
@@ -2034,7 +2034,7 @@
 						}
 						sync();
 						sync();
-						PartitionManager.UnMount_By_Path("/system", true);
+						PartitionManager.UnMount_By_Path(PartitionManager.Get_Android_Root_Path(), true);
 						op_status = 0;
 					} else {
 						LOGERR("Error making app directory '%s': %s\n", strerror(errno));