Skip to content

Commit

Permalink
fix: run blocking IO operations in the correct context
Browse files Browse the repository at this point in the history
  • Loading branch information
Axelen123 committed Jun 11, 2023
1 parent b8a51d3 commit 535efa3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/src/main/java/app/revanced/manager/patcher/Session.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import app.revanced.patcher.PatcherOptions
import app.revanced.patcher.data.Context
import app.revanced.patcher.logging.Logger
import app.revanced.patcher.patch.Patch
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import java.io.Closeable
import java.io.File
import java.nio.file.Files
Expand Down Expand Up @@ -74,7 +76,9 @@ class Session(

logger.info("Patched apk saved to $aligned")

Files.move(aligned.toPath(), output.toPath(), StandardCopyOption.REPLACE_EXISTING)
withContext(Dispatchers.IO) {
Files.move(aligned.toPath(), output.toPath(), StandardCopyOption.REPLACE_EXISTING)
}
}

override fun close() {
Expand Down

0 comments on commit 535efa3

Please sign in to comment.