Upgrade to Pro — share decks privately, control downloads, hide ads and more …

flutter_secure_storageとAndroidバックアップの注意点

mthiroshi
February 07, 2024

 flutter_secure_storageとAndroidバックアップの注意点

potatotips #86 iOS / Android開発Tips共有会 の登壇資料です。
https://potatotips.connpass.com/event/307311/

資料の概要です。
- flutter_secure_storage パッケージ の概要
- flutter_secure_storage を利用する際のAndroid バックアップ機能の注意点

mthiroshi

February 07, 2024
Tweet

More Decks by mthiroshi

Other Decks in Programming

Transcript

  1. ྉཧͷϓϩ͕࡞Δ؆୯ϨγϐαΠτ
 ʮEɾϨγϐʯ • Web, iOS, AndroidͰఏڙ • 2023೥10݄ʹ iOS /

    Android ωΠςΟϒ
 ͔Β Flutter ʹϦϓϨʔε ◦ ΤΩαΠτͰ͸ Flutter ϦϓϨʔεΛ
 ਪਐத
  2. import 'package:flutter_secure_storage/flutter_secure_storage.dart'; // Create storage final storage = new FlutterSecureStorage();

    // Read value String value = await storage.read(key: key); // Read all values Map<String, String> allValues = await storage.readAll(); // Delete value await storage.delete(key: key); // Delete all await storage.deleteAll(); // Write value await storage.write(key: key, value: value); Ҿ༻:https://pub.dev/packages/flutter_secure_storage#getting-started
  3. 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.OpenSSLEvpCipher.doFinalInternal(OpenSSLEvpCipher.java:15 2) at com.android.org.conscrypt.OpenSSLCipher.engineDoFinal(OpenSSLCipher.java:374) at javax.crypto.Cipher.doFinal(Cipher.java:2056) at l7.h.b(Unknown Source:35) at k7.a.c(Unknown Source:11) at k7.a.k(Unknown Source:17) at k7.e$b.run(Unknown Source:232) at android.os.Handler.handleCallback(Handler.java:942) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:346) at android.os.Looper.loop(Looper.java:475) at android.os.HandlerThread.run(HandlerThread.java:67) , null)
  4. Issue ͔ΒΘ͔ͬͨ͜ͱ • Android ͷόοΫΞοϓػೳ͸ɺσʔλΛ҉߸Խͯ͠όοΫΞοϓ • ҉߸Խʹ࢖ΘΕΔʮ҉߸ԽΩʔʯͷ࢓༷ ◦ ୺຤಺ͷΈͰ࢖ΘΕΔʢ࿙ӮରࡦͱࢥΘΕΔʣ ◦

    ΞϓϦΛ࠶Πϯετʔϧͨ͠৔߹ʹ৽͘͠ੜ੒ • IssueͷέʔεͰ͸ɺόοΫΞοϓσʔλΛ෮ݩ͢Δࡍʹɺ৽͘͠ੜ੒͞Εͨ ҉߸ԽΩʔΛ࢖ͬͨͨΊྫ֎͕ى͖Δɻ
  5. Issue ͔ΒΘ͔ͬͨ͜ͱ • Android ͷόοΫΞοϓػೳ͸ɺσʔλΛ҉߸Խͯ͠όοΫΞοϓ • ҉߸Խʹ࢖ΘΕΔʮ҉߸ԽΩʔʯͷ࢓༷ ◦ ୺຤಺ͷΈͰ࢖ΘΕΔʢ࿙ӮରࡦͱࢥΘΕΔʣ ◦

    ΞϓϦΛ࠶Πϯετʔϧͨ͠৔߹ʹ৽͘͠ੜ੒ • IssueͷέʔεͰ͸ɺόοΫΞοϓσʔλΛ෮ݩ͢Δࡍʹɺ৽͘͠ੜ੒͞Εͨ ҉߸ԽΩʔΛ࢖ͬͨͨΊྫ֎͕ى͖Δɻ
  6. <!-- AndroidManifet.xml -- > <application android:name="${applicationName}" <!-- όοΫΞοϓઃఆ௥Ճ --> android:fullBackupContent="@xml/backup_rules"

    android:icon="@mipmap/ic_launcher" android:label="@string/app_name"> <!-- backup_rules.xml -- > <?xml version="1.0" encoding="utf-8"?> <full-backup-content> <exclude domain="sharedpref" path="FlutterSecureStorage" /> <exclude domain="sharedpref" path="FlutterSecureKeyStorage" /> </full-backup-content>