fix(core): parse Android plugin args starting with is, closes #14254 (#14260)

by default Jackson treats the `isX` as a getter, so it looks for the `x` key in the JSON. To match behavior on other platforms we now configure Jackson to treat it as the field name itself.
This commit is contained in:
Lucas Fernandes Nogueira
2025-10-08 07:53:35 -03:00
committed by GitHub
parent d2938486e9
commit 006d592837
2 changed files with 8 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
---
"tauri": patch:bug
---
Properly deserialize Android plugin args with key starting with `is` (previously treated as a getter instead of a field name).

View File

@@ -17,6 +17,8 @@ import app.tauri.annotation.InvokeArg
import app.tauri.FsUtils
import app.tauri.JniMethod
import app.tauri.Logger
import com.fasterxml.jackson.annotation.JsonAutoDetect
import com.fasterxml.jackson.annotation.PropertyAccessor
import com.fasterxml.jackson.databind.DeserializationFeature
import com.fasterxml.jackson.databind.JsonNode
import com.fasterxml.jackson.databind.ObjectMapper
@@ -69,6 +71,7 @@ class PluginManager(val activity: AppCompatActivity) {
jsonMapper = ObjectMapper()
.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
.enable(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES)
.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY)
val channelDeserializer = ChannelDeserializer({ channelId, payload ->
sendChannelData(channelId, payload)