- private void initStores(
- final File dataPath,
- final IdentityKeyPair identityKey,
- final int registrationId,
- final TrustNewIdentity trustNewIdentity
- ) throws IOException {
- recipientStore = RecipientStore.load(getRecipientsStoreFile(dataPath, account), this::mergeRecipients);
-
- preKeyStore = new PreKeyStore(getPreKeysPath(dataPath, account));
- signedPreKeyStore = new SignedPreKeyStore(getSignedPreKeysPath(dataPath, account));
- sessionStore = new SessionStore(getSessionsPath(dataPath, account), recipientStore);
- identityKeyStore = new IdentityKeyStore(getIdentitiesPath(dataPath, account),
- recipientStore,
- identityKey,
- registrationId,
- trustNewIdentity);
- senderKeyStore = new SenderKeyStore(getSharedSenderKeysFile(dataPath, account),
- getSenderKeysPath(dataPath, account),
- recipientStore::resolveRecipientAddress,
- recipientStore);
- signalProtocolStore = new SignalProtocolStore(preKeyStore,
- signedPreKeyStore,
- sessionStore,
- identityKeyStore,
- senderKeyStore,
- this::isMultiDevice);
-
- messageCache = new MessageCache(getMessageCachePath(dataPath, account));
- }
-