manager: install: do not always recommended to select boot partition if not rooted

Co-authored-by: YuKongA <70465933+YuKongA@users.noreply.github.com>
This commit is contained in:
ShirkNeko
2025-11-12 18:04:49 +08:00
parent 095385f814
commit a60395ba35

View File

@@ -371,8 +371,12 @@ suspend fun isAbDevice(): Boolean = withContext(Dispatchers.IO) {
suspend fun getDefaultPartition(): String = withContext(Dispatchers.IO) { suspend fun getDefaultPartition(): String = withContext(Dispatchers.IO) {
val shell = getRootShell() val shell = getRootShell()
if (shell.isRoot) {
val cmd = "boot-info default-partition" val cmd = "boot-info default-partition"
ShellUtils.fastCmd(shell, "${getKsuDaemonPath()} $cmd").trim() ShellUtils.fastCmd(shell, "${getKsuDaemonPath()} $cmd").trim()
} else {
if (!Os.uname().release.contains("android12-")) "init_boot" else "boot"
}
} }
suspend fun getSlotSuffix(ota: Boolean): String = withContext(Dispatchers.IO) { suspend fun getSlotSuffix(ota: Boolean): String = withContext(Dispatchers.IO) {