From 8e73027f7926f814c9fc5d351f70ecfbadbbd806 Mon Sep 17 00:00:00 2001 From: Rover12421 Date: Wed, 22 Sep 2021 16:17:40 +0800 Subject: [PATCH] fix FileNotFoundException / add ignore file list (#68) * fix FileNotFoundException magisk patch boot, ramdisk add backup file don't create(add) parent dir * add git ignore file add ignore file list : boot.img* local.properties --- .gitignore | 2 ++ bbootimg/src/main/kotlin/bootimg/cpio/AndroidCpio.kt | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 6eb8b6a7..38074aac 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ .idea .gradle build/ +boot.img* +local.properties \ No newline at end of file diff --git a/bbootimg/src/main/kotlin/bootimg/cpio/AndroidCpio.kt b/bbootimg/src/main/kotlin/bootimg/cpio/AndroidCpio.kt index dea1b312..a272818f 100644 --- a/bbootimg/src/main/kotlin/bootimg/cpio/AndroidCpio.kt +++ b/bbootimg/src/main/kotlin/bootimg/cpio/AndroidCpio.kt @@ -239,7 +239,7 @@ class AndroidCpio { } entry.isRegularFile -> { entryInfo.note = ("REG " + entryInfo.note) - File(outEntryName).writeBytes(buffer) + File(outEntryName).also { it.parentFile.mkdirs() }.writeBytes(buffer) if (EnvironmentVerifier().isWindows) { //Windows: Posix not supported } else {