Commit b72b981
fix(android): broaden StrongBox fallback and delete corrupted Keystore key on reset
- Catch any GeneralSecurityException when StrongBox is enabled, not just
StrongBoxUnavailableException. Devices like Xiaomi Redmi Note 15 Pro+
throw a plain GeneralSecurityException wrapping a RESET_FAILED error,
which was not caught by the previous narrower check.
- When resetOnError triggers a storage reset, also delete the corrupted
master key entry from the Android Keystore before retrying. This fixes
Keystore2 migration corruption on devices like Galaxy S10e (Android 12).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 6f6ac1a commit b72b981
1 file changed
Lines changed: 11 additions & 10 deletions
File tree
- flutter_secure_storage/android/src/main/java/com/it_nomads/fluttersecurestorage
Lines changed: 11 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
123 | 122 | | |
124 | 123 | | |
125 | 124 | | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
135 | 128 | | |
136 | 129 | | |
137 | 130 | | |
| |||
141 | 134 | | |
142 | 135 | | |
143 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
144 | 145 | | |
145 | 146 | | |
146 | 147 | | |
| |||
0 commit comments