nylo-core / nylo

Nylo is the fastest way to build your next Flutter mobile app. Streamline your projects with Nylo's opinionated approach to building Flutter apps. Develop your next idea ⚡️
https://nylo.dev
MIT License
597 stars 61 forks source link

new hidden bug #112

Closed andim27 closed 8 months ago

andim27 commented 8 months ago

I found bug in NyStorage: Sometime on old phones have an error

 NyStorage.read at line 200 within nylo_support
PlatformException(Exception encountered, read, javax.crypto.BadPaddingException: error:1e000065:Cipher functions:OPENSSL_internal:BAD_DECRYPT
    at com.android.org.conscrypt.NativeCrypto.EVP_CipherFinal_ex(Native Method)
    at com.android.org.conscrypt.OpenSSLCipher$EVP_CIPHER.doFinalInternal(OpenSSLCipher.java:596)
    at com.android.org.conscrypt.OpenSSLCipher.engineDoFinal(OpenSSLCipher.java:363)

I think better choice use try-catch in the core: in String? data = await StorageManager.storage.read(key: key); Will wait new update

agordn52 commented 8 months ago

Hi @andim27,

Hope you are well, thanks for reporting this.

I've done a bit of digging online and it appears related to the below issues: https://github.com/mogol/flutter_secure_storage/issues/210 https://github.com/BitCodersNN/unn-mobile/issues/224

This appears to be the solution: https://github.com/mogol/flutter_secure_storage/issues/43#issuecomment-471642126

<application
    ...
        android:allowBackup="false"
        android:fullBackupContent="false">

I've updated Nylo in this commit to fix it https://github.com/nylo-core/nylo/commit/2be2d5bb3e17ce1a19345999cfe4bacf3a97f620 👍