Commit 4bc99b05 authored by sub77's avatar sub77
Browse files

temp

Change-Id: I6c0dc93fc1e4d118bd2549af77dddb0fea8ef59e
parent acdd29e8
......@@ -203,6 +203,9 @@ GUIAction::GUIAction(xml_node<>* node)
ADD_ACTION(cancelbackup);
ADD_ACTION(checkpartitionlifetimewrites);
ADD_ACTION(mountsystemtoggle);
ADD_ACTION(repack);
ADD_ACTION(ledon);
ADD_ACTION(ledoff);
#ifdef TARGET_RECOVERY_IS_MULTIROM
ADD_ACTION(rotation);
ADD_ACTION(multirom);
......@@ -605,6 +608,7 @@ int GUIAction::reload(std::string arg __unused)
// to prevent crashing which could occur when we start deleting
// GUI resources in the action thread while we attempt to render
// with those same resources in another thread.
#ifdef TARGET_RECOVERY_IS_MULTIROM
//TODO
//MultiROM uses this instead
......@@ -613,6 +617,32 @@ int GUIAction::reload(std::string arg __unused)
return 0;
}
int GUIAction::repack(std::string arg __unused)
{
string seandroid = "/sbin/repack.sh";
TWFunc::Exec_Cmd(seandroid);
LOGINFO("Wiping NOSEANDROIDENFORCING flag.\n");
return 0;
}
int GUIAction::ledon(std::string arg __unused)
{
string ledon = "/sbin/ledon.sh";
TWFunc::Exec_Cmd(ledon);
return 0;
}
int GUIAction::ledoff(std::string arg __unused)
{
string ledoff = "/sbin/ledoff.sh";
TWFunc::Exec_Cmd(ledoff);
return 0;
}
int GUIAction::readBackup(std::string arg __unused)
{
string Restore_Name;
......@@ -832,7 +862,6 @@ int GUIAction::sleep(std::string arg)
operation_end(0);
return 0;
}
int GUIAction::appenddatetobackupname(std::string arg __unused)
{
operation_start("AppendDateToBackupName");
......@@ -1083,6 +1112,7 @@ int GUIAction::flash(std::string arg)
reinject_after_flash();
PartitionManager.Update_System_Details();
if (DataManager::GetIntValue("tw_install_reboot") > 0 && ret_val == 0) {
gui_msg("install_reboot=Rebooting in 5 seconds");
usleep(5000000);
......
......@@ -319,6 +319,9 @@ protected:
int getpartitiondetails(std::string arg);
int screenshot(std::string arg);
int setbrightness(std::string arg);
int repack(std::string arg);
int ledon(std::string arg);
int ledoff(std::string arg);
#ifdef TARGET_RECOVERY_IS_MULTIROM
int rotation(std::string arg);
int timeout(std::string arg);
......
......@@ -248,6 +248,12 @@
<data variable="tw_auto_inject_mrom"/>
</checkbox>
<checkbox>
<placement x="%indent%" y="%row14a_y%" />
<text>{Reboot after installation is complete}</text>
<data variable="tw_install_reboot" />
</checkbox>
<checkbox>
<condition var1="tw_has_injecttwrp" var2="1"/>
<placement x="%indent%" y="%row15_y%"/>
......@@ -3088,6 +3094,12 @@
<text>{@adb_sideload_btn=ADB Sideload}</text>
<action function="page">sideload</action>
</button>
<button style="main_button">
<placement x="%center_x%" y="%row19a_y%"/>
<text>Wipe NOSEANDROIDENFORCE flag</text>
<action function="repack"/>
</button>
<button style="main_button">
<condition var1="tw_show_dumlock" var2="1"/>
......
......@@ -190,7 +190,6 @@ try_update_binary(const char* path, ZipArchive* zip, bool* wipe_cache) {
LOGE("Error in %s\n(Status %d)\n", path, WEXITSTATUS(status));
return INSTALL_ERROR;
}
return INSTALL_SUCCESS;
}
......@@ -289,5 +288,6 @@ install_package(const char* path, bool* wipe_cache, const char* install_file,
fputc('\n', install_log);
fclose(install_log);
}
return result;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment