hyperledger-archives / iroha-android

Android library for Iroha, a Distributed Ledger Technology (blockchain) platform.
https://wiki.hyperledger.org/display/iroha
Apache License 2.0
107 stars 59 forks source link

App crashes on Android 6.0 #74

Closed Gelassen closed 6 years ago

Gelassen commented 7 years ago

The issue

Can not run android application on Android 6.0 (crash in runtime), but it works correctly on Android 5.0

Environment

Android Nexus, Android 6.0

Steps to reproduce

  1. Clone the repo
  2. Run the application on Android 6.0

Observed result

App mingles with screen and Android return back to launcher window

Expected result

App shows registration screen

Stacketrace from unit test:


java.io.IOException: Error while finalizing cipher
at javax.crypto.CipherInputStream.fillBuffer(CipherInputStream.java:104)
at javax.crypto.CipherInputStream.read(CipherInputStream.java:130)
at io.soramitsu.irohaandroid.security.KeyStoreManager.decrypt(KeyStoreManager.java:172)
at io.soramitsu.iroha.CipherTest.testDecryptionOnEmptyString(CipherTest.java:21)
at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:214)
at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:199)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:191)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:176)
at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:555)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1879)
Caused by: javax.crypto.IllegalBlockSizeException
at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:486)
at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:498)
at javax.crypto.Cipher.doFinal(Cipher.java:1476)
at javax.crypto.CipherInputStream.fillBuffer(CipherInputStream.java:102)
... 15 more
Caused by: android.security.KeyStoreException: Unknown error
at android.security.KeyStore.getKeyStoreException(KeyStore.java:632)
at android.security.keystore.KeyStoreCryptoOperationChunkedStreamer.doFinal(KeyStoreCryptoOperationChunkedStreamer.java:224)
at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:473)
... 18 more
kobaken0029 commented 7 years ago

This issue was already resolve for me. but not merge to master yet. now, 'develop' branch is usable! I will merge to master from develop as soon as possible. please just a moment.

Gelassen commented 7 years ago

Checked on my side. App starts without crash! Thank you for fix.

Could you please give more details what was the root cause?

kobaken0029 commented 7 years ago

I guess I was not prepare keypair for encripting/decripting. but I forced decript on sample app. Maybe, this is my mistaken the usase. Sorry^^;

Gelassen commented 7 years ago

Excuse me, but I don't get your explanation :( May I ask you to schedule a call to discuss this? It would be good also to go through others questions I have (you may found skype id in email I shared yesterday)

kobaken0029 commented 7 years ago

Opps… I'm sorry because I'm not good at my English. OK, I'm trying to prepare a time. But I'm busy on today. So I will contact you again tomorrow!

Gelassen commented 7 years ago

Great! Looking forward to speak with you soon

Kind regards, Dmitry Kazakov

2017-03-03 15:37 GMT+08:00 Kento Kobayashi notifications@github.com:

Opps… I'm sorry because I'm not good at my English. OK, I'm trying to prepare a time. But I'm busy on today. So I will contact you again tomorrow!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/hyperledger/iroha-android/issues/74#issuecomment-283886784, or mute the thread https://github.com/notifications/unsubscribe-auth/AAaBjqbMMZf0evYKV_QVH0neHExHLh3eks5rh8M_gaJpZM4MQ7aS .

Gelassen commented 7 years ago

Hello Kobaken, do you have a chance to have a call or chat via skype today?