-
Notifications
You must be signed in to change notification settings - Fork 400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unhandled Exception: PlatformException(Exception encountered, read, javax.crypto.BadPaddingException: error:1e000065:Cipher functions:OPENSSL_internal:BAD_DECRYPT #354
Comments
Please, either open the previous issue or keep this one open. This is a major bug and should be tracked. |
The current best workaround according to my research is: static Future<String?> getAccessTokenFromDevice() async {
const _storage = FlutterSecureStorage();
try {
final accessToken = await _storage.read(key: 'accessToken');
return accessToken;
} on PlatformException catch (e) {
// Workaround for https://github.com/mogol/flutter_secure_storage/issues/43
await _storage.deleteAll();
}
} This way you don't have to lose out on the shared preferences being backed up like in the other suggestions which are honestly, a bit hacky. It would be good if the library could be updated to handle this issue on its own? |
@NamanShergill Which version of the package are you using? Does this issue still persist? |
|
I have a report from the sentry but can`t reproduce it. Do you get this error every time when trying to read from storage? |
The reproduction method is restoring an app backup from Google after a factory reset/new phone setup or if you have root, through backup apps like Swift backup. The error will show up everytime you try to access the storage, until the user manually clears the app data. |
Got the same error today. |
Got the same error today |
Same error today. |
No specific reason, I am only storing an access token in it so both would be the same for me. However, is there any point in not deleting everything if the plugin will throw an exception every time you try accessing that data? |
I'm also experiencing the same issue, happened for 12 of my end-users in production. I noticed that most of these issues were with Samsung phones, specially the ones named 'SM-G...'. |
This is happening on my Samsung S22. Adding allowBackup and fullBackupContent did not fix the issue. |
this solved my issue |
Got the same error today. |
I will look into this, thanks |
Got the same error today. |
Any Updates ???? |
A user with a pixel 4a had the same problem after a reinstall. deleteAll() did not help (I had this implemented already) only a manual clear of app data did. |
Same here. In our case, anything called through |
So there's no workaround for this? 😭 |
Any updates on this? |
same issue in |
Any progress on this? |
Just to make sure, its safer not to use flutter_secure_storage for android unless this problem is fixed, right? |
If you use version
This causes the package to use Android's built-in EncryptedSharedPreferences. The crash only seems to occur when not using this setting, because then the package uses a different way of encrypting and decrypting the prefs. You can see that by reading the source code here: https://github.com/mogol/flutter_secure_storage/blob/26efe91a75228ad8c8626d6eea18f7f3cb21bdd9/flutter_secure_storage/android/src/main/java/com/it_nomads/fluttersecurestorage/FlutterSecureStoragePlugin.java#L101 Also see #328 (comment) |
Fixed it for me. Thanks :D |
Is there a way to enable this globally? We use storage in quite a few different widgets |
Why not use a different SecureStorage (one that uses |
is it will be backward compatible if the user already has saved data or will crash? |
Same question here, can we activate 'EncryptedSharedPreferences' without any risk for users ? thx |
Still having this issue on v8.0.0 |
- forgot setState on the future so the error widget didnt show. - the error came from a bug in secure_storage after backup restore. juliansteenbakker/flutter_secure_storage#354 - this fix causes all android users to get signed out once
I also had the same problem as you on that version. I just added to the manifest these rules on the application node to solve:
|
Still an issue. flutter_secure_storage 9.0.0 in Android 9. |
Got the issue randomly on Android 14 devices, LogCat shows following error in production app:
|
Got same today flutter_secure_storage: ^8.1.0 |
This comment was marked as resolved.
This comment was marked as resolved.
Also curious does it happen on other operations like write() for anyone? |
Any news on this? I am seeing it happen today on Android 9 |
This issue is probably caused by the JetSec Crypto library. I am trying to rewrite this library because it is deprecated, and progress will be tracked in #769 . It would be great if someone could test this implementation when the first beta will be released. |
Same situation, instead of only Samsung devices MI devices have also problems with this library. They can not read token from storage. |
i was facing the same issue while debugging in my Samsung device. after struggling for a while i tried a different app id and booom its fixed!@ |
I’m pretty sure because that’s because the new app ID is letting it have fresh new prefs now. Once you have encrypted data in there and it fails to decrypt like above, you’ll likely be back to square one. |
Bon dia!
Actualment estic fora de l'oficina i no tornaré fins al dia 6
de novembre.
Si m'escrius per un tema tecnològic, et recomano escriure a
***@***.***
En cas que necessitis alguna altra cosa, dirigeix-te a
***@***.*** o directament truca al +34 937 371 513, que és el
telèfon general d'eAgora.
Espero que tot vagi bé, ens veiem a la tornada.
Abraçades! 🤗
…--
eAgora
@import ***@***.***;700&display=swap');
Julià
Navarrete
CTO
& Co-founder
+34
937 371 513
***@***.***
www.eagora.app
Av.
de la Cambra de Comerç 42, Redessa, Ed.
CEPID, Reus
(ES)
Los datos y textos (incluyendo direcciones de correo
electrónico y archivos adjuntos) de este mensaje puede
contener información confidencial. Si usted no es el
destinatario final o ha recibido este mensaje por
error, le rogamos nos lo comunique y lo elimine. Los
datos personales serán tratados bajo la
responsabilidad de eAgora Algorisme del canvi S.L.
Para ejercer sus derechos de protección de datos puede
mandar un mensaje a ***@***.***
Si considera que el tratamiento no se ajusta a la
normativa vigente, puede reclamar en agpd.es.
(CA)
Les dades i textos (incloent-hi adreces de correu
electrònic i arxius adjunts) d'aquest missatge poden
contenir informació confidencial. Si vostè no és el
destinatari final o ha rebut aquest missatge per error
li preguem que ens ho comuniqui i l'elimini. Les dades
personals seran tractades sota la responsabilitat
d'eAgora Algorisme del canvi S.L. Per a exercir els
seus drets de protecció de dades pot enviar un
missatge a ***@***.***
Si considera que el tractament no s'ajusta a la
normativa vigent, pot reclamar a agpd.es.
|
Any updates on this issue? This just started happening to our Android users after updating to flutter_secure_storage |
|
Issue is reproducible in release mode where an existing app backup is restored, using Google One or a rooted device.
This issue was being tracked in #161 and still exists in the latest version, yet the issue was closed and still remains closed to this day even after many people confirming the issue was never fixed in the replies.
The text was updated successfully, but these errors were encountered: