Skip to content

Commit

Permalink
Revert "upd nfc magic"
Browse files Browse the repository at this point in the history
This reverts commit 574c479.
  • Loading branch information
xMasterX committed Feb 22, 2024
1 parent 287ac5c commit 09f1688
Show file tree
Hide file tree
Showing 31 changed files with 71 additions and 2,874 deletions.
2 changes: 1 addition & 1 deletion base_pack/nfc_magic/application.fam
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ App(
],
stack_size=4 * 1024,
fap_description="Application for writing to NFC tags with modifiable sector 0",
fap_version="1.6",
fap_version="1.5",
fap_icon="assets/Nfc_10px.png",
fap_category="NFC",
fap_private_libs=[
Expand Down
38 changes: 12 additions & 26 deletions base_pack/nfc_magic/lib/magic/nfc_magic_scanner.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "nfc_magic_scanner.h"

#include "protocols/gen1a/gen1a_poller.h"
#include "protocols/gen2/gen2_poller.h"
#include "protocols/gen4/gen4_poller.h"
#include <nfc/nfc_poller.h>

Expand Down Expand Up @@ -66,33 +65,20 @@ static int32_t nfc_magic_scanner_worker(void* context) {
furi_assert(instance->session_state == NfcMagicScannerSessionStateActive);

while(instance->session_state == NfcMagicScannerSessionStateActive) {
do {
if(instance->current_protocol == NfcMagicProtocolGen1) {
instance->magic_protocol_detected = gen1a_poller_detect(instance->nfc);
if(instance->magic_protocol_detected) {
break;
}
} else if(instance->current_protocol == NfcMagicProtocolGen4) {
Gen4PollerError error = gen4_poller_detect(instance->nfc, instance->gen4_password);
if(instance->current_protocol == NfcMagicProtocolGen1) {
instance->magic_protocol_detected = gen1a_poller_detect(instance->nfc);
} else if(instance->current_protocol == NfcMagicProtocolGen4) {
Gen4PollerError error = gen4_poller_detect(instance->nfc, instance->gen4_password);
if(error == Gen4PollerErrorProtocol) {
NfcMagicScannerEvent event = {
.type = NfcMagicScannerEventTypeDetectedNotMagic,
};
instance->callback(event, instance->context);
break;
} else {
instance->magic_protocol_detected = (error == Gen4PollerErrorNone);
if(instance->magic_protocol_detected) {
break;
}
} else if(instance->current_protocol == NfcMagicProtocolGen2) {
Gen2PollerError error = gen2_poller_detect(instance->nfc);
instance->magic_protocol_detected = (error == Gen2PollerErrorNone);
if(instance->magic_protocol_detected) {
break;
}
} else if(instance->current_protocol == NfcMagicProtocolClassic) {
NfcPoller* poller = nfc_poller_alloc(instance->nfc, NfcProtocolMfClassic);
instance->magic_protocol_detected = nfc_poller_detect(poller);
nfc_poller_free(poller);
if(instance->magic_protocol_detected) {
break;
}
}
} while(false);
}

if(instance->magic_protocol_detected) {
NfcMagicScannerEvent event = {
Expand Down
178 changes: 0 additions & 178 deletions base_pack/nfc_magic/lib/magic/protocols/gen2/crypto1.c

This file was deleted.

45 changes: 0 additions & 45 deletions base_pack/nfc_magic/lib/magic/protocols/gen2/crypto1.h

This file was deleted.

Loading

0 comments on commit 09f1688

Please sign in to comment.