From 90c362708e2b1503233898853d3e2f7934a60f93 Mon Sep 17 00:00:00 2001 From: Yukai Li Date: Tue, 15 Nov 2022 01:17:54 -0700 Subject: [PATCH] nfc: Disallow MFUL unlock with reader if card not read yet Trying to read first results in either needing to make a new scene or badly jury rigging other scenes, so let's just not do that --- .../nfc_scene_mf_ultralight_unlock_menu.c | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/applications/main/nfc/scenes/nfc_scene_mf_ultralight_unlock_menu.c b/applications/main/nfc/scenes/nfc_scene_mf_ultralight_unlock_menu.c index 26c8c718f..484629b0b 100644 --- a/applications/main/nfc/scenes/nfc_scene_mf_ultralight_unlock_menu.c +++ b/applications/main/nfc/scenes/nfc_scene_mf_ultralight_unlock_menu.c @@ -19,12 +19,14 @@ void nfc_scene_mf_ultralight_unlock_menu_on_enter(void* context) { uint32_t state = scene_manager_get_scene_state(nfc->scene_manager, NfcSceneMfUltralightUnlockMenu); - submenu_add_item( - submenu, - "Unlock With Reader", - SubmenuIndexMfUlUnlockMenuAuto, - nfc_scene_mf_ultralight_unlock_menu_submenu_callback, - nfc); + if(nfc->dev->dev_data.protocol == NfcDeviceProtocolMifareUl) { + submenu_add_item( + submenu, + "Unlock With Reader", + SubmenuIndexMfUlUnlockMenuAuto, + nfc_scene_mf_ultralight_unlock_menu_submenu_callback, + nfc); + } submenu_add_item( submenu, "Auth As Ameebo", @@ -65,11 +67,7 @@ bool nfc_scene_mf_ultralight_unlock_menu_on_event(void* context, SceneManagerEve scene_manager_next_scene(nfc->scene_manager, NfcSceneMfUltralightUnlockWarn); consumed = true; } else if(event.event == SubmenuIndexMfUlUnlockMenuAuto) { - if(nfc->dev->dev_data.protocol == NfcDeviceProtocolMifareUl) { - scene_manager_next_scene(nfc->scene_manager, NfcSceneMfUltralightUnlockAuto); - } else { - // TODO: go to read scene and read card first - } + scene_manager_next_scene(nfc->scene_manager, NfcSceneMfUltralightUnlockAuto); consumed = true; } scene_manager_set_scene_state(