Slide 1

Slide 1 text

flutter_secure_storageͱ AndroidόοΫΞοϓͷ஫ҙ఺ potatotips #86 iOS / Android։ൃTipsڞ༗ձ 2024/02/07 
 ෢౻׮

Slide 2

Slide 2 text

ࣗݾ঺հ ● ෢౻׮ (mthiroshi) ● ΤΩαΠτגࣜձࣾ ● ϨγϐαΠτʮEɾϨγϐʯΛ୲౰ ● X (چTwitter) ΞΧ΢ϯτɿmthiroshi_4o

Slide 3

Slide 3 text

ྉཧͷϓϩ͕࡞Δ؆୯ϨγϐαΠτ
 ʮEɾϨγϐʯ ● Web, iOS, AndroidͰఏڙ ● 2023೥10݄ʹ iOS / Android ωΠςΟϒ
 ͔Β Flutter ʹϦϓϨʔε ○ ΤΩαΠτͰ͸ Flutter ϦϓϨʔεΛ
 ਪਐத

Slide 4

Slide 4 text

flutter_secure_storage ύοέʔδ ● ΞϓϦ಺ͷσʔλΛ҉߸Խͯ҆͠શʹอଘ͢ΔͨΊͷϓϥάΠϯ ● Android ͸ SharedPreference ʹ҉߸Խͯ͠อଘ͞ΕΔ ● iOS ͸ KeyChain ʹอଘ͞ΕΔ ● EɾϨγϐͰ͸ɺAPIͷΞΫηετʔΫϯͷอଘʹར༻

Slide 5

Slide 5 text

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 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

Slide 6

Slide 6 text

ϋϚͬͨ໰୊ ● Ϣʔβʔ͔Βෆ۩߹ใࠂ 
 ʮػछมߋΛͨ͠ΒΞϓϦ͕ىಈͰ͖ͳ͘ͳͬͨɻʯ

Slide 7

Slide 7 text

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)

Slide 8

Slide 8 text

https://github.com/mogol/flutter_secure_storage/issues/541

Slide 9

Slide 9 text

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

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

ࠓճͷෆ۩߹ͷܦҢ ● APIͷΞΫηετʔΫϯΛSecureStorageʹอଘ ● ػछมߋͷࡍʹɺAndroidͷόοΫΞοϓػೳʹΑͬͯɺ৽୺຤ʹ҉߸Խ 
 ͞ΕͨΞΫηετʔΫϯ͕Ҡߦ ● ৽୺຤Ͱ͸ɺ҉߸Խʹ࢖ΘΕͨ΋ͷͰ͸ͳ͍҉߸ԽΩʔʹΑͬͯ෮߸ԽΛ 
 ࢼΈͨͨΊྫ֎͕ൃੜ

Slide 13

Slide 13 text

ෆ۩߹ͷղܾํ๏ ● ΞΫηετʔΫϯΛ SecureStorage ͔Βऔಘ͢Δ࣌ʹྫ֎͕ى͖ͨ৔߹͸ɺ ΞΫηετʔΫϯΛ࠶ൃߦ ● Android ͷόοΫΞοϓػೳͷઃఆʹ flutter_secure_storage Λআ֎͢Δઃఆ Λ௥Ճ

Slide 14

Slide 14 text

android:fullBackupContent="@xml/backup_rules" android:icon="@mipmap/ic_launcher" android:label="@string/app_name">

Slide 15

Slide 15 text

·ͱΊ ● flutter_secure_storage ○ σʔλΛ҉߸Խͯ͠อଘ͢ΔϓϥάΠϯ ○ Android όοΫΞοϓػೳ͔Βআ֎͢Δ ● flutter_secure_storage ͷ࢓༷ɺѻ͏σʔλͷಛੑΛߟྀͯ͠ઃܭ΍࣮૷Λ 
 ͢Δ