Fix up some TW_OEM_BUILD things
Fix factory reset now properly formats data as expected
Change text for ORS processing
Disable system read only check, SuperSU, and patch system
Stop copying fstab and version to cache
Change-Id: I20f5cae390afbb8d2d88e01b8d9b9bf4ff0fdea1
diff --git a/data.cpp b/data.cpp
index d7b02f1..7364b9f 100644
--- a/data.cpp
+++ b/data.cpp
@@ -1005,6 +1005,7 @@
void DataManager::Output_Version(void)
{
+#ifndef TW_OEM_BUILD
string Path;
char version[255];
@@ -1035,6 +1036,7 @@
PartitionManager.Output_Storage_Fstab();
sync();
LOGINFO("Version number saved to '%s'\n", Path.c_str());
+#endif
}
void DataManager::ReadSettingsFile(void)
diff --git a/openrecoveryscript.cpp b/openrecoveryscript.cpp
index cf6f598..cf24cba 100644
--- a/openrecoveryscript.cpp
+++ b/openrecoveryscript.cpp
@@ -576,9 +576,14 @@
DataManager::SetValue("tw_has_action2", "0");
DataManager::SetValue("tw_action2", "");
DataManager::SetValue("tw_action2_param", "");
+#ifdef TW_OEM_BUILD
+ DataManager::SetValue("tw_action_text1", "Running Recovery Commands");
+ DataManager::SetValue("tw_complete_text1", "Recovery Commands Complete");
+#else
DataManager::SetValue("tw_action_text1", "Running OpenRecoveryScript");
- DataManager::SetValue("tw_action_text2", "");
DataManager::SetValue("tw_complete_text1", "OpenRecoveryScript Complete");
+#endif
+ DataManager::SetValue("tw_action_text2", "");
DataManager::SetValue("tw_has_cancel", 0);
DataManager::SetValue("tw_show_reboot", 0);
if (gui_startPage("action_page", 0, 1) != 0) {
diff --git a/partitionmanager.cpp b/partitionmanager.cpp
index 0262648..bf4b382 100644
--- a/partitionmanager.cpp
+++ b/partitionmanager.cpp
@@ -1095,8 +1095,17 @@
for (iter = Partitions.begin(); iter != Partitions.end(); iter++) {
if ((*iter)->Wipe_During_Factory_Reset && (*iter)->Is_Present) {
- if (!(*iter)->Wipe())
- ret = false;
+#ifdef TW_OEM_BUILD
+ if ((*iter)->Mount_Point == "/data") {
+ if (!(*iter)->Wipe_Encryption())
+ ret = false;
+ } else {
+#endif
+ if (!(*iter)->Wipe())
+ ret = false;
+#ifdef TW_OEM_BUILD
+ }
+#endif
} else if ((*iter)->Has_Android_Secure) {
if (!(*iter)->Wipe_AndSec())
ret = false;
diff --git a/twrp.cpp b/twrp.cpp
index 091de19..219c306 100644
--- a/twrp.cpp
+++ b/twrp.cpp
@@ -332,6 +332,7 @@
PartitionManager.Disable_MTP();
#endif
+#ifndef TW_OEM_BUILD
// Check if system has never been changed
TWPartition* sys = PartitionManager.Find_Partition_By_Path("/system");
if (sys) {
@@ -350,10 +351,12 @@
sys->Change_Mount_Read_Only(false);
}
}
+#endif
// Launch the main GUI
gui_start();
+#ifndef TW_OEM_BUILD
// Disable flashing of stock recovery
TWFunc::Disable_Stock_Recovery_Replace();
// Check for su to see if the device is rooted or not
@@ -368,6 +371,7 @@
sync();
PartitionManager.UnMount_By_Path("/system", false);
}
+#endif
// Reboot
TWFunc::Update_Intent_File(Reboot_Value);