Bring back installing to second slot after OTA on A/B devices

This commit is contained in:
topjohnwu
2018-07-21 01:59:28 +08:00
parent 4ffc388491
commit 07140d33a7
4 changed files with 49 additions and 11 deletions
@@ -26,6 +26,7 @@ import com.topjohnwu.magisk.receivers.DownloadReceiver;
import com.topjohnwu.magisk.receivers.ManagerUpdate;
import com.topjohnwu.magisk.receivers.RebootReceiver;
import com.topjohnwu.superuser.Shell;
import com.topjohnwu.superuser.ShellUtils;
import java.util.ArrayList;
import java.util.List;
@@ -134,6 +135,10 @@ public class ShowUI {
if (Shell.rootAccess()) {
options.add(mm.getString(R.string.direct_install));
}
String s = ShellUtils.fastCmd("grep_prop ro.build.ab_update");
if (s != null && Boolean.parseBoolean(s)) {
options.add(mm.getString(R.string.install_second_slot));
}
new AlertDialog.Builder(activity)
.setTitle(R.string.select_method)
.setItems(