Skip to content

Commit

Permalink
upd nfc magic
Browse files Browse the repository at this point in the history
combine PRs n75 by kitsunehunter
and n71 by gornekich
from https://github.com/flipperdevices/flipperzero-good-faps/pulls
  • Loading branch information
xMasterX committed Nov 28, 2023
1 parent 7949334 commit a54596f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions base_pack/nfc_magic/lib/magic/protocols/gen4/gen4_poller.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ NfcCommand gen4_poller_wipe_handler(Gen4Poller* instance) {
instance->state = Gen4PollerStateFail;
break;
}
instance->password = 0;
error = gen4_poller_write_block(
instance, instance->password, instance->current_block, gen4_poller_default_block_0);
if(error != Gen4PollerErrorNone) {
Expand Down
2 changes: 2 additions & 0 deletions base_pack/nfc_magic/scenes/nfc_magic_scene_change_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ void nfc_magic_scene_change_key_on_enter(void* context) {
nfc_magic_app_blink_start(instance);

instance->gen4_poller = gen4_poller_alloc(instance->nfc);
gen4_poller_set_password(instance->gen4_poller, instance->gen4_password);
gen4_poller_start(
instance->gen4_poller, nfc_mafic_scene_change_key_gen4_poller_callback, instance);
}
Expand All @@ -83,6 +84,7 @@ bool nfc_magic_scene_change_key_on_event(void* context, SceneManagerEvent event)
nfc_magic_scene_change_key_setup_view(instance);
consumed = true;
} else if(event.event == NfcMagicCustomEventWorkerSuccess) {
instance->gen4_password = instance->gen4_password_new;
scene_manager_next_scene(instance->scene_manager, NfcMagicSceneSuccess);
consumed = true;
} else if(event.event == NfcMagicCustomEventWorkerFail) {
Expand Down
1 change: 1 addition & 0 deletions base_pack/nfc_magic/scenes/nfc_magic_scene_check.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ void nfc_magic_scene_check_on_enter(void* context) {
nfc_magic_app_blink_start(instance);

nfc_magic_scanner_start(instance->scanner, nfc_magic_check_worker_callback, instance);
nfc_magic_scanner_set_gen4_password(instance->scanner, instance->gen4_password);

view_dispatcher_switch_to_view(instance->view_dispatcher, NfcMagicAppViewPopup);
}
Expand Down
2 changes: 1 addition & 1 deletion base_pack/nfc_magic/scenes/nfc_magic_scene_not_magic.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ void nfc_magic_scene_not_magic_on_enter(void* context) {
widget_add_string_element(
widget, 3, 4, AlignLeft, AlignTop, FontPrimary, "This is wrong card");
widget_add_string_multiline_element(
widget, 4, 17, AlignLeft, AlignTop, FontSecondary, "Not magic or unsupported\ncard");
widget, 4, 17, AlignLeft, AlignTop, FontSecondary, "Not magic or unsupported\ncard. Only Gen1 and\nGen4 UMC cards supported.");
widget_add_button_element(
widget, GuiButtonTypeLeft, "Retry", nfc_magic_scene_not_magic_widget_callback, instance);

Expand Down
1 change: 1 addition & 0 deletions base_pack/nfc_magic/scenes/nfc_magic_scene_write.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ void nfc_magic_scene_write_on_enter(void* context) {
instance->gen1a_poller, nfc_mafic_scene_write_gen1_poller_callback, instance);
} else {
instance->gen4_poller = gen4_poller_alloc(instance->nfc);
gen4_poller_set_password(instance->gen4_poller, instance->gen4_password);
gen4_poller_start(
instance->gen4_poller, nfc_mafic_scene_write_gen4_poller_callback, instance);
}
Expand Down

0 comments on commit a54596f

Please sign in to comment.