Repository navigation
Preserve Loon encryption keys while upgrading flutter_secure_storage to 11.x - #46
Open
rayliverified wants to merge 1 commit into
Open
rayliverified wants to merge 1 commit into
rayliverified wants to merge 1 commit into
Conversation
Contributor
Author
|
The There is no migration path from v9 to v11 with a guarantee of no data loss. |
Contributor
Author
|
Android emulator migration findings (installed-app upgrades without clearing data):
The v11 changelog says legacy ciphers were removed and v10 must migrate existing data first. Setting |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
flutter_secure_storage^11.2.0 and keep Loon's existing key name, Android namespace and cipher defaults. Set AndroidresetOnError: falseso a storage/decrypt error does not automatically erase the persistent database encryption key.Migration risk and evidence
Loon stores the AES key as
loon_encrypted_file_persistor_key; file/SQLite ciphertext cannot be read if that key is silently replaced. The v11 changelog states that the 9.x RSA-PKCS1/AES-CBC ciphers were removed and installations originating on v9 must actually run v10 and access/migrate the key before running v11. An app currently declaring v10 is not proof every installed user has completed that step. AndroidresetOnErrordefaults to true; here it is explicitly disabled only for Loon's key, preserving plugin migration and namespace settings.Android emulator upgrade sequence already tested in the NOCD app (secure-storage
authInfotoken, not Loon's AES key): an install with a token written by v10.3.4 retained it when upgraded to v11.2.0; an install with a token written by v9.2.4 lost it on a direct upgrade to v11.2.0 (AEADBadTagException,B2_after.log:583-604); and an install with v9.2.4 data retained the token when v10.3.4 was opened first (C2_v10.log:580-594), then updated to v11.2.0 (C3_after.log). This is observed Android plugin migration behavior, not a test of Loon's own key or encrypted database. The rollout procedure and recovery cautions are indocs/secure_storage_migration.md. Backups and an app-level staged rollout are still mandatory for old installations; an already-deleted key cannot be recovered by this patch.Verification
flutter pub get: resolves flutter_secure_storage 11.2.0; example lockfile updated.dart analyze lib test/core/persistor/data_store_encrypter_test.dart: clean.flutter test test/core test/native: 257 tests passed, including five mocked key-survival regression tests.flutter build ios --simulator --debug(example): built Runner.app; Flutter's local toolchain automatically migrated the sample project to iOS 15 during this verification, but generated migration edits were intentionally excluded from this PR (the committed minimum is iOS 13). No device keychain upgrade was exercised.flutter analyze(whole repo): exits nonzero on two existinguse_null_aware_elementsinfos inbenchmark/value_store/run_core.dart:126,305; no changed-code issues.flutter test(all): fails when VM tries to compiletest/web/indexed_db_persistor_test.dartwithdart:js_interop; core/native suite passes.flutter build apk --debug(example): blocked by pre-existing imperative Flutter Gradleapp_plugin_loader.gradleapplication in the old example project on Flutter 3.47.8, before plugin compilation. Did not change Android emulators or downstream app.