Add NFC tag support with unified device selection#3
Draft
Conversation
Co-authored-by: Harry-Chen <2819727+Harry-Chen@users.noreply.github.com>
Co-authored-by: Harry-Chen <2819727+Harry-Chen@users.noreply.github.com>
Co-authored-by: Harry-Chen <2819727+Harry-Chen@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Support NFC tags
Add NFC tag support with unified device selection
Sep 26, 2025
Contributor
|
@copilot The tests you write do not look very useful, please remove them from the PR. |
Co-authored-by: Harry-Chen <2819727+Harry-Chen@users.noreply.github.com>
Author
Removed the test files as requested. The commit b8eb0e2 removes both |
Signed-off-by: Shengqi Chen <harry-chen@outlook.com>
…move redundant start/stop calls in KeysPage
dangfan
approved these changes
Oct 9, 2025
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.
This PR implements comprehensive NFC tag support for TwoKey, extending the existing CCID-only functionality to work with NFC FIDO2 authenticators. The implementation provides an elegant device selection mechanism when multiple authenticator types are available.
Overview
The changes introduce a unified FIDO API architecture that seamlessly handles both CCID readers and NFC tags through a single interface. Users can now authenticate using NFC-enabled FIDO2 keys on mobile devices while maintaining full backwards compatibility with existing CCID workflows.
Key Features
🔧 Unified Device Management
UnifiedFidoApi: New abstraction layer that automatically detects and manages both CCID and NFC devices📱 NFC Implementation
NfcFidoApi: Complete NFC implementation usingflutter_nfc_kit🎨 Enhanced User Interface
Technical Implementation
The architecture follows the existing
FidoApiinterface pattern, ensuring zero breaking changes:NFC Lifecycle Management
The implementation handles NFC's transient nature through:
transceiveWithReconnect()method for robust communicationDevice Selection Flow
Files Changed
New APIs:
lib/api/nfc_fido_api.dart- NFC FIDO implementationlib/api/unified_fido_api.dart- Unified device selectorEnhanced Components:
lib/viewmodels/keys.dart- Device selection state managementlib/views/keys/keys.dart- Device selection dialoglib/service/authenticator.dart- Device enumeration methodslib/views/keys/widgets/device_info_section.dart- Current device displayBackwards Compatibility
✅ Zero breaking changes - existing CCID workflows continue unchanged
✅ Graceful degradation - falls back to CCID-only on non-mobile platforms
✅ Error handling - clear messages when NFC is unavailable
Fixes #2
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.