Skip to content

Commit 26f66f6

Browse files
committed
Minor Changes and cleanup
1 parent d9bf02f commit 26f66f6

File tree

3 files changed

+7
-16
lines changed

3 files changed

+7
-16
lines changed

app/src/main/assets/flash_ak3.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,9 @@ 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 STATE=\"\$4\";\nexport SLOT=\"\$5\";" $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;
18-
## $F/busybox sed -i '/setup_env;/i sed -i "/is_slot_device=auto/i slot_select=$4" anykernel.sh' $F/update-binary;
19-
## $F/busybox sed -i '/setup_env;/i sed -i '\''s/is_slot_device=auto/is_slot_device=1/'\'' anykernel.sh' $F/update-binary;
2016

2117
# update-binary <RECOVERY_API_VERSION> <OUTFD> <ZIPFILE>
22-
AKHOME=$TMP/anykernel $F/busybox ash $F/update-binary 3 1 "$Z" "$S" "$P";
18+
AKHOME=$TMP/anykernel $F/busybox ash $F/update-binary 3 1 "$Z";
2319
RC=$?;
2420

2521
$F/busybox rm -rf $TMP;

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import androidx.compose.ui.platform.LocalContext
3030
import androidx.compose.ui.res.stringResource
3131
import androidx.compose.ui.unit.ExperimentalUnitApi
3232
import androidx.compose.ui.unit.dp
33+
import androidx.compose.ui.text.font.FontWeight
3334
import androidx.navigation.NavController
3435
import com.github.capntrips.kernelflasher.R
3536
import com.github.capntrips.kernelflasher.common.PartitionUtil
@@ -179,13 +180,13 @@ fun ColumnScope.SlotFlashContent(
179180
if (navController.currentDestination!!.route!!.contains("ak3") && viewModel.wasFlashSuccess == true && viewModel.showCautionDialog == true){
180181
AlertDialog(
181182
onDismissRequest = { viewModel.hideCautionDialog() },
182-
title = { Text("CAUTION", style = MaterialTheme.typography.titleLarge) },
183+
title = { Text("CAUTION!", style = MaterialTheme.typography.titleLarge, fontWeight = FontWeight.Bold) },
183184
text = {
184185
Column(verticalArrangement = Arrangement.spacedBy(8.dp)) {
185-
Text("You have flashed AnyKernel Zip to inactive slot!")
186-
Text("But the active slot is not changed after flashing.")
187-
Text("Change active slot or return to System Updater to complete OTA.")
188-
Text("Do not reboot from here, unless you know what you are doing.")
186+
Text("You have flashed AnyKernel Zip to inactive slot!", fontWeight = FontWeight.Bold)
187+
Text("But the active slot is not changed after flashing.", fontWeight = FontWeight.Bold)
188+
Text("Change active slot or return to System Updater to complete OTA.", fontWeight = FontWeight.Bold)
189+
Text("Do not reboot from here, unless you know what you are doing.", fontWeight = FontWeight.Bold)
189190
}
190191
},
191192
confirmButton = {

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ class SlotViewModel(
187187
private fun uiPrint(message: String) {
188188
viewModelScope.launch(Dispatchers.Main) {
189189
_flashOutput.add("ui_print $message")
190-
// _flashOutput.add("ui_print")
191190
}
192191
}
193192

@@ -518,7 +517,6 @@ class SlotViewModel(
518517
_wasFlashSuccess.value = false
519518
val files = File(context.filesDir.canonicalPath)
520519
val flashScript = File(files, "flash_ak3.sh")
521-
val slot_inactive_state = if(isActive) "active" else "inactive"
522520
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()
523521
if (result.isSuccess) {
524522
log(context, "Kernel flashed successfully")
@@ -536,10 +534,6 @@ class SlotViewModel(
536534
} finally {
537535
uiPrint("")
538536
if (wasSlotReset) {
539-
// uiPrint("CAUTION: You have flashed AnyKernel Zip to inactive slot!")
540-
// uiPrint("But the active slot is not changed after flashing.")
541-
// uiPrint("Use bootctl to change active slot or Return to System Updater to complete OTA.")
542-
// uiPrint("Do not reboot from here, unless you know what you are doing.")
543537
resetSlot()
544538
viewModelScope.launch(Dispatchers.Main) {
545539
showCautionDialog() // Show dialog instead of uiPrint

0 commit comments

Comments
 (0)