mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-04-16 07:11:26 +00:00
Reboot after env_fix
This commit is contained in:
parent
ebe1ab982e
commit
da3937ff4e
@ -13,6 +13,7 @@ import com.topjohnwu.magisk.SplashActivity;
|
|||||||
import com.topjohnwu.magisk.tasks.MagiskInstaller;
|
import com.topjohnwu.magisk.tasks.MagiskInstaller;
|
||||||
import com.topjohnwu.magisk.utils.Utils;
|
import com.topjohnwu.magisk.utils.Utils;
|
||||||
import com.topjohnwu.superuser.Shell;
|
import com.topjohnwu.superuser.Shell;
|
||||||
|
import com.topjohnwu.superuser.internal.UiThreadHandler;
|
||||||
import com.topjohnwu.superuser.io.SuFile;
|
import com.topjohnwu.superuser.io.SuFile;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -39,18 +40,9 @@ public class EnvFixDialog extends CustomAlertDialog {
|
|||||||
@Override
|
@Override
|
||||||
protected void onResult(boolean success) {
|
protected void onResult(boolean success) {
|
||||||
pd.dismiss();
|
pd.dismiss();
|
||||||
Utils.toast(success ? R.string.setup_done : R.string.setup_fail, Toast.LENGTH_LONG);
|
Utils.toast(success ? R.string.reboot_delay_toast : R.string.setup_fail, Toast.LENGTH_LONG);
|
||||||
if (success) {
|
if (success)
|
||||||
// Relaunch the app
|
UiThreadHandler.handler.postDelayed(Utils::reboot, 5000);
|
||||||
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();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}.exec();
|
}.exec();
|
||||||
});
|
});
|
||||||
|
@ -84,6 +84,7 @@
|
|||||||
<string name="setup_title">Additional Setup</string>
|
<string name="setup_title">Additional Setup</string>
|
||||||
<string name="select_patch_file">Select and Patch a File</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="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-->
|
<!--Toasts, Dialogs-->
|
||||||
<string name="close">Close</string>
|
<string name="close">Close</string>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user