Skip to content

Commit b72b42b

Browse files
committed
DroidBootFlow: Use dd instead of fallocate
fallocate leaves holes in file (at least on f2fs) making it impossible to uncrypt the file later
1 parent 1308269 commit b72b42b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

app/src/main/java/org/andbootmgr/app/DroidBootFlow.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,8 @@ private fun Flash(d: DroidBootFlowDataHolder) {
261261
return@WizardTerminalWork
262262
}
263263
}
264-
val bytes = 4L * 1024L * 1024L * 1024L // 4 GB for now
265-
if (!Shell.cmd("fallocate -l $bytes" +
266-
vm.logic.abmSdLessBootsetImg.absolutePath).to(terminal).exec().isSuccess) {
264+
val kilobytes = 4L * 1024L * 1024L // 4 GB for now
265+
if (!Shell.cmd("dd if=/dev/zero bs=1024 count=$kilobytes of=${vm.logic.abmSdLessBootsetImg.absolutePath}").to(terminal).exec().isSuccess) {
267266
terminal.add(vm.activity.getString(R.string.term_failed_fallocate))
268267
return@WizardTerminalWork
269268
}

0 commit comments

Comments
 (0)