Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 89583ef0 authored by Ethan Yonker's avatar Ethan Yonker Committed by Dees Troy
Browse files

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
parent bc85b63e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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)
+6 −1
Original line number Diff line number Diff line
@@ -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) {
+11 −2
Original line number Diff line number Diff line
@@ -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) {
#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;
+4 −0
Original line number Diff line number Diff line
@@ -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);