mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-23 13:21:44 +03:00
Avoid storage errors, clean up temporary files
This commit is contained in:
parent
00f356469e
commit
4f722a00c0
@ -171,20 +171,25 @@ static void nfc_scene_mf_classic_dict_attack_prepare_view(NfcApp* instance) {
|
||||
do {
|
||||
instance->nfc_dict_context.enhanced_dict = true;
|
||||
|
||||
// TODO: Check for errors
|
||||
storage_common_remove(instance->storage, NFC_APP_MF_CLASSIC_DICT_SYSTEM_NESTED_PATH);
|
||||
storage_common_copy(
|
||||
instance->storage,
|
||||
NFC_APP_MF_CLASSIC_DICT_SYSTEM_PATH,
|
||||
NFC_APP_MF_CLASSIC_DICT_SYSTEM_NESTED_PATH);
|
||||
if(keys_dict_check_presence(NFC_APP_MF_CLASSIC_DICT_SYSTEM_NESTED_PATH)) {
|
||||
storage_common_remove(
|
||||
instance->storage, NFC_APP_MF_CLASSIC_DICT_SYSTEM_NESTED_PATH);
|
||||
}
|
||||
if(keys_dict_check_presence(NFC_APP_MF_CLASSIC_DICT_SYSTEM_PATH)) {
|
||||
storage_common_copy(
|
||||
instance->storage,
|
||||
NFC_APP_MF_CLASSIC_DICT_SYSTEM_PATH,
|
||||
NFC_APP_MF_CLASSIC_DICT_SYSTEM_NESTED_PATH);
|
||||
}
|
||||
|
||||
if(!keys_dict_check_presence(NFC_APP_MF_CLASSIC_DICT_USER_PATH)) {
|
||||
state = DictAttackStateSystemDictInProgress;
|
||||
break;
|
||||
}
|
||||
|
||||
// TODO: Check for errors
|
||||
storage_common_remove(instance->storage, NFC_APP_MF_CLASSIC_DICT_USER_NESTED_PATH);
|
||||
if(keys_dict_check_presence(NFC_APP_MF_CLASSIC_DICT_USER_NESTED_PATH)) {
|
||||
storage_common_remove(instance->storage, NFC_APP_MF_CLASSIC_DICT_USER_NESTED_PATH);
|
||||
}
|
||||
storage_common_copy(
|
||||
instance->storage,
|
||||
NFC_APP_MF_CLASSIC_DICT_USER_PATH,
|
||||
@ -376,6 +381,14 @@ void nfc_scene_mf_classic_dict_attack_on_exit(void* context) {
|
||||
instance->nfc_dict_context.msb_count = 0;
|
||||
instance->nfc_dict_context.enhanced_dict = false;
|
||||
|
||||
// Clean up temporary files used for nested dictionary attack
|
||||
if(keys_dict_check_presence(NFC_APP_MF_CLASSIC_DICT_USER_NESTED_PATH)) {
|
||||
storage_common_remove(instance->storage, NFC_APP_MF_CLASSIC_DICT_USER_NESTED_PATH);
|
||||
}
|
||||
if(keys_dict_check_presence(NFC_APP_MF_CLASSIC_DICT_SYSTEM_NESTED_PATH)) {
|
||||
storage_common_remove(instance->storage, NFC_APP_MF_CLASSIC_DICT_SYSTEM_NESTED_PATH);
|
||||
}
|
||||
|
||||
nfc_blink_stop(instance);
|
||||
notification_message(instance->notifications, &sequence_display_backlight_enforce_auto);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user