Skip to content

Commit

Permalink
fix: only accept directories when looking for files in resource patch
Browse files Browse the repository at this point in the history
  • Loading branch information
danthe1st committed May 25, 2022
1 parent d946333 commit c76da7e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/kotlin/app/revanced/cli/Patcher.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand Down

0 comments on commit c76da7e

Please sign in to comment.