feat(flipper): Flipper Zero integration for NFC dump import#239
Open
codebutler wants to merge 5 commits intomasterfrom
Open
feat(flipper): Flipper Zero integration for NFC dump import#239codebutler wants to merge 5 commits intomasterfrom
codebutler wants to merge 5 commits intomasterfrom
Conversation
…ross all platforms iOS: - Replace dispatch_semaphore bridging with suspendCancellableCoroutine in IosCardTransceiver, IosUltralightTechnology, IosVicinityTechnology, and IosFeliCaTagAdapter - Replace runBlocking in IosNfcScanner with CoroutineScope(Dispatchers.IO) + GCD semaphore to avoid blocking GCD's worker queue thread - Use DESFire native protocol directly instead of ISO 7816 SELECT, which requires AIDs registered in Info.plist (unregistered AIDs kill the session) - Add NFCPollingISO15693 to NFC session polling options for NFC-V support - Fix Xcode project paths from stale farebot-app/ to app/ Desktop: - Make NfcReaderBackend.scanLoop() a suspend function, removing runBlocking from PN53xReaderBackend and PcscReaderBackend - Wrap scan coroutine in try/finally to ensure _isScanning resets on cancel - Share a single libusb context in PN533Device instead of per-call init/exit WebUSB: - Remove flush-on-open which left dangling transferIn promises that consumed subsequent device responses - Increase transferIn buffer from 64 to 265 bytes for full PN533 frames - Pass atrRetries to setMaxRetries so InListPassiveTarget self-resolves instead of relying on client-side abort (which WebUSB can't do) DESFire: - Handle COMMAND_ABORTED (0xCA) status code as access control exception
Add new :flipper KMP module with protobuf RPC client that communicates with Flipper Zero over USB serial and BLE. Supports browsing the NFC file system, importing card dumps, and importing MIFARE Classic key dictionaries into the app's global key store. Platform transports: - Android: USB Host API (CDC ACM) + BLE GATT - iOS: Core Bluetooth BLE - Desktop: jSerialComm USB serial - Web: Web Serial API + Web Bluetooth API Also adds: - Global MIFARE Classic key dictionary (global_keys DB table) - ClassicCardReader global key auth fallback - FlipperScreen Compose UI with file browser - FlipperViewModel with connect/import logic - FlipperNfcParser Classic key extraction from sector trailers - Comprehensive tests (unit + integration) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add @ObjCSignatureOverride to conflicting CoreBluetooth delegate methods (centralManager and peripheral overloads) - Fix characteristics list fallback (use early return instead of emptyList<CBCharacteristic>()) - Add Flipper Zero integration section to README - Add flipper/ to project structure in README Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Rename _connected to connected (backing property rule) - Rename FlipperMain.kt to CommandStatus.kt (single class naming) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…hBytes - Import ObjCSignatureOverride from kotlinx.cinterop (not kotlin.experimental) - Use NSData.dataWithBytes() instead of NSData.create() matching existing NfcDataConversions.kt pattern - Remove unnecessary memScoped wrapper from toNSData() Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
:flipperKMP module with protobuf RPC client for Flipper Zero communication over USB serial and BLEPlatform Support
New Files
flipper/— entire new KMP module (RPC client, transports, protobuf, parsers)FlipperScreen.kt,FlipperUiState.kt,FlipperViewModel.kt— UI layerFlipperTransportFactory+ 4 platform implementations — DI-wired transport creationModified Files
ClassicCardReader— global key dictionary fallback authCardKeysPersister— global key CRUD methodsSavedKey.sq—global_keystableFlipperTransportFactoryprovidersHomeScreen— "Flipper Zero" menu itemApp.kt— FlipperScreen navigation routestrings.xml— localized Flipper UI stringsTest plan
:flipper:jvmTest— all pass (varint, protobuf, RPC client, key dict parser, integration):card:classic:jvmTest— global key auth test passes:app:compileKotlinJvm— builds:app:desktop:compileKotlinJvm— builds:app:compileKotlinWasmJs— builds🤖 Generated with Claude Code