From 9b588615e17b974bc55838380214c7b613fbbc0d Mon Sep 17 00:00:00 2001 From: nift4 Date: Wed, 31 Jul 2024 16:57:44 +0200 Subject: [PATCH] new script abi part2 --- app/src/main/java/org/andbootmgr/app/CreatePartFlow.kt | 2 +- app/src/main/java/org/andbootmgr/app/DroidBootFlow.kt | 2 +- app/src/main/java/org/andbootmgr/app/UpdateFlow.kt | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/andbootmgr/app/CreatePartFlow.kt b/app/src/main/java/org/andbootmgr/app/CreatePartFlow.kt index f013fc26..653c74ec 100644 --- a/app/src/main/java/org/andbootmgr/app/CreatePartFlow.kt +++ b/app/src/main/java/org/andbootmgr/app/CreatePartFlow.kt @@ -967,7 +967,7 @@ private fun Flash(c: CreatePartDataHolder) { for (i in parts) { cmd += " " + i.value } - val result = Shell.cmd(cmd).to(terminal).exec() + val result = vm.logic.runShFileWithArgs(cmd).to(terminal).exec() if (!result.isSuccess) { terminal.add(vm.activity.getString(R.string.term_failure)) return diff --git a/app/src/main/java/org/andbootmgr/app/DroidBootFlow.kt b/app/src/main/java/org/andbootmgr/app/DroidBootFlow.kt index c09dbcaf..330eb4eb 100644 --- a/app/src/main/java/org/andbootmgr/app/DroidBootFlow.kt +++ b/app/src/main/java/org/andbootmgr/app/DroidBootFlow.kt @@ -281,7 +281,7 @@ private fun Flash(vm: WizardActivityState) { } if (vm.deviceInfo.postInstallScript) { terminal.add(vm.activity.getString(R.string.term_device_setup)) - Shell.cmd( + vm.logic.runShFileWithArgs( "BOOTED=${vm.deviceInfo.isBooted(vm.logic)} " + "${File(vm.logic.assetDir, "Scripts/install/${vm.deviceInfo.codename}.sh").absolutePath} real" ).to(terminal).exec() diff --git a/app/src/main/java/org/andbootmgr/app/UpdateFlow.kt b/app/src/main/java/org/andbootmgr/app/UpdateFlow.kt index f326f92a..7d43576b 100644 --- a/app/src/main/java/org/andbootmgr/app/UpdateFlow.kt +++ b/app/src/main/java/org/andbootmgr/app/UpdateFlow.kt @@ -317,7 +317,7 @@ private fun Flash(u: UpdateFlowDataHolder) { for (i in sp) { cmd += " $i" } - val r = Shell.cmd(cmd).to(terminal).exec() + val r = u.vm.logic.runShFileWithArgs(cmd).to(terminal).exec() bootfile.forEach { it.delete() } if (!r.isSuccess) { throw IllegalStateException(u.vm.activity.getString(R.string.term_script_fail)) @@ -350,7 +350,7 @@ private fun Flash(u: UpdateFlowDataHolder) { for (i in sp) { cmd += " $i" } - val r = Shell.cmd(cmd).to(terminal).exec() + val r = u.vm.logic.runShFileWithArgs(cmd).to(terminal).exec() bootfile.forEach { it.delete() } if (!r.isSuccess) { throw IllegalStateException(u.vm.activity.getString(R.string.term_script_fail))