X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/90c787f8e276db5db670fd9e5f0e15ad12438017..a80e18169a9cc68c59c5d7bc6dcdc7b747dfcf37:/lib/src/main/java/org/asamk/signal/manager/SignalAccountFiles.java diff --git a/lib/src/main/java/org/asamk/signal/manager/SignalAccountFiles.java b/lib/src/main/java/org/asamk/signal/manager/SignalAccountFiles.java index b3ed439d..0ca9b0ab 100644 --- a/lib/src/main/java/org/asamk/signal/manager/SignalAccountFiles.java +++ b/lib/src/main/java/org/asamk/signal/manager/SignalAccountFiles.java @@ -9,9 +9,9 @@ import org.asamk.signal.manager.storage.SignalAccount; import org.asamk.signal.manager.storage.accounts.AccountsStore; import org.asamk.signal.manager.storage.identities.TrustNewIdentity; import org.asamk.signal.manager.util.KeyUtils; +import org.signal.libsignal.protocol.util.KeyHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.whispersystems.libsignal.util.KeyHelper; import java.io.File; import java.io.IOException; @@ -49,7 +49,7 @@ public class SignalAccountFiles { public MultiAccountManager initMultiAccountManager() { final var managers = accountsStore.getAllAccounts().parallelStream().map(a -> { try { - return initManager(a.path()); + return initManager(a.number(), a.path()); } catch (NotRegisteredException | IOException | AccountCheckException e) { logger.warn("Ignoring {}: {} ({})", a.number(), e.getMessage(), e.getClass().getSimpleName()); return null; @@ -125,14 +125,16 @@ public class SignalAccountFiles { final var accountPath = accountsStore.getPathByNumber(number); if (accountPath == null || !SignalAccount.accountFileExists(pathConfig.dataPath(), accountPath)) { final var newAccountPath = accountPath == null ? accountsStore.addAccount(number, null) : accountPath; - var identityKey = KeyUtils.generateIdentityKeyPair(); + var aciIdentityKey = KeyUtils.generateIdentityKeyPair(); + var pniIdentityKey = KeyUtils.generateIdentityKeyPair(); var registrationId = KeyHelper.generateRegistrationId(false); var profileKey = KeyUtils.createProfileKey(); var account = SignalAccount.create(pathConfig.dataPath(), newAccountPath, number, - identityKey, + aciIdentityKey, + pniIdentityKey, registrationId, profileKey, trustNewIdentity);