mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-22 07:57:39 +00:00
Fix StackOverflowError
Now field from base class java.io.ByteArrayOutputStream shadows the property with custom getter from derived class com.topjohnwu.magisk.core.utils.AXML.RawByteStream. This behavior will be changed soon in favor of the property. Please use explicit cast to java.io.ByteArrayOutputStream if you wish to preserve current behavior. See https://youtrack.jetbrains.com/issue/KT-55017 for details
This commit is contained in:
parent
47e918bc92
commit
9a33a4dfe2
@ -85,7 +85,7 @@ class AXML(b: ByteArray) {
|
||||
baos.align()
|
||||
|
||||
val sizeDiff = baos.size() - start - size
|
||||
val newBuffer = ByteBuffer.wrap(baos.buf).order(LITTLE_ENDIAN)
|
||||
val newBuffer = ByteBuffer.wrap(baos.buffer).order(LITTLE_ENDIAN)
|
||||
|
||||
// Patch XML size
|
||||
newBuffer.putInt(CHUNK_SIZE_OFF, buffer.getInt(CHUNK_SIZE_OFF) + sizeDiff)
|
||||
@ -111,7 +111,7 @@ class AXML(b: ByteArray) {
|
||||
}
|
||||
|
||||
private class RawByteStream : ByteArrayOutputStream() {
|
||||
val buf: ByteArray get() = buf
|
||||
val buffer: ByteArray get() = buf
|
||||
|
||||
fun align(alignment: Int = 4) {
|
||||
val newCount = (count + alignment - 1) / alignment * alignment
|
||||
|
Loading…
x
Reference in New Issue
Block a user