Add warning before installing to inactive slot

This commit is contained in:
topjohnwu 2018-08-03 05:19:46 +08:00
parent 20e0fe3ba1
commit 4c14df67cc
3 changed files with 14 additions and 4 deletions

View File

@ -27,7 +27,7 @@ android {
productFlavors {
full {
versionCode 130
versionCode 131
versionName "5.8.3"
}
stub {

View File

@ -58,9 +58,17 @@ class InstallMethodDialog extends AlertDialog.Builder {
activity.startActivity(intent);
break;
case 3:
intent = new Intent(activity, FlashActivity.class)
.putExtra(Const.Key.FLASH_ACTION, Const.Value.FLASH_INACTIVE_SLOT);
activity.startActivity(intent);
new CustomAlertDialog(activity)
.setTitle(R.string.warning)
.setMessage(R.string.install_inactive_slot_msg)
.setCancelable(true)
.setPositiveButton(R.string.yes, (d, i) -> {
Intent it = new Intent(activity, FlashActivity.class)
.putExtra(Const.Key.FLASH_ACTION, Const.Value.FLASH_INACTIVE_SLOT);
activity.startActivity(it);
})
.setNegativeButton(R.string.no_thanks, null)
.show();
break;
default:
}

View File

@ -100,6 +100,8 @@
<string name="patch_boot_file">Patch Boot Image File</string>
<string name="direct_install">Direct Install (Recommended)</string>
<string name="install_inactive_slot">Install to Inactive Slot (After OTA)</string>
<string name="warning">Warning</string>
<string name="install_inactive_slot_msg">Your device will be FORCED to boot to the current inactive slot after a reboot!\nOnly use this option after OTA is done.\nContinue?</string>
<string name="select_method">Select Method</string>
<string name="no_boot_file_patch_support">Target Magisk version doesn\'t support boot image file patching</string>
<string name="boot_file_patch_msg">Select stock boot image dump in .img or .img.tar format</string>