Skip to content

Commit

Permalink
Fix up some TW_OEM_BUILD things
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Dees-Troy committed Aug 26, 2015
1 parent bc85b63 commit 89583ef
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
2 changes: 2 additions & 0 deletions data.cpp
Expand Up @@ -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];

Expand Down Expand Up @@ -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)
Expand Down
7 changes: 6 additions & 1 deletion openrecoveryscript.cpp
Expand Up @@ -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) {
Expand Down
13 changes: 11 additions & 2 deletions partitionmanager.cpp
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions twrp.cpp
Expand Up @@ -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) {
Expand All @@ -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
Expand All @@ -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);
Expand Down

0 comments on commit 89583ef

Please sign in to comment.