-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NFC: Add write support for the password-protected MF ultralight tag #3364
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -374,8 +374,7 @@ static NfcCommand mf_ultralight_poller_handler_read_tearing_flags(MfUltralightPo | |
NfcCommand command = NfcCommandContinue; | ||
|
||
if(mf_ultralight_support_feature( | ||
instance->feature_set, | ||
MfUltralightFeatureSupportCheckTearingFlag | MfUltralightFeatureSupportSingleCounter)) { | ||
instance->feature_set, MfUltralightFeatureSupportCheckTearingFlag)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gornekich Sorry for the disturbing but would you mind if I create a new PR that only contains changes to this file? These changes correct the wrong feature detection behavior and avoid performing an unnecessary read before write There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nekolab Sorry for late response. Yes, it would be better to make this fix in separate PR. Regarding writing to original card, we have this task in backlog and will implement this soon. |
||
if(instance->tearing_flag_read == instance->tearing_flag_total) { | ||
instance->state = MfUltralightPollerStateTryDefaultPass; | ||
command = NfcCommandReset; | ||
|
@@ -436,7 +435,11 @@ static NfcCommand mf_ultralight_poller_handler_auth(MfUltralightPoller* instance | |
} | ||
} | ||
} | ||
instance->state = MfUltralightPollerStateReadPages; | ||
if(instance->mode == MfUltralightPollerModeRead) { | ||
instance->state = MfUltralightPollerStateReadPages; | ||
} else { | ||
instance->state = MfUltralightPollerStateRequestWriteData; | ||
} | ||
|
||
return command; | ||
} | ||
|
@@ -543,14 +546,8 @@ static NfcCommand mf_ultralight_poller_handler_read_success(MfUltralightPoller* | |
FURI_LOG_D(TAG, "Read success"); | ||
instance->mfu_event.type = MfUltralightPollerEventTypeReadSuccess; | ||
NfcCommand command = instance->callback(instance->general_event, instance->context); | ||
|
||
if(instance->mode == MfUltralightPollerModeRead) { | ||
iso14443_3a_poller_halt(instance->iso14443_3a_poller); | ||
instance->state = MfUltralightPollerStateIdle; | ||
} else { | ||
instance->state = MfUltralightPollerStateRequestWriteData; | ||
} | ||
|
||
iso14443_3a_poller_halt(instance->iso14443_3a_poller); | ||
instance->state = MfUltralightPollerStateIdle; | ||
return command; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It bricks a target card that has different password and AUTHLIM set not 0.