mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-05 23:50:08 +08:00
Improve desensitizer: generate .serializer()
for .toByteArray
This commit is contained in:
parent
a2e602adfd
commit
6b63c323e5
@ -195,9 +195,14 @@ private class DesensitizationVisitor(
|
||||
|
||||
val result = instance.cast<NestedStructureDesensitizer<ProtocolStruct, ProtocolStruct>>()
|
||||
.deserialize(desc.origin as ProtocolStruct, value.origin as ByteArray)
|
||||
?: desc.origin
|
||||
|
||||
val generate = ConstructorCallCodegenFacade.generateAndDesensitize(result)
|
||||
PlainValueDesc(desc, "$generate.toByteArray()", value.origin)
|
||||
PlainValueDesc(
|
||||
desc,
|
||||
"$generate.toByteArray(${result::class.qualifiedName}.serializer())",
|
||||
value.origin
|
||||
)
|
||||
} else value
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user