Fix processPayload

This commit is contained in:
残页 2023-08-30 23:44:24 +08:00 committed by John Wu
parent 6bdc57cbe4
commit 6f77f190f2

View File

@ -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 {
@ -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()
}
}