Skip to content

Commit 6efcfb2

Browse files
committed
Fix 3: Enable Both slot Flash options
1 parent 7297477 commit 6efcfb2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

app/src/main/assets/flash_ak3.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ TMP=$F/tmp;
1313

1414
$F/busybox rm -rf $TMP 2>/dev/null;
1515
$F/busybox mkdir -p $TMP;
16+
$F/busybox sed -i "/export ZIPFILE=\"\$3\";/a export SLOT=\"\$4\";" $F/update-binary;
17+
$F/busybox sed -i 's/\[ -e \/dev\/block\/$byname\/system \] || slot=\$(find_slot);/[ -e \/dev\/block\/$byname\/system ] || slot=$SLOT;/' $F/update-binary;
1618

1719
# update-binary <RECOVERY_API_VERSION> <OUTFD> <ZIPFILE>
18-
AKHOME=$TMP/anykernel $F/busybox ash $F/update-binary 3 1 "$Z";
20+
AKHOME=$TMP/anykernel $F/busybox ash $F/update-binary 3 1 "$Z" "$S";
1921
RC=$?;
2022

2123
$F/busybox rm -rf $TMP;

app/src/main/java/com/github/capntrips/kernelflasher/ui/screens/slot/SlotViewModel.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ class SlotViewModel(
507507
_wasFlashSuccess.value = false
508508
val files = File(context.filesDir.canonicalPath)
509509
val flashScript = File(files, "flash_ak3.sh")
510-
val result = Shell.Builder.create().setFlags(Shell.FLAG_MOUNT_MASTER or Shell.FLAG_REDIRECT_STDERR).build().newJob().add("F=$files Z=\"$zip\" /system/bin/sh $flashScript").to(flashOutput).exec()
510+
val result = Shell.Builder.create().setFlags(Shell.FLAG_MOUNT_MASTER or Shell.FLAG_REDIRECT_STDERR).build().newJob().add("F=$files Z=\"$zip\" S=\"slotSuffix\" /system/bin/sh $flashScript").to(flashOutput).exec()
511511
if (result.isSuccess) {
512512
log(context, "Kernel flashed successfully")
513513
_wasFlashSuccess.value = true

0 commit comments

Comments
 (0)