Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nift4 committed Jul 27, 2024
1 parent dc1eaa2 commit c16e90b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion app/src/main/java/org/andbootmgr/app/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,9 @@ private fun PartTool(vm: MainActivityState) {
Button(onClick = {
processing = true
delete = false
vm.logic!!.unmount(vm.deviceInfo!!)
Shell.cmd(SDUtils.umsd(parts!!) + " && " + p.delete()).submit {
vm.logic!!.mount(vm.deviceInfo!!)
processing = false
editPartID = null
parts =
Expand Down Expand Up @@ -1038,6 +1040,7 @@ private fun PartTool(vm: MainActivityState) {
.map { it.delete() }.collect(
Collectors.toList()
)
vm.logic!!.unmount(vm.deviceInfo!!)
for (s in allp) { // Do not chain, but regenerate meta and unmount every time. Thanks void
val r = Shell.cmd(
SDUtils.umsd(parts!!) + " && " + s
Expand All @@ -1046,6 +1049,7 @@ private fun PartTool(vm: MainActivityState) {
SDUtils.generateMeta(vm.deviceInfo!!.bdev, vm.deviceInfo!!.pbdev)
tresult += r.out.join("\n") + r.err.join("\n") + "\n"
}
vm.logic!!.mount(vm.deviceInfo!!)
}
val f = entries[e]!!
val f2 = SuFile(vm.logic!!.abmBootset, f.nameWithoutExtension)
Expand Down Expand Up @@ -1187,7 +1191,6 @@ private fun Settings(vm: MainActivityState) {
}
}

@OptIn(ExperimentalMaterial3Api::class)
@Preview(showBackground = true)
@Composable
private fun Preview() {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/org/andbootmgr/app/util/SDUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ object SDUtils {
val c = rend > endSector
val d = end < start
if (a || b || c || d) {
return "echo 'Invalid values ($start:$end - $a $b $c $d). Aborting...'"
return "echo 'Invalid values ($start:$end - $rstart>$startSector:$endSector>$rend - $a $b $c $d). Aborting...'; exit 1"
}
return "sgdisk ${meta.path} --new ${meta.nid}:$rstart:$rend --typecode ${meta.nid}:$typecode --change-name ${meta.nid}:'${name.replace("'", "")}' && sleep 1 && ls ${meta.ppath}${meta.nid}" + when(typecode) {
"0700" -> " && sm format public:${meta.major},${meta.minor+meta.nid}"
Expand Down

0 comments on commit c16e90b

Please sign in to comment.