Skip to content

Commit

Permalink
Fix processPayload
Browse files Browse the repository at this point in the history
  • Loading branch information
canyie authored Aug 30, 2023
1 parent 6bdc57c commit 28190b8
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 28190b8

Please sign in to comment.