From 5fa3c312a592f58af9eba21e259ce5a402d86774 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Tue, 9 May 2017 21:18:28 +0200 Subject: don't load signed prekeys on startup --- .../java/de/pixart/messenger/crypto/axolotl/AxolotlService.java | 2 +- .../de/pixart/messenger/crypto/axolotl/SQLiteAxolotlStore.java | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src/main/java/de/pixart/messenger/crypto') diff --git a/src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java b/src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java index a5ed758c3..b76630873 100644 --- a/src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java +++ b/src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java @@ -599,7 +599,7 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded { // Validate signedPreKeyRecord + ID SignedPreKeyRecord signedPreKeyRecord; - int numSignedPreKeys = axolotlStore.loadSignedPreKeys().size(); + int numSignedPreKeys = axolotlStore.getSignedPreKeysCount(); try { signedPreKeyRecord = axolotlStore.loadSignedPreKey(bundle.getSignedPreKeyId()); if (flush diff --git a/src/main/java/de/pixart/messenger/crypto/axolotl/SQLiteAxolotlStore.java b/src/main/java/de/pixart/messenger/crypto/axolotl/SQLiteAxolotlStore.java index ed944b45a..23024a610 100644 --- a/src/main/java/de/pixart/messenger/crypto/axolotl/SQLiteAxolotlStore.java +++ b/src/main/java/de/pixart/messenger/crypto/axolotl/SQLiteAxolotlStore.java @@ -79,9 +79,6 @@ public class SQLiteAxolotlStore implements AxolotlStore { this.mXmppConnectionService = service; this.localRegistrationId = loadRegistrationId(); this.currentPreKeyId = loadCurrentPreKeyId(); - for (SignedPreKeyRecord record : loadSignedPreKeys()) { - Log.d(Config.LOGTAG, AxolotlService.getLogprefix(account) + "Got Axolotl signed prekey record:" + record.getId()); - } } public int getCurrentPreKeyId() { @@ -415,6 +412,10 @@ public class SQLiteAxolotlStore implements AxolotlStore { return mXmppConnectionService.databaseBackend.loadSignedPreKeys(account); } + public int getSignedPreKeysCount() { + return mXmppConnectionService.databaseBackend.getSignedPreKeysCount(account); + } + /** * Store a local SignedPreKeyRecord. * -- cgit v1.2.3