aTalk has just completed its SQLite store implementation for use in smack Omemo chat support. During the course of testing, need clarifications on some of my observations.
If I performed an omemoManager.regenerate() on an account, I observed the following and with the error log attached below:
#1: Smack OMEMO always generate two deviceId’s, appear one to be new and another previous old deviceId.
#2: on executing the following: fingerprints = mOmemoManager.getActiveFingerprints(bareJid);
it always return an zero-size fingerprints array.
#3 The method IdentityKeyPair loadOmemoIdentityKeyPair(OmemoManager omemoManager)
always return null. I performed a trace and observe that the loadOmemoIdentityKeyPair uses omemoDevice with default deviceId e.g. 394075726;
however the signedPreKeyPairs is only stored only for the second deviceId e.g. 985033729
This problem prevents aTalk to proceed to start an OMEMO chat.
For testing I force the below method when called, also reset the defult deviceID to the omemoManager.getOwnDevice().getDeviceId()
public void storeOmemoSignedPreKey(OmemoManager omemoManager, int signedPreKeyId, SignedPreKeyRecord signedPreKey)
overwritten any value that was saved previously during
public void setDefaultDeviceId(BareJid user, int defaultDeviceId)
#4: If I performed direct deletion of all the OMEMO tables and regenerate new.
I was able to start an OMEMO chat successfully with conversation after some attempts. I need further investigation on this.
==============================================
I reverts OMEMO chat support to using file-based persistent storage and perform the same. The observed behavior is similar to SQLite implementation for the the test cases #1, #2, #3. #4.
For test case #3, I am unable to verify if a wrong deviceId is being used to retrieve the IdentityKeyPair. However the same exception as below is being thrown.
For case #4, deleteted the OMEMO_Store directory helps aTalk able to start OMEMO chat with conversation again.
// ============== Other Observations ==================
#5: The fingerprint returns by aTalk and conversation is different, although both use the same library. Any explanation?
identityKeyPair.getPublicKey().getFingerprint().replaceAll("\s", “”).
FYI: Although different is return string value, both format are working fine with each application.
------ atalk fingerprint ----------
(byte)0x05,(byte)0x80,(byte)0x50,(byte)0x2c,(byte)0xeb,(byte)0xcb,(byte)0x2d,(by te)0x91,(byte)0x48,(byte)0x17,(byte)0xdf,(byte)0xb3,(byte)0x01,(byte)0x63,(byte) 0xc5,(byte)0x8f,(byte)0xbe,(byte)0xc0,(byte)0x57,(byte)0xac,(byte)0x2d,(byte)0x6 1,(byte)0xee,(byte)0xbc,(byte)0x6b,(byte)0xc9,(byte)0x21,(byte)0x14,(byte)0xea,( byte)0x3a,(byte)0x4e,(byte)0x93,(byte)0x67,
------ conversions fingerprint ----------
05145790293a242735c102b13bca5821fcc0332b41ee17b454dcc5ff3c4e0eb561
=================== atalk-android.apk ==================
An unofficial release of the atalk-android is available for anyone who like to try. It can be downloaded from the link below.
Please note this is one off debug version release for anyone who want to try. Some of the debug tools are only available on debug version.
http://atalk.sytes.net/releases/atalk-android/aTalk-debug_V8.1.0.apk
Case #1. open main menu and select
Settings… | Chat Security | Delete OMEMO identities
Case # 4. Open main menu and select
Account settings… | Refresh Persistent Store (icon swipe) | check XEP-0384: OMEMO Encryption ==> Refresh
Need to exit and relaunch atalk-android.
Note: This action in case #4 is needed before upgrade to the next release for SQLite BackEndData support for OMEMO. Otherwise the OMEMO_Store is left un-touch.
// ============ atalk log ======================
07-01 02:56:59.076 D/SMACK: SENT (0):
07-01 02:56:59.086 I/αTalk: [9] impl.msghistory.MessageHistoryServiceImpl.findRecentMessagesPerContact().621 Find recent message for: Jabber:leopard@atalk.org -> abc123@icrypto.com
07-01 02:56:59.116 I/αTalk: [9] impl.msghistory.MessageHistoryServiceImpl.findRecentMessagesPerContact().621 Find recent message for: Jabber:leopard@atalk.org -> hawk@atalk.org
07-01 02:56:59.256 D/SMACK: RECV (0):
07-01 02:56:59.256 D/SMACK: SENT (0):
07-01 02:56:59.266 D/SMACK: RECV (0): 01creation@001498:848608:676287creation@001498:848608:676 287
07-01 02:56:59.456 D/SMACK: RECV (0):
07-01 02:56:59.466 D/SMACK: SENT (0):
07-01 02:56:59.606 E/αTalk: [4] org.jivesoftware.smack.AbstractXMPPConnection.callConnectionAuthenticatedListen er() Exception in authenticated listener
java.lang.NullPointerException: Attempt to invoke virtual method ‘org.whispersystems.libsignal.ecc.ECKeyPair org.whispersystems.libsignal.state.SignedPreKeyRecord.getKeyPair()’ on a null object reference
at org.jivesoftware.smackx.omemo.signal.SignalOmemoKeyUtil.signedPreKeyPublicForBu ndle(SignalOmemoKeyUtil.java:207)
at org.jivesoftware.smackx.omemo.signal.SignalOmemoKeyUtil.signedPreKeyPublicForBu ndle(SignalOmemoKeyUtil.java:56)
at org.jivesoftware.smackx.omemo.OmemoStore.packOmemoBundle(OmemoStore.java:209)
at org.jivesoftware.smackx.omemo.OmemoService.publishBundle(OmemoService.java:301)
at org.jivesoftware.smackx.omemo.OmemoService.initialize(OmemoService.java:228)
at org.jivesoftware.smackx.omemo.OmemoManager.initialize(OmemoManager.java:189)
at org.jivesoftware.smackx.omemo.OmemoManager$1.authenticated(OmemoManager.java:65 8)
at org.jivesoftware.smack.AbstractXMPPConnection.callConnectionAuthenticatedListen er(AbstractXMPPConnection.java:1262)
at org.jivesoftware.smack.AbstractXMPPConnection.afterSuccessfulLogin(AbstractXMPP Connection.java:574)
at org.jivesoftware.smack.tcp.XMPPTCPConnection.afterSuccessfulLogin(XMPPTCPConnec tion.java:378)
at org.jivesoftware.smack.tcp.XMPPTCPConnection.loginInternal(XMPPTCPConnection.ja va:443)
at org.jivesoftware.smack.AbstractXMPPConnection.login(AbstractXMPPConnection.java :493)
at net.java.sip.communicator.impl.protocol.jabber.LoginByPasswordStrategy.login(Lo ginByPasswordStrategy.java:114)
at net.java.sip.communicator.impl.protocol.jabber.ProtocolProviderServiceJabberImp l.connectAndLogin(ProtocolProviderServiceJabberImpl.java:1145)
at net.java.sip.communicator.impl.protocol.jabber.ProtocolProviderServiceJabberImp l.connectAndLogin(ProtocolProviderServiceJabberImpl.java:901)
at net.java.sip.communicator.impl.protocol.jabber.ProtocolProviderServiceJabberImp l.initializeConnectAndLogin(ProtocolProviderServiceJabberImpl.java:749)
at net.java.sip.communicator.impl.protocol.jabber.ProtocolProviderServiceJabberImp l.register(ProtocolProviderServiceJabberImpl.java:526)
at net.java.sip.communicator.util.account.LoginManager$RegisterProvider.run(LoginM anager.java:325)