Skip to content

Commit 982a926

Browse files
committed
Bump version, new file icon, small fixes
1 parent c643942 commit 982a926

7 files changed

+27
-26
lines changed

helpers/mag_helpers.c

+20-20
Original file line numberDiff line numberDiff line change
@@ -346,24 +346,24 @@ void mag_spoof_bitwise(Mag* mag) {
346346
uint8_t byte = i / 8;
347347
uint8_t bitmask = 1 << (7 - (i % 8));
348348
/* this comment is mostly for zw's convenience:
349-
*
350-
* bits are stored in their arrays like on a card (LSB first). This is not how usually bits are stored in a
351-
* byte, with the MSB first. the var bitmask creates the pattern to iterate through each bit, LSB first, like so
352-
* 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01, 0x80... masking bits one by one from the current byte
353-
*
354-
* i've chosen this LSB approach since bits and bytes are hard enough to visualize with the 5/8 and 7/8 encoding
355-
* MSR uses. It's a biiit more complicated to process, but visualizing it with printf or a debugger is
356-
* infinitely easier
357-
*
358-
* Encoding the following pairs of 5 bits as 5/8: A1234 B1234 C1234 D1234
359-
* using this LSB format looks like: A1234B12 34C1234D 12340000
360-
* using the MSB format, looks like: 21B4321A D4321C43 00004321
361-
* this means reading each byte backwards when printing/debugging, and the jumping 16 bits ahead, reading 8 more
362-
* bits backward, jumping 16 more bits ahead.
363-
*
364-
* I find this much more convenient for debugging, with the tiny incovenience of reading the bits in reverse
365-
* order. THus, the reason for the bitmask above
366-
*/
349+
*
350+
* bits are stored in their arrays like on a card (LSB first). This is not how usually bits are stored in a
351+
* byte, with the MSB first. the var bitmask creates the pattern to iterate through each bit, LSB first, like so
352+
* 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01, 0x80... masking bits one by one from the current byte
353+
*
354+
* i've chosen this LSB approach since bits and bytes are hard enough to visualize with the 5/8 and 7/8 encoding
355+
* MSR uses. It's a biiit more complicated to process, but visualizing it with printf or a debugger is
356+
* infinitely easier
357+
*
358+
* Encoding the following pairs of 5 bits as 5/8: A1234 B1234 C1234 D1234
359+
* using this LSB format looks like: A1234B12 34C1234D 12340000
360+
* using the MSB format, looks like: 21B4321A D4321C43 00004321
361+
* this means reading each byte backwards when printing/debugging, and the jumping 16 bits ahead, reading 8 more
362+
* bits backward, jumping 16 more bits ahead.
363+
*
364+
* I find this much more convenient for debugging, with the tiny incovenience of reading the bits in reverse
365+
* order. THus, the reason for the bitmask above
366+
*/
367367

368368
bit = !!(bits_t1_manchester[byte] & bitmask);
369369

@@ -404,7 +404,7 @@ void mag_spoof_bitwise(Mag* mag) {
404404
FURI_CRITICAL_EXIT();
405405
free(data1);
406406
free(data2);
407-
tx_reset(setting);
407+
tx_deinit(setting);
408408
}
409409

410410
// due for deprecation
@@ -460,7 +460,7 @@ void mag_spoof(Mag* mag) {
460460
FURI_CRITICAL_EXIT();
461461

462462
// Reset configured TX method
463-
if(!tx_reset(setting)) break;
463+
if(!tx_deinit(setting)) break;
464464
spoofed = true;
465465
} while(0);
466466

helpers/mag_types.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22

3-
#define MAG_VERSION_APP "0.01"
3+
#define MAG_VERSION_APP "0.02"
44
#define MAG_DEVELOPER "Zachary Weiss"
55
#define MAG_GITHUB "github.com/zacharyweiss/magspoof_flipper"
66

icons/mag_file_10px.png

478 Bytes
Loading

icons/mag_file_1_10px.png

150 Bytes
Loading

mag_device.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ bool mag_file_select(MagDevice* mag_dev) {
179179
mag_app_folder = furi_string_alloc_set(MAG_APP_FOLDER);
180180

181181
DialogsFileBrowserOptions browser_options;
182-
dialog_file_browser_set_basic_options(&browser_options, MAG_APP_EXTENSION, &I_mag_10px);
182+
dialog_file_browser_set_basic_options(&browser_options, MAG_APP_EXTENSION, &I_mag_file_10px);
183183
browser_options.base_path = MAG_APP_FOLDER;
184184

185185
bool res = dialog_file_browser_show(

scenes/mag_scene_emulate.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ void mag_scene_emulate_on_enter(void* context) {
1313

1414
// TODO: Display other relevant config settings (namely RFID vs GPIO)?
1515

16-
widget_add_icon_element(widget, 1, 1, &I_mag_10px);
16+
widget_add_icon_element(widget, 2, 1, &I_mag_file_10px);
1717
widget_add_string_element(
1818
widget, 13, 2, AlignLeft, AlignTop, FontPrimary, furi_string_get_cstr(tmp_str));
1919
furi_string_reset(tmp_str);
@@ -28,10 +28,11 @@ void mag_scene_emulate_on_enter(void* context) {
2828
if(is_active_one | is_active_two | is_active_both) {
2929
furi_string_cat_printf(
3030
tmp_str,
31-
"Track %d:%s%s\n\n",
31+
"Track %d:%s%s%s",
3232
(i + 1),
3333
furi_string_empty(trackstr) ? " " : "\n",
34-
furi_string_empty(trackstr) ? "< empty >" : furi_string_get_cstr(trackstr));
34+
furi_string_empty(trackstr) ? "< empty >" : furi_string_get_cstr(trackstr),
35+
(i + 1 == MAG_DEV_TRACKS) ? "\n" : "\n\n");
3536
}
3637
}
3738

scenes/mag_scene_saved_info.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ void mag_scene_saved_info_on_enter(void* context) {
1010
// Use strlcpy instead perhaps, to truncate to screen width, then add ellipses if needed?
1111
furi_string_printf(tmp_str, "%s\r\n", mag->mag_dev->dev_name);
1212

13-
widget_add_icon_element(widget, 1, 1, &I_mag_10px);
13+
widget_add_icon_element(widget, 2, 1, &I_mag_file_10px);
1414
widget_add_string_element(
1515
widget, 13, 2, AlignLeft, AlignTop, FontPrimary, furi_string_get_cstr(tmp_str));
1616
furi_string_reset(tmp_str);

0 commit comments

Comments
 (0)