- Fixed problem with decoding the sender's memos

- Updated graphenej
This commit is contained in:
Nelson R. Perez 2019-02-22 18:32:23 -05:00
parent 99e378d123
commit d59480cd23
2 changed files with 9 additions and 4 deletions

View file

@ -27,7 +27,6 @@ import io.reactivex.disposables.CompositeDisposable
import io.reactivex.schedulers.Schedulers import io.reactivex.schedulers.Schedulers
import org.bitcoinj.core.DumpedPrivateKey import org.bitcoinj.core.DumpedPrivateKey
import org.bitcoinj.core.ECKey import org.bitcoinj.core.ECKey
import java.lang.IllegalArgumentException
import java.util.* import java.util.*
import javax.crypto.AEADBadTagException import javax.crypto.AEADBadTagException
@ -257,11 +256,13 @@ class TransfersLoader(private var mContext: Context?) {
val memo = op.memo val memo = op.memo
if (memo.byteMessage != null) { if (memo.byteMessage != null) {
val destinationAddress = memo.destination
try { try {
if (destinationAddress.toString() == myAddress.toString()) { if (memo.destination.equals(myAddress)) {
val decryptedMessage = Memo.decryptMessage(memoKey, memo.source, memo.nonce, memo.byteMessage) val decryptedMessage = Memo.decryptMessage(memoKey, memo.source, memo.nonce, memo.byteMessage)
memo.plaintextMessage = decryptedMessage 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) { } catch (e: ChecksumException) {
Log.e(TAG, "ChecksumException. Msg: " + e.message) Log.e(TAG, "ChecksumException. Msg: " + e.message)
@ -270,6 +271,10 @@ class TransfersLoader(private var mContext: Context?) {
Log.e(TAG, "NullPointerException. Msg: " + e.message) Log.e(TAG, "NullPointerException. Msg: " + e.message)
} catch (e: Exception) { } catch (e: Exception) {
Log.e(TAG, "Exception while decoding memo. Msg: " + e.message) 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))
}
} }
} }

@ -1 +1 @@
Subproject commit 4c7c7b29b2d403e8f44a2a955e0ba22169d02a48 Subproject commit 954cf3e16d77038feff711ed3b93818470e36b15