2019-01-30 23:23:49 -05:00
|
|
|
package com.topjohnwu.magisk.dialogs;
|
2018-07-28 22:52:40 +08:00
|
|
|
|
2019-01-28 14:24:52 -05:00
|
|
|
import android.app.Activity;
|
2018-07-28 22:52:40 +08:00
|
|
|
import android.text.TextUtils;
|
|
|
|
|
2019-01-30 03:10:12 -05:00
|
|
|
import com.topjohnwu.magisk.Config;
|
2018-07-28 22:52:40 +08:00
|
|
|
import com.topjohnwu.magisk.R;
|
2019-01-30 23:23:49 -05:00
|
|
|
import com.topjohnwu.magisk.uicomponents.MarkDownWindow;
|
2018-12-13 04:35:50 -05:00
|
|
|
import com.topjohnwu.magisk.utils.DownloadApp;
|
2019-01-30 03:10:12 -05:00
|
|
|
import com.topjohnwu.magisk.utils.Utils;
|
2018-07-28 22:52:40 +08:00
|
|
|
|
2018-09-10 02:27:45 -04:00
|
|
|
import androidx.annotation.NonNull;
|
|
|
|
|
2018-07-28 22:52:40 +08:00
|
|
|
public class ManagerInstallDialog extends CustomAlertDialog {
|
|
|
|
|
2019-01-28 14:24:52 -05:00
|
|
|
public ManagerInstallDialog(@NonNull Activity a) {
|
2018-12-13 04:35:50 -05:00
|
|
|
super(a);
|
2018-12-02 04:47:57 -05:00
|
|
|
String name = Utils.fmt("MagiskManager v%s(%d)",
|
2019-01-21 15:49:03 -05:00
|
|
|
Config.remoteManagerVersionString, Config.remoteManagerVersionCode);
|
2018-12-13 04:35:50 -05:00
|
|
|
setTitle(a.getString(R.string.repo_install_title, a.getString(R.string.app_name)));
|
|
|
|
setMessage(a.getString(R.string.repo_install_msg, name));
|
2018-07-28 22:52:40 +08:00
|
|
|
setCancelable(true);
|
2018-12-13 04:35:50 -05:00
|
|
|
setPositiveButton(R.string.install, (d, i) -> DownloadApp.upgrade(name));
|
2019-01-21 15:49:03 -05:00
|
|
|
if (!TextUtils.isEmpty(Config.managerNoteLink)) {
|
|
|
|
setNeutralButton(R.string.app_changelog, (d, i) -> MarkDownWindow.show(a, null, Config.managerNoteLink));
|
2018-07-28 22:52:40 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|