Skip to content

Commit

Permalink
Reboot after env_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
topjohnwu committed Apr 6, 2019
1 parent ebe1ab9 commit da3937f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
16 changes: 4 additions & 12 deletions app/src/main/java/com/topjohnwu/magisk/dialogs/EnvFixDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.topjohnwu.magisk.tasks.MagiskInstaller;
import com.topjohnwu.magisk.utils.Utils;
import com.topjohnwu.superuser.Shell;
import com.topjohnwu.superuser.internal.UiThreadHandler;
import com.topjohnwu.superuser.io.SuFile;

import java.io.IOException;
Expand All @@ -39,18 +40,9 @@ protected boolean operations() {
@Override
protected void onResult(boolean success) {
pd.dismiss();
Utils.toast(success ? R.string.setup_done : R.string.setup_fail, Toast.LENGTH_LONG);
if (success) {
// Relaunch the app
try {
Shell.getShell().close();
} catch (IOException ignored) {}
Intent intent = new Intent(activity, ClassMap.get(SplashActivity.class));
intent.addFlags(Intent.FLAG_ACTIVITY_TASK_ON_HOME | Intent.FLAG_ACTIVITY_NEW_TASK);
activity.startActivity(intent);
activity.finish();
}

Utils.toast(success ? R.string.reboot_delay_toast : R.string.setup_fail, Toast.LENGTH_LONG);
if (success)
UiThreadHandler.handler.postDelayed(Utils::reboot, 5000);
}
}.exec();
});
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
<string name="setup_title">Additional Setup</string>
<string name="select_patch_file">Select and Patch a File</string>
<string name="patch_file_msg">Select a raw image (*.img) or an ODIN tarfile (*.tar)</string>
<string name="reboot_delay_toast">Rebooting in 5 seconds…</string>

<!--Toasts, Dialogs-->
<string name="close">Close</string>
Expand Down

0 comments on commit da3937f

Please sign in to comment.