mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
refactor: leverage new dependency features from recent updates (#5057)
This commit is contained in:
parent
929e273978
commit
9c8532f80d
18 changed files with 47 additions and 57 deletions
|
|
@ -18,6 +18,7 @@ package org.meshtastic.core.database
|
|||
|
||||
import androidx.room3.TypeConverter
|
||||
import co.touchlab.kermit.Logger
|
||||
import kotlinx.serialization.ExperimentalSerializationApi
|
||||
import kotlinx.serialization.json.Json
|
||||
import okio.ByteString
|
||||
import okio.ByteString.Companion.toByteString
|
||||
|
|
@ -33,10 +34,12 @@ import org.meshtastic.proto.User
|
|||
|
||||
@Suppress("TooManyFunctions")
|
||||
class Converters {
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
private val json = Json {
|
||||
isLenient = true
|
||||
ignoreUnknownKeys = true
|
||||
encodeDefaults = true
|
||||
exceptionsWithDebugInfo = false
|
||||
}
|
||||
|
||||
@TypeConverter fun dataFromString(value: String): DataPacket = json.decodeFromString(DataPacket.serializer(), value)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue