From eca3c6fa30a8c6c72599a80cea39d674db1c0d65 Mon Sep 17 00:00:00 2001 From: AsamK Date: Sun, 8 Sep 2024 19:22:02 +0200 Subject: [PATCH] Replace deprecated DBusMap --- graalvm-config-dir/reflect-config.json | 34 ++++++++++++++++++- .../asamk/signal/dbus/DbusManagerImpl.java | 5 ++- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/graalvm-config-dir/reflect-config.json b/graalvm-config-dir/reflect-config.json index d38c8ed2b..d6247e74e 100644 --- a/graalvm-config-dir/reflect-config.json +++ b/graalvm-config-dir/reflect-config.json @@ -799,6 +799,34 @@ "queryAllDeclaredConstructors":true, "methods":[{"name":"","parameterTypes":["java.lang.String","java.lang.String"] }, {"name":"pin","parameterTypes":[] }, {"name":"verificationCode","parameterTypes":[] }] }, +{ + "name":"org.asamk.signal.dbus.DbusProperties", + "queryAllDeclaredMethods":true +}, +{ + "name":"org.asamk.signal.dbus.DbusSignalControlImpl", + "queryAllDeclaredMethods":true +}, +{ + "name":"org.asamk.signal.dbus.DbusSignalImpl", + "queryAllDeclaredMethods":true +}, +{ + "name":"org.asamk.signal.dbus.DbusSignalImpl$DbusSignalConfigurationImpl", + "queryAllDeclaredMethods":true +}, +{ + "name":"org.asamk.signal.dbus.DbusSignalImpl$DbusSignalDeviceImpl", + "queryAllDeclaredMethods":true +}, +{ + "name":"org.asamk.signal.dbus.DbusSignalImpl$DbusSignalGroupImpl", + "queryAllDeclaredMethods":true +}, +{ + "name":"org.asamk.signal.dbus.DbusSignalImpl$DbusSignalIdentityImpl", + "queryAllDeclaredMethods":true +}, { "name":"org.asamk.signal.json.JsonAttachment", "allDeclaredFields":true, @@ -1831,6 +1859,10 @@ "name":"org.bouncycastle.pqc.jcajce.provider.XMSS$Mappings", "methods":[{"name":"","parameterTypes":[] }] }, +{ + "name":"org.freedesktop.dbus.connections.base.GlobalHandler", + "queryAllDeclaredMethods":true +}, { "name":"org.freedesktop.dbus.errors.ServiceUnknown", "methods":[{"name":"","parameterTypes":["java.lang.String"] }] @@ -1863,7 +1895,7 @@ "name":"org.freedesktop.dbus.interfaces.Properties", "allDeclaredMethods":true, "allDeclaredClasses":true, - "methods":[{"name":"Get","parameterTypes":["java.lang.String","java.lang.String"] }, {"name":"GetAll","parameterTypes":["java.lang.String"] }] + "methods":[{"name":"Get","parameterTypes":["java.lang.String","java.lang.String"] }, {"name":"GetAll","parameterTypes":["java.lang.String"] }, {"name":"Set","parameterTypes":["java.lang.String","java.lang.String","java.lang.Object"] }] }, { "name":"org.freedesktop.dbus.interfaces.Properties$PropertiesChanged", diff --git a/src/main/java/org/asamk/signal/dbus/DbusManagerImpl.java b/src/main/java/org/asamk/signal/dbus/DbusManagerImpl.java index 574f68c6b..9ae3001a6 100644 --- a/src/main/java/org/asamk/signal/dbus/DbusManagerImpl.java +++ b/src/main/java/org/asamk/signal/dbus/DbusManagerImpl.java @@ -49,7 +49,6 @@ import org.asamk.signal.manager.api.UserStatus; import org.asamk.signal.manager.api.UsernameLinkUrl; import org.asamk.signal.manager.api.UsernameStatus; -import org.freedesktop.dbus.DBusMap; import org.freedesktop.dbus.DBusPath; import org.freedesktop.dbus.connections.impl.DBusConnection; import org.freedesktop.dbus.exceptions.DBusException; @@ -1063,7 +1062,7 @@ private List getAttachments(final Map>> attachments = getValue(extras, "attachments"); + final List>> attachments = getValue(extras, "attachments"); return attachments.stream().map(a -> { final String file = a.containsKey("file") ? getValue(a, "file") : null; return new MessageEnvelope.Data.Attachment(a.containsKey("remoteId") @@ -1090,7 +1089,7 @@ private List getMentions(final Map>> mentions = getValue(extras, "mentions"); + final List>> mentions = getValue(extras, "mentions"); return mentions.stream() .map(a -> new MessageEnvelope.Data.Mention(new RecipientAddress(this.getValue(a, "recipient")), getValue(a, "start"),