Skip to content

Commit

Permalink
DroidBootFlow: Use dd instead of fallocate
Browse files Browse the repository at this point in the history
fallocate leaves holes in file (at least on f2fs) making it impossible to uncrypt the file later
  • Loading branch information
luka177 committed Jan 19, 2025
1 parent 1308269 commit b72b42b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/src/main/java/org/andbootmgr/app/DroidBootFlow.kt
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,8 @@ private fun Flash(d: DroidBootFlowDataHolder) {
return@WizardTerminalWork
}
}
val bytes = 4L * 1024L * 1024L * 1024L // 4 GB for now
if (!Shell.cmd("fallocate -l $bytes" +
vm.logic.abmSdLessBootsetImg.absolutePath).to(terminal).exec().isSuccess) {
val kilobytes = 4L * 1024L * 1024L // 4 GB for now
if (!Shell.cmd("dd if=/dev/zero bs=1024 count=$kilobytes of=${vm.logic.abmSdLessBootsetImg.absolutePath}").to(terminal).exec().isSuccess) {
terminal.add(vm.activity.getString(R.string.term_failed_fallocate))
return@WizardTerminalWork
}
Expand Down

0 comments on commit b72b42b

Please sign in to comment.