From c76da7e5ffa208860eea008dad358e4e3bb3d735 Mon Sep 17 00:00:00 2001 From: danthe1st Date: Thu, 26 May 2022 00:30:14 +0200 Subject: [PATCH] fix: only accept directories when looking for files in resource patch --- src/main/kotlin/app/revanced/cli/Patcher.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/app/revanced/cli/Patcher.kt b/src/main/kotlin/app/revanced/cli/Patcher.kt index 0eac7b9e..779f1d99 100644 --- a/src/main/kotlin/app/revanced/cli/Patcher.kt +++ b/src/main/kotlin/app/revanced/cli/Patcher.kt @@ -6,6 +6,7 @@ import app.revanced.utils.patcher.applyPatchesPrint import app.revanced.utils.patcher.mergeFiles import app.revanced.utils.signing.Signer import java.io.File +import java.io.FileFilter internal class Patcher { internal companion object { @@ -30,7 +31,7 @@ internal class Patcher { } if (MainCommand.patchResources) { - for (file in File(MainCommand.cacheDirectory).resolve("build/").listFiles()?.first()?.listFiles()!!) { + for (file in File(MainCommand.cacheDirectory).resolve("build/").listFiles(FileFilter { it.isDirectory })?.first()?.listFiles()!!) { if (!file.isDirectory) { zipFileSystem.replaceFile(file.name, file.readBytes()) continue