summaryrefslogtreecommitdiffstats
path: root/gui/action.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--gui/action.cpp58
1 files changed, 39 insertions, 19 deletions
diff --git a/gui/action.cpp b/gui/action.cpp
index f1dac1c9b..ca968d088 100644
--- a/gui/action.cpp
+++ b/gui/action.cpp
@@ -341,26 +341,16 @@ int GUIAction::doAction(Action action, int isThreaded /* = 0 */)
DataManager::GetValue(TW_SIMULATE_ACTIONS, simulate);
- if (function == "reboot")
- {
- //curtainClose(); this sometimes causes a crash
-
- sync();
-
- if (arg == "recovery")
- TWFunc::tw_reboot(rb_recovery);
- else if (arg == "poweroff")
- TWFunc::tw_reboot(rb_poweroff);
- else if (arg == "bootloader")
- TWFunc::tw_reboot(rb_bootloader);
- else if (arg == "download")
- TWFunc::tw_reboot(rb_download);
- else
- TWFunc::tw_reboot(rb_system);
+ if (function == "reboot")
+ {
+ //curtainClose(); this sometimes causes a crash
- // This should never occur
- return -1;
- }
+ sync();
+ DataManager::SetValue("tw_gui_done", 1);
+ DataManager::SetValue("tw_reboot_arg", arg);
+
+ return 0;
+ }
if (function == "home")
{
PageManager::SelectPackage("TWRP");
@@ -1143,6 +1133,36 @@ int GUIAction::doAction(Action action, int isThreaded /* = 0 */)
}
}
}
+ if (function == "installsu")
+ {
+ int op_status = 0;
+
+ operation_start("Install SuperSU");
+ if (simulate) {
+ simulate_progress_bar();
+ } else {
+ if (!TWFunc::Install_SuperSU())
+ op_status = 1;
+ }
+
+ operation_end(op_status, simulate);
+ return 0;
+ }
+ if (function == "fixsu")
+ {
+ int op_status = 0;
+
+ operation_start("Fixing Superuser Permissions");
+ if (simulate) {
+ simulate_progress_bar();
+ } else {
+ if (!TWFunc::Fix_su_Perms())
+ op_status = 1;
+ }
+
+ operation_end(op_status, simulate);
+ return 0;
+ }
}
else
{