Store authentication keys in RawClassicSector#211
Merged
codebutler merged 4 commits intomasterfrom Feb 15, 2026
Merged
Conversation
Fixes #191 The old FareBot CEPASProtocol manually built APDU commands but omitted the Le (expected response length) byte, causing cards to reject with 6D00 (instruction not supported). Replaced with Metrodroid's approach that delegates to ISO7816Protocol.sendRequest() for proper APDU framing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add keyA and keyB fields to RawClassicSector to match Metrodroid's ClassicSectorRaw implementation. Track which keys successfully authenticated each sector during card reading and store them in the raw sector data. Changes: - Add keyA/keyB nullable ByteArray fields to RawClassicSector with @contextual serialization - Update factory methods (createData, createInvalid, createUnauthorized) to accept optional key parameters - Refactor ClassicCardReader to track successful authentication keys and pass them to RawClassicSector Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
b781941 to
6f0b019
Compare
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
Adds
keyAandkeyBfields toRawClassicSectorto align with Metrodroid'sClassicSectorRawimplementation. These fields store which keys successfully authenticated each sector during card reading.This is part of the card module alignment effort (Item 5C).
Changes
keyAandkeyBnullableByteArrayfields toRawClassicSectorwith@Contextualserialization annotationcreateData,createInvalid,createUnauthorized) to accept optional key parametersClassicCardReaderauthentication logic to track successful keys and pass them toRawClassicSectorMetrodroid Reference
metrodroid/src/commonMain/kotlin/au/id/micolous/metrodroid/card/classic/ClassicSectorRaw.ktlines 29-34Test Plan
./gradlew :card:classic:compileKotlinJvm🤖 Generated with Claude Code