I had the issue with RSA in my Android code which described in this question Crash casting AndroidKeyStoreRSAPrivateKey to RSAPrivateKey and the accepted answer suggests this solution:
Cipher some_cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");
it works but if I use it Android Studio highlights this code as "Cipher#getInstance should not be called with ECB as the cipher mode or without setting the cipher mode because the default mode on android is ECB, which is insecure."
Is it really safe to use this? Are there any other options?