From d59480cd232a7d579b9d0f932bedb6a533e4c3a0 Mon Sep 17 00:00:00 2001 From: "Nelson R. Perez" Date: Fri, 22 Feb 2019 18:32:23 -0500 Subject: [PATCH] - Fixed problem with decoding the sender's memos - Updated graphenej --- .../processors/TransfersLoader.kt | 11 ++++++++--- graphenejlib | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/cy/agorise/bitsybitshareswallet/processors/TransfersLoader.kt b/app/src/main/java/cy/agorise/bitsybitshareswallet/processors/TransfersLoader.kt index b32a9aa..334e7fa 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/processors/TransfersLoader.kt +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/processors/TransfersLoader.kt @@ -27,7 +27,6 @@ import io.reactivex.disposables.CompositeDisposable import io.reactivex.schedulers.Schedulers import org.bitcoinj.core.DumpedPrivateKey import org.bitcoinj.core.ECKey -import java.lang.IllegalArgumentException import java.util.* import javax.crypto.AEADBadTagException @@ -257,11 +256,13 @@ class TransfersLoader(private var mContext: Context?) { val memo = op.memo if (memo.byteMessage != null) { - val destinationAddress = memo.destination try { - if (destinationAddress.toString() == myAddress.toString()) { + if (memo.destination.equals(myAddress)) { val decryptedMessage = Memo.decryptMessage(memoKey, memo.source, memo.nonce, memo.byteMessage) memo.plaintextMessage = decryptedMessage + }else if(memo.source.equals(myAddress)){ + val decryptedMessage = Memo.decryptMessage(memoKey, memo.destination, memo.nonce, memo.byteMessage) + memo.plaintextMessage = decryptedMessage } } catch (e: ChecksumException) { Log.e(TAG, "ChecksumException. Msg: " + e.message) @@ -270,6 +271,10 @@ class TransfersLoader(private var mContext: Context?) { Log.e(TAG, "NullPointerException. Msg: " + e.message) } catch (e: Exception) { Log.e(TAG, "Exception while decoding memo. Msg: " + e.message) + Log.e(TAG,"Exception type: " + e) + for(element in e.stackTrace){ + Log.e(TAG, String.format("%s#%s:%d", element.className, element.methodName, element.lineNumber)) + } } } diff --git a/graphenejlib b/graphenejlib index 4c7c7b2..954cf3e 160000 --- a/graphenejlib +++ b/graphenejlib @@ -1 +1 @@ -Subproject commit 4c7c7b29b2d403e8f44a2a955e0ba22169d02a48 +Subproject commit 954cf3e16d77038feff711ed3b93818470e36b15