Closed StuStirling closed 6 years ago
All the practices mentioned in that StackOverflow answer is already followed in the library. @StuStirling
Ok. From using the library I found that quickly repeated calls to decrypt the same data made it more likely to receive this exception. A solution has been to cache this encrypted data wherever possible, reducing the amount of times its called.
There actually are known issues of the Cipher
class on Samsung devices when used Simultaneously or very frequently.
It's a little outdated, but I'll post an answer here just in case some good folk will be trying to solve that problem.
Samsung devices have different implementation of Cipher
class running in their JVM and in my case I only had to make operations with it synchronized
.
It solved issue for me, so I may take a guess that Samsung's Cipher
is not thread safe.
Cheers!
Hi,
When running my app on a Samsung Galaxy S7 running android version 7.0 I get the following exception:
This happened multiple times but then all of a sudden it just started working successfully. I came across this question in StackOverflow that details the same scenario and a potential solution.