Skip to content

Commit

Permalink
Fix processPayload
Browse files Browse the repository at this point in the history
  • Loading branch information
canyie authored and topjohnwu committed Sep 1, 2023
1 parent 6bdc57c commit 6f77f19
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,8 @@ abstract class MagiskInstallImpl protected constructor(

val fd = Os.open(fifo.path, O_WRONLY, 0)
try {
val buf = ByteBuffer.allocate(1024 * 1024)
val bufSize = 1024 * 1024
val buf = ByteBuffer.allocate(bufSize)
buf.position(input.read(buf.array()).coerceAtLeast(0)).flip()
while (buf.hasRemaining()) {
try {
Expand All @@ -334,6 +335,7 @@ abstract class MagiskInstallImpl protected constructor(
break
}
if (!buf.hasRemaining()) {
buf.limit(bufSize)
buf.position(input.read(buf.array()).coerceAtLeast(0)).flip()
}
}
Expand Down

0 comments on commit 6f77f19

Please sign in to comment.