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

Bump version, new file icon, small fixes

Zachary Weiss 3 лет назад
Родитель
Сommit
982a926246

+ 20 - 20
helpers/mag_helpers.c

@@ -346,24 +346,24 @@ void mag_spoof_bitwise(Mag* mag) {
             uint8_t byte = i / 8;
             uint8_t byte = i / 8;
             uint8_t bitmask = 1 << (7 - (i % 8));
             uint8_t bitmask = 1 << (7 - (i % 8));
             /* this comment is mostly for zw's convenience:
             /* this comment is mostly for zw's convenience:
-         *
-         * bits are stored in their arrays like on a card (LSB first). This is not how usually bits are stored in a
-         * byte, with the MSB first. the var bitmask creates the pattern to iterate through each bit, LSB first, like so
-         * 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01, 0x80... masking bits one by one from the current byte
-         *
-         * i've chosen this LSB approach since bits and bytes are hard enough to visualize with the 5/8 and 7/8 encoding
-         * MSR uses. It's a biiit more complicated to process, but visualizing it with printf or a debugger is
-         * infinitely easier
-         *
-         * Encoding the following pairs of 5 bits as 5/8: A1234 B1234 C1234 D1234
-         * using this LSB format looks like: A1234B12 34C1234D 12340000
-         * using the MSB format, looks like: 21B4321A D4321C43 00004321
-         * this means reading each byte backwards when printing/debugging, and the jumping 16 bits ahead, reading 8 more
-         * bits backward, jumping 16 more bits ahead.
-         *
-         * I find this much more convenient for debugging, with the tiny incovenience of reading the bits in reverse
-         * order. THus, the reason for the bitmask above
-         */
+             *
+             * bits are stored in their arrays like on a card (LSB first). This is not how usually bits are stored in a
+             * byte, with the MSB first. the var bitmask creates the pattern to iterate through each bit, LSB first, like so
+             * 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01, 0x80... masking bits one by one from the current byte
+             *
+             * i've chosen this LSB approach since bits and bytes are hard enough to visualize with the 5/8 and 7/8 encoding
+             * MSR uses. It's a biiit more complicated to process, but visualizing it with printf or a debugger is
+             * infinitely easier
+             *
+             * Encoding the following pairs of 5 bits as 5/8: A1234 B1234 C1234 D1234
+             * using this LSB format looks like: A1234B12 34C1234D 12340000
+             * using the MSB format, looks like: 21B4321A D4321C43 00004321
+             * this means reading each byte backwards when printing/debugging, and the jumping 16 bits ahead, reading 8 more
+             * bits backward, jumping 16 more bits ahead.
+             *
+             * I find this much more convenient for debugging, with the tiny incovenience of reading the bits in reverse
+             * order. THus, the reason for the bitmask above
+             */
 
 
             bit = !!(bits_t1_manchester[byte] & bitmask);
             bit = !!(bits_t1_manchester[byte] & bitmask);
 
 
@@ -404,7 +404,7 @@ void mag_spoof_bitwise(Mag* mag) {
     FURI_CRITICAL_EXIT();
     FURI_CRITICAL_EXIT();
     free(data1);
     free(data1);
     free(data2);
     free(data2);
-    tx_reset(setting);
+    tx_deinit(setting);
 }
 }
 
 
 // due for deprecation
 // due for deprecation
@@ -460,7 +460,7 @@ void mag_spoof(Mag* mag) {
         FURI_CRITICAL_EXIT();
         FURI_CRITICAL_EXIT();
 
 
         // Reset configured TX method
         // Reset configured TX method
-        if(!tx_reset(setting)) break;
+        if(!tx_deinit(setting)) break;
         spoofed = true;
         spoofed = true;
     } while(0);
     } while(0);
 
 

+ 1 - 1
helpers/mag_types.h

@@ -1,6 +1,6 @@
 #pragma once
 #pragma once
 
 
-#define MAG_VERSION_APP "0.01"
+#define MAG_VERSION_APP "0.02"
 #define MAG_DEVELOPER "Zachary Weiss"
 #define MAG_DEVELOPER "Zachary Weiss"
 #define MAG_GITHUB "github.com/zacharyweiss/magspoof_flipper"
 #define MAG_GITHUB "github.com/zacharyweiss/magspoof_flipper"
 
 

BIN
icons/mag_file_10px.png


BIN
icons/mag_file_1_10px.png


+ 1 - 1
mag_device.c

@@ -179,7 +179,7 @@ bool mag_file_select(MagDevice* mag_dev) {
     mag_app_folder = furi_string_alloc_set(MAG_APP_FOLDER);
     mag_app_folder = furi_string_alloc_set(MAG_APP_FOLDER);
 
 
     DialogsFileBrowserOptions browser_options;
     DialogsFileBrowserOptions browser_options;
-    dialog_file_browser_set_basic_options(&browser_options, MAG_APP_EXTENSION, &I_mag_10px);
+    dialog_file_browser_set_basic_options(&browser_options, MAG_APP_EXTENSION, &I_mag_file_10px);
     browser_options.base_path = MAG_APP_FOLDER;
     browser_options.base_path = MAG_APP_FOLDER;
 
 
     bool res = dialog_file_browser_show(
     bool res = dialog_file_browser_show(

+ 4 - 3
scenes/mag_scene_emulate.c

@@ -13,7 +13,7 @@ void mag_scene_emulate_on_enter(void* context) {
 
 
     // TODO: Display other relevant config settings (namely RFID vs GPIO)?
     // TODO: Display other relevant config settings (namely RFID vs GPIO)?
 
 
-    widget_add_icon_element(widget, 1, 1, &I_mag_10px);
+    widget_add_icon_element(widget, 2, 1, &I_mag_file_10px);
     widget_add_string_element(
     widget_add_string_element(
         widget, 13, 2, AlignLeft, AlignTop, FontPrimary, furi_string_get_cstr(tmp_str));
         widget, 13, 2, AlignLeft, AlignTop, FontPrimary, furi_string_get_cstr(tmp_str));
     furi_string_reset(tmp_str);
     furi_string_reset(tmp_str);
@@ -28,10 +28,11 @@ void mag_scene_emulate_on_enter(void* context) {
         if(is_active_one | is_active_two | is_active_both) {
         if(is_active_one | is_active_two | is_active_both) {
             furi_string_cat_printf(
             furi_string_cat_printf(
                 tmp_str,
                 tmp_str,
-                "Track %d:%s%s\n\n",
+                "Track %d:%s%s%s",
                 (i + 1),
                 (i + 1),
                 furi_string_empty(trackstr) ? "  " : "\n",
                 furi_string_empty(trackstr) ? "  " : "\n",
-                furi_string_empty(trackstr) ? "< empty >" : furi_string_get_cstr(trackstr));
+                furi_string_empty(trackstr) ? "< empty >" : furi_string_get_cstr(trackstr),
+                (i + 1 == MAG_DEV_TRACKS) ? "\n" : "\n\n");
         }
         }
     }
     }
 
 

+ 1 - 1
scenes/mag_scene_saved_info.c

@@ -10,7 +10,7 @@ void mag_scene_saved_info_on_enter(void* context) {
     // Use strlcpy instead perhaps, to truncate to screen width, then add ellipses if needed?
     // Use strlcpy instead perhaps, to truncate to screen width, then add ellipses if needed?
     furi_string_printf(tmp_str, "%s\r\n", mag->mag_dev->dev_name);
     furi_string_printf(tmp_str, "%s\r\n", mag->mag_dev->dev_name);
 
 
-    widget_add_icon_element(widget, 1, 1, &I_mag_10px);
+    widget_add_icon_element(widget, 2, 1, &I_mag_file_10px);
     widget_add_string_element(
     widget_add_string_element(
         widget, 13, 2, AlignLeft, AlignTop, FontPrimary, furi_string_get_cstr(tmp_str));
         widget, 13, 2, AlignLeft, AlignTop, FontPrimary, furi_string_get_cstr(tmp_str));
     furi_string_reset(tmp_str);
     furi_string_reset(tmp_str);