summaryrefslogtreecommitdiffstats
path: root/twrp-functions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'twrp-functions.cpp')
-rw-r--r--twrp-functions.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/twrp-functions.cpp b/twrp-functions.cpp
index 40205c943..263593420 100644
--- a/twrp-functions.cpp
+++ b/twrp-functions.cpp
@@ -407,7 +407,7 @@ string TWFunc::Get_Root_Path(const string& Path) {
void TWFunc::install_htc_dumlock(void) {
int need_libs = 0;
- if (!PartitionManager.Mount_By_Path("/system", true))
+ if (!PartitionManager.Mount_By_Path(PartitionManager.Get_Android_Root_Path(), true))
return;
if (!PartitionManager.Mount_By_Path("/data", true))
@@ -809,19 +809,19 @@ string TWFunc::Get_Current_Date() {
}
string TWFunc::System_Property_Get(string Prop_Name) {
- bool mount_state = PartitionManager.Is_Mounted_By_Path("/system");
+ bool mount_state = PartitionManager.Is_Mounted_By_Path(PartitionManager.Get_Android_Root_Path());
std::vector<string> buildprop;
string propvalue;
- if (!PartitionManager.Mount_By_Path("/system", true))
+ if (!PartitionManager.Mount_By_Path(PartitionManager.Get_Android_Root_Path(), true))
return propvalue;
string prop_file = "/system/build.prop";
if (!TWFunc::Path_Exists(prop_file))
- prop_file = "/system/system/build.prop"; // for devices with system as a root file system (e.g. Pixel)
+ prop_file = PartitionManager.Get_Android_Root_Path() + "/system/build.prop"; // for devices with system as a root file system (e.g. Pixel)
if (TWFunc::read_file(prop_file, buildprop) != 0) {
- LOGINFO("Unable to open /system/build.prop for getting '%s'.\n", Prop_Name.c_str());
+ LOGINFO("Unable to open build.prop for getting '%s'.\n", Prop_Name.c_str());
DataManager::SetValue(TW_BACKUP_NAME, Get_Current_Date());
if (!mount_state)
- PartitionManager.UnMount_By_Path("/system", false);
+ PartitionManager.UnMount_By_Path(PartitionManager.Get_Android_Root_Path(), false);
return propvalue;
}
int line_count = buildprop.size();
@@ -834,12 +834,12 @@ string TWFunc::System_Property_Get(string Prop_Name) {
if (propname == Prop_Name) {
propvalue = buildprop.at(index).substr(end_pos + 1, buildprop.at(index).size());
if (!mount_state)
- PartitionManager.UnMount_By_Path("/system", false);
+ PartitionManager.UnMount_By_Path(PartitionManager.Get_Android_Root_Path(), false);
return propvalue;
}
}
if (!mount_state)
- PartitionManager.UnMount_By_Path("/system", false);
+ PartitionManager.UnMount_By_Path(PartitionManager.Get_Android_Root_Path(), false);
return propvalue;
}
@@ -1095,14 +1095,14 @@ std::string TWFunc::to_string(unsigned long value) {
}
void TWFunc::Disable_Stock_Recovery_Replace(void) {
- if (PartitionManager.Mount_By_Path("/system", false)) {
+ if (PartitionManager.Mount_By_Path(PartitionManager.Get_Android_Root_Path(), 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_msg("rename_stock=Renamed stock recovery file in /system to prevent the stock ROM from replacing TWRP.");
sync();
}
- PartitionManager.UnMount_By_Path("/system", false);
+ PartitionManager.UnMount_By_Path(PartitionManager.Get_Android_Root_Path(), false);
}
}