adorsys / secure-storage-android

Store strings & credentials securely encrypted on your device
Apache License 2.0
367 stars 58 forks source link

Xiaomi mi a2 lite, library version 1.2.4 #75

Closed MxitarHakobyan closed 4 years ago

MxitarHakobyan commented 4 years ago

E/AndroidRuntime: FATAL EXCEPTION: main Process: am.gear.app, PID: 4600 io.reactivex.exceptions.OnErrorNotImplementedException: The exception was not handled due to missing onError handler in the subscribe() method call. Further reading: https://github.com/ReactiveX/RxJava/wiki/Error-Handling | de.adorsys.android.securestoragelibrary.SecureStorageException: Attempt to invoke virtual method 'java.security.PublicKey java.security.cert.Certificate.getPublicKey()' on a null object reference at io.reactivex.internal.observers.EmptyCompletableObserver.onError(EmptyCompletableObserver.java:50) at io.reactivex.internal.operators.completable.CompletableObserveOn$ObserveOnCompletableObserver.run(CompletableObserveOn.java:87) at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:124) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6694) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) Caused by: de.adorsys.android.securestoragelibrary.SecureStorageException: Attempt to invoke virtual method 'java.security.PublicKey java.security.cert.Certificate.getPublicKey()' on a null object reference at de.adorsys.android.securestoragelibrary.KeystoreTool.encryptMessage(KeystoreTool.java:94) at de.adorsys.android.securestoragelibrary.SecurePreferences.setValue(SecurePreferences.java:59) at am.gear.app.auth.SecureAuthentication.lambda$setPhoneNumber$9$SecureAuthentication(SecureAuthentication.java:117) at am.gear.app.auth.-$$Lambda$SecureAuthentication$dysisfeu2ksPEov0cRP73v_03kY.run(Unknown Source:4) at io.reactivex.internal.operators.completable.CompletablePeek$CompletableObserverImplementation.onComplete(CompletablePeek.java:107) at io.reactivex.internal.disposables.EmptyDisposable.complete(EmptyDisposable.java:68) at io.reactivex.internal.operators.completable.CompletableEmpty.subscribeActual(CompletableEmpty.java:27) at io.reactivex.Completable.subscribe(Completable.java:2309) at io.reactivex.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51) at io.reactivex.Completable.subscribe(Completable.java:2309) at io.reactivex.internal.operators.completable.CompletableSubscribeOn$SubscribeOnObserver.run(CompletableSubscribeOn.java:64) at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578) at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66) at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:764) Caused by: de.adorsys.android.securestoragelibrary.SecureStorageException: Attempt to invoke virtual method 'java.security.PublicKey java.security.cert.Certificate.getPublicKey()' on a null object reference at de.adorsys.android.securestoragelibrary.KeystoreTool.getPublicKey(KeystoreTool.java:182) at de.adorsys.android.securestoragelibrary.KeystoreTool.encryptMessage(KeystoreTool.java:82) at de.adorsys.android.securestoragelibrary.SecurePreferences.setValue(SecurePreferences.java:59)  at am.gear.app.auth.SecureAuthentication.lambda$setPhoneNumber$9$SecureAuthentication(SecureAuthentication.java:117)  at am.gear.app.auth.-$$Lambda$SecureAuthentication$dysisfeu2ksPEov0cRP73v_03kY.run(Unknown Source:4)  at io.reactivex.internal.operators.completable.CompletablePeek$CompletableObserverImplementation.onComplete(CompletablePeek.java:107)  at io.reactivex.internal.disposables.EmptyDisposable.complete(EmptyDisposable.java:68)  at io.reactivex.internal.operators.completable.CompletableEmpty.subscribeActual(CompletableEmpty.java:27)  at io.reactivex.Completable.subscribe(Completable.java:2309)  at io.reactivex.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)  at io.reactivex.Completable.subscribe(Completable.java:2309)  at io.reactivex.internal.operators.completable.CompletableSubscribeOn$SubscribeOnObserver.run(CompletableSubscribeOn.java:64)  at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578)  at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)  at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)  at java.util.concurrent.FutureTask.run(FutureTask.java:266)  at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)  at java.lang.Thread.run(Thread.java:764)  Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.security.PublicKey java.security.cert.Certificate.getPublicKey()' on a null object reference at de.adorsys.android.securestoragelibrary.KeystoreTool.getPublicKey(KeystoreTool.java:174) at de.adorsys.android.securestoragelibrary.KeystoreTool.encryptMessage(KeystoreTool.java:82)  at de.adorsys.android.securestoragelibrary.SecurePreferences.setValue(SecurePreferences.java:59)  at am.gear.app.auth.SecureAuthentication.lambda$setPhoneNumber$9$SecureAuthentication(SecureAuthentication.java:117)  at am.gear.app.auth.-$$Lambda$SecureAuthentication$dysisfeu2ksPEov0cRP73v_03kY.run(Unknown Source:4)  at io.reactivex.internal.operators.completable.CompletablePeek$CompletableObserverImplementation.onComplete(CompletablePeek.java:107)  at io.reactivex.internal.disposables.EmptyDisposable.complete(EmptyDisposable.java:68)  at io.reactivex.internal.operators.completable.CompletableEmpty.subscribeActual(CompletableEmpty.java:27)  at io.reactivex.Completable.subscribe(Completable.java:2309)  at io.reactivex.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)  at io.reactivex.Completable.subscribe(Completable.java:2309)  at io.reactivex.internal.operators.completable.CompletableSubscribeOn$SubscribeOnObserver.run(CompletableSubscribeOn.java:64)  at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578)  at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)  at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)  at java.util.concurrent.FutureTask.run(FutureTask.java:266)  at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 

drilonrecica commented 4 years ago

Hi @MxitarHakobyan ,

Could you reproduce this NullPointerException on another device? java.security.PublicKey java.security.cert.Certificate.getPublicKey() gets called when encrypting data, at which point there already should be a key inside the keystore. Could you please tell me the exact conditions how you are able to reproduce the bug, because just looking at the stacktrace doesn't help me much when I am not able to reproduce the bug on any other device in any constellation.

Thanks

MxitarHakobyan commented 4 years ago

Hi @drilonrecica,

Right now I am trying to reproduce bug but it seems it fixed in this version. I think bug was produced because of my other pc's gradle caches. So i am sorry for trouble. Maybe If in future I will meet this bug again I will try to provide more details.

Thanks

drilonrecica commented 4 years ago

Hi @MxitarHakobyan No problem at all. If you encounter any problem just ping me and I will try to help. Thank you for using secure storage.