mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-22 05:14:46 -07:00
Properly return when a key is found in user dict
This commit is contained in:
@@ -39,6 +39,7 @@ NfcCommand nfc_mf_ultralight_c_dict_attack_worker_callback(NfcGenericEvent event
|
|||||||
} else if(poller_event->type == MfUltralightPollerEventTypeReadSuccess) {
|
} else if(poller_event->type == MfUltralightPollerEventTypeReadSuccess) {
|
||||||
nfc_device_set_data(
|
nfc_device_set_data(
|
||||||
instance->nfc_device, NfcProtocolMfUltralight, nfc_poller_get_data(instance->poller));
|
instance->nfc_device, NfcProtocolMfUltralight, nfc_poller_get_data(instance->poller));
|
||||||
|
instance->mf_ultralight_c_dict_context.auth_success = true;
|
||||||
view_dispatcher_send_custom_event(
|
view_dispatcher_send_custom_event(
|
||||||
instance->view_dispatcher, NfcCustomEventDictAttackComplete);
|
instance->view_dispatcher, NfcCustomEventDictAttackComplete);
|
||||||
command = NfcCommandStop;
|
command = NfcCommandStop;
|
||||||
@@ -130,18 +131,25 @@ bool nfc_scene_mf_ultralight_c_dict_attack_on_event(void* context, SceneManagerE
|
|||||||
if(event.type == SceneManagerEventTypeCustom) {
|
if(event.type == SceneManagerEventTypeCustom) {
|
||||||
if(event.event == NfcCustomEventDictAttackComplete) {
|
if(event.event == NfcCustomEventDictAttackComplete) {
|
||||||
if(state == DictAttackStateUserDictInProgress) {
|
if(state == DictAttackStateUserDictInProgress) {
|
||||||
nfc_poller_stop(instance->poller);
|
if(instance->mf_ultralight_c_dict_context.auth_success) {
|
||||||
nfc_poller_free(instance->poller);
|
notification_message(instance->notifications, &sequence_success);
|
||||||
keys_dict_free(instance->mf_ultralight_c_dict_context.dict);
|
scene_manager_next_scene(instance->scene_manager, NfcSceneReadSuccess);
|
||||||
scene_manager_set_scene_state(
|
dolphin_deed(DolphinDeedNfcReadSuccess);
|
||||||
instance->scene_manager,
|
consumed = true;
|
||||||
NfcSceneMfUltralightCDictAttack,
|
} else {
|
||||||
DictAttackStateSystemDictInProgress);
|
nfc_poller_stop(instance->poller);
|
||||||
nfc_scene_mf_ultralight_c_dict_attack_prepare_view(instance);
|
nfc_poller_free(instance->poller);
|
||||||
instance->poller = nfc_poller_alloc(instance->nfc, NfcProtocolMfUltralight);
|
keys_dict_free(instance->mf_ultralight_c_dict_context.dict);
|
||||||
nfc_poller_start(
|
scene_manager_set_scene_state(
|
||||||
instance->poller, nfc_mf_ultralight_c_dict_attack_worker_callback, instance);
|
instance->scene_manager,
|
||||||
consumed = true;
|
NfcSceneMfUltralightCDictAttack,
|
||||||
|
DictAttackStateSystemDictInProgress);
|
||||||
|
nfc_scene_mf_ultralight_c_dict_attack_prepare_view(instance);
|
||||||
|
instance->poller = nfc_poller_alloc(instance->nfc, NfcProtocolMfUltralight);
|
||||||
|
nfc_poller_start(
|
||||||
|
instance->poller, nfc_mf_ultralight_c_dict_attack_worker_callback, instance);
|
||||||
|
consumed = true;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
notification_message(instance->notifications, &sequence_success);
|
notification_message(instance->notifications, &sequence_success);
|
||||||
scene_manager_next_scene(instance->scene_manager, NfcSceneReadSuccess);
|
scene_manager_next_scene(instance->scene_manager, NfcSceneReadSuccess);
|
||||||
|
|||||||
Reference in New Issue
Block a user