summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--data.cpp2
-rw-r--r--openrecoveryscript.cpp7
-rw-r--r--partitionmanager.cpp13
-rw-r--r--twrp.cpp4
4 files changed, 23 insertions, 3 deletions
diff --git a/data.cpp b/data.cpp
index d7b02f1d6..7364b9f4e 100644
--- a/data.cpp
+++ b/data.cpp
@@ -1005,6 +1005,7 @@ int DataManager::GetMagicValue(const string varName, string& value)
void DataManager::Output_Version(void)
{
+#ifndef TW_OEM_BUILD
string Path;
char version[255];
@@ -1035,6 +1036,7 @@ void DataManager::Output_Version(void)
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 cf6f598c5..cf24cbade 100644
--- a/openrecoveryscript.cpp
+++ b/openrecoveryscript.cpp
@@ -576,9 +576,14 @@ void OpenRecoveryScript::Run_OpenRecoveryScript(void) {
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 0262648f1..bf4b38247 100644
--- a/partitionmanager.cpp
+++ b/partitionmanager.cpp
@@ -1095,8 +1095,17 @@ int TWPartitionManager::Factory_Reset(void) {
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 091de19fd..219c30612 100644
--- a/twrp.cpp
+++ b/twrp.cpp
@@ -332,6 +332,7 @@ int main(int argc, char **argv) {
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 @@ int main(int argc, char **argv) {
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 @@ int main(int argc, char **argv) {
sync();
PartitionManager.UnMount_By_Path("/system", false);
}
+#endif
// Reboot
TWFunc::Update_Intent_File(Reboot_Value);