Просмотр исходного кода

1.1.0 - Change nested folder name to .nested, remove .keys file after search, bug fixes

AloneLiberty 2 лет назад
Родитель
Сommit
e3651bde62
4 измененных файлов с 17 добавлено и 5 удалено
  1. 1 1
      FAQ.md
  2. 1 1
      mifare_nested_i.h
  3. 14 2
      mifare_nested_worker.c
  4. 1 1
      mifare_nested_worker.h

+ 1 - 1
FAQ.md

@@ -34,7 +34,7 @@ A: Probably you can't. The only way is to forward serial port to Termux and run
 
 
 Q: Where are collected nonces/found keys located?
 Q: Where are collected nonces/found keys located?
 
 
-A: App/desktop script write files in /ext/nfc/nested/ folder. "Check found keys" adds keys directly to your user dictionary.
+A: App/desktop script write files in /ext/nfc/.nested/ folder. "Check found keys" adds keys directly to your user dictionary.
 
 
 Q: I recovered keys via script, but still no new keys found when I try to scan tag?
 Q: I recovered keys via script, but still no new keys found when I try to scan tag?
 
 

+ 1 - 1
mifare_nested_i.h

@@ -19,7 +19,7 @@
 #include <lib/nfc/nfc_device.h>
 #include <lib/nfc/nfc_device.h>
 #include "mifare_nested_icons.h"
 #include "mifare_nested_icons.h"
 
 
-#define NESTED_VERSION_APP "1.0.0"
+#define NESTED_VERSION_APP "1.1.0"
 #define NESTED_GITHUB_LINK "https://github.com/AloneLiberty/FlipperNested"
 #define NESTED_GITHUB_LINK "https://github.com/AloneLiberty/FlipperNested"
 #define NESTED_RECOVER_KEYS_GITHUB_LINK "https://github.com/AloneLiberty/FlipperNestedRecovery"
 #define NESTED_RECOVER_KEYS_GITHUB_LINK "https://github.com/AloneLiberty/FlipperNestedRecovery"
 #define NESTED_NONCE_FORMAT_VERSION "2"
 #define NESTED_NONCE_FORMAT_VERSION "2"

+ 14 - 2
mifare_nested_worker.c

@@ -1125,7 +1125,10 @@ void mifare_nested_worker_check_keys(MifareNestedWorker* mifare_nested_worker) {
            file_stream, furi_string_get_cstr(path), FSAM_READ, FSOM_OPEN_EXISTING)) {
            file_stream, furi_string_get_cstr(path), FSAM_READ, FSOM_OPEN_EXISTING)) {
         FURI_LOG_E(TAG, "Can't open %s", furi_string_get_cstr(path));
         FURI_LOG_E(TAG, "Can't open %s", furi_string_get_cstr(path));
 
 
+        buffered_file_stream_close(file_stream);
+
         mifare_nested_worker_get_nonces_file_path(&data, path);
         mifare_nested_worker_get_nonces_file_path(&data, path);
+
         if(!buffered_file_stream_open(
         if(!buffered_file_stream_open(
                file_stream, furi_string_get_cstr(path), FSAM_READ, FSOM_OPEN_EXISTING)) {
                file_stream, furi_string_get_cstr(path), FSAM_READ, FSOM_OPEN_EXISTING)) {
             mifare_nested_worker->callback(
             mifare_nested_worker->callback(
@@ -1135,9 +1138,14 @@ void mifare_nested_worker_check_keys(MifareNestedWorker* mifare_nested_worker) {
                 MifareNestedWorkerEventNeedKeyRecovery, mifare_nested_worker->context);
                 MifareNestedWorkerEventNeedKeyRecovery, mifare_nested_worker->context);
         }
         }
 
 
+        buffered_file_stream_close(file_stream);
+
+        free(file_stream);
         furi_string_free(path);
         furi_string_free(path);
         furi_string_free(next_line);
         furi_string_free(next_line);
-        buffered_file_stream_close(file_stream);
+        furi_record_close(RECORD_STORAGE);
+
+        return;
     };
     };
 
 
     while(true) {
     while(true) {
@@ -1236,7 +1244,6 @@ void mifare_nested_worker_check_keys(MifareNestedWorker* mifare_nested_worker) {
         }
         }
     }
     }
 
 
-    furi_string_free(path);
     furi_string_free(next_line);
     furi_string_free(next_line);
     buffered_file_stream_close(file_stream);
     buffered_file_stream_close(file_stream);
     free(file_stream);
     free(file_stream);
@@ -1283,7 +1290,12 @@ void mifare_nested_worker_check_keys(MifareNestedWorker* mifare_nested_worker) {
         furi_string_free(key_string);
         furi_string_free(key_string);
     }
     }
 
 
+    if(!storage_simply_remove(storage, furi_string_get_cstr(path))) {
+        FURI_LOG_E(TAG, "Failed to remove key cache file");
+    };
+
     furi_record_close(RECORD_STORAGE);
     furi_record_close(RECORD_STORAGE);
+    furi_string_free(path);
 
 
     mifare_nested_worker->callback(
     mifare_nested_worker->callback(
         MifareNestedWorkerEventKeysFound, mifare_nested_worker->context);
         MifareNestedWorkerEventKeysFound, mifare_nested_worker->context);

+ 1 - 1
mifare_nested_worker.h

@@ -2,7 +2,7 @@
 
 
 #include <lib/nfc/nfc_device.h>
 #include <lib/nfc/nfc_device.h>
 
 
-#define NESTED_FOLDER EXT_PATH("nfc/nested")
+#define NESTED_FOLDER EXT_PATH("nfc/.nested")
 
 
 typedef struct MifareNestedWorker MifareNestedWorker;
 typedef struct MifareNestedWorker MifareNestedWorker;