You've already forked KernelSU-Next
mirror of
https://github.com/KernelSU-Next/KernelSU-Next.git
synced 2025-08-27 23:46:34 +00:00
manager: show reboot button when flashing LKM directly and inactive slot
This commit is contained in:
@@ -216,14 +216,43 @@ fun FlashScreen(navigator: DestinationsNavigator, flashIt: FlashIt) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (flashIt is FlashIt.FlashBoot && (flashing == FlashingStatus.SUCCESS || flashing == FlashingStatus.FAILED)) {
|
if (flashIt is FlashIt.FlashBoot && (flashing == FlashingStatus.SUCCESS || flashing == FlashingStatus.FAILED)) {
|
||||||
// Close button for LKM flashing
|
val isLocalPatch = flashIt.boot != null && !flashIt.ota
|
||||||
ExtendedFloatingActionButton(
|
val isDirectOrOta = flashIt.boot == null || flashIt.ota
|
||||||
text = { Text(text = stringResource(R.string.close)) },
|
|
||||||
icon = { Icon(Icons.Filled.Close, contentDescription = null) },
|
if (flashing == FlashingStatus.FAILED) {
|
||||||
onClick = {
|
// Always show close on failure
|
||||||
navigator.popBackStack()
|
ExtendedFloatingActionButton(
|
||||||
|
text = { Text(text = stringResource(R.string.close)) },
|
||||||
|
icon = { Icon(Icons.Filled.Close, contentDescription = null) },
|
||||||
|
onClick = {
|
||||||
|
navigator.popBackStack()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
} else if (flashing == FlashingStatus.SUCCESS) {
|
||||||
|
if (isLocalPatch) {
|
||||||
|
// Local patching: show only Close
|
||||||
|
ExtendedFloatingActionButton(
|
||||||
|
text = { Text(text = stringResource(R.string.close)) },
|
||||||
|
icon = { Icon(Icons.Filled.Close, contentDescription = null) },
|
||||||
|
onClick = {
|
||||||
|
navigator.popBackStack()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
} else if (isDirectOrOta) {
|
||||||
|
// Direct install or OTA inactive slot: show only Reboot
|
||||||
|
ExtendedFloatingActionButton(
|
||||||
|
onClick = {
|
||||||
|
scope.launch {
|
||||||
|
withContext(Dispatchers.IO) {
|
||||||
|
reboot()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
icon = { Icon(Icons.Filled.Refresh, contentDescription = stringResource(R.string.reboot)) },
|
||||||
|
text = { Text(text = stringResource(R.string.reboot)) }
|
||||||
|
)
|
||||||
}
|
}
|
||||||
)
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
contentWindowInsets = WindowInsets.safeDrawing,
|
contentWindowInsets = WindowInsets.safeDrawing,
|
||||||
|
|||||||
Reference in New Issue
Block a user