From 91e0d5164b14748a38b5b1db29f0d7f76b0de08f Mon Sep 17 00:00:00 2001 From: AsamK Date: Fri, 3 Nov 2023 20:20:14 +0100 Subject: [PATCH] Ensure profile key is stored in profileKeyStore Fixes #1362 --- graalvm-config-dir/resource-config.json | 2 ++ .../asamk/signal/manager/storage/SignalAccount.java | 12 +++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/graalvm-config-dir/resource-config.json b/graalvm-config-dir/resource-config.json index b79033ea..6902124a 100644 --- a/graalvm-config-dir/resource-config.json +++ b/graalvm-config-dir/resource-config.json @@ -172,6 +172,8 @@ "pattern":"\\Qkotlin/coroutines/coroutines.kotlin_builtins\\E" }, { "pattern":"\\Qkotlin/internal/internal.kotlin_builtins\\E" + }, { + "pattern":"\\Qkotlin/jvm/jvm.kotlin_builtins\\E" }, { "pattern":"\\Qkotlin/kotlin.kotlin_builtins\\E" }, { diff --git a/lib/src/main/java/org/asamk/signal/manager/storage/SignalAccount.java b/lib/src/main/java/org/asamk/signal/manager/storage/SignalAccount.java index 1b501331..077ff732 100644 --- a/lib/src/main/java/org/asamk/signal/manager/storage/SignalAccount.java +++ b/lib/src/main/java/org/asamk/signal/manager/storage/SignalAccount.java @@ -654,7 +654,7 @@ public class SignalAccount implements Closeable { // Old config file, creating new profile key setProfileKey(KeyUtils.createProfileKey()); } - getProfileStore().storeProfileKey(getSelfRecipientId(), getProfileKey()); + getProfileStore().storeSelfProfileKey(getSelfRecipientId(), getProfileKey()); if (previousStorageVersion < 5) { final var legacyRecipientsStoreFile = new File(userPath, "recipients-store"); @@ -1185,10 +1185,12 @@ public class SignalAccount implements Closeable { } public RecipientStore getRecipientStore() { - return getOrCreate(() -> recipientStore, - () -> recipientStore = new RecipientStore(this::mergeRecipients, - this::getSelfRecipientAddress, - getAccountDatabase())); + return getOrCreate(() -> recipientStore, () -> { + recipientStore = new RecipientStore(this::mergeRecipients, + this::getSelfRecipientAddress, + getAccountDatabase()); + getProfileStore().storeSelfProfileKey(getSelfRecipientId(), getProfileKey()); + }); } public ProfileStore getProfileStore() { -- 2.50.1