Skip to content

Commit cb94234

Browse files
committed
upd seader
1 parent b31a49a commit cb94234

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

non_catalog_apps/seader/application.fam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ App(
1717
],
1818
fap_icon="icons/logo.png",
1919
fap_category="NFC",
20-
fap_version="2.2",
20+
fap_version="2.3",
2121
fap_author="bettse",
2222
# fap_extbuild=(
2323
# ExtFile(

non_catalog_apps/seader/seader_credential.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ bool seader_credential_save_agnostic(SeaderCredential* cred, const char* name) {
384384

385385
bool seader_credential_save_picopass(SeaderCredential* cred, const char* name) {
386386
uint8_t zero[PICOPASS_BLOCK_LEN] = {0};
387-
uint8_t csn[PICOPASS_BLOCK_LEN] = {0x7a, 0xf5, 0x31, 0x13, 0xfe, 0xff, 0x12, 0xe0};
387+
uint8_t fake_csn[PICOPASS_BLOCK_LEN] = {0x7a, 0xf5, 0x31, 0x13, 0xfe, 0xff, 0x12, 0xe0};
388388
uint8_t cfg[PICOPASS_BLOCK_LEN] = {0x12, 0xff, 0xff, 0xff, 0x7f, 0x1f, 0xff, 0x3c};
389389
uint8_t epurse[PICOPASS_BLOCK_LEN] = {0xff, 0xff, 0xff, 0xff, 0xe3, 0xff, 0xff, 0xff};
390390
uint8_t debit_key[PICOPASS_BLOCK_LEN] = {0xe3, 0xf3, 0x07, 0x84, 0x4a, 0x0b, 0x62, 0x04};
@@ -421,18 +421,18 @@ bool seader_credential_save_picopass(SeaderCredential* cred, const char* name) {
421421
furi_string_printf(temp_str, "Block %d", i);
422422
switch(i) {
423423
case CSN_INDEX:
424-
// TODO: Is there any practical difference here? If so, document.
425-
if(withSIO) {
424+
if(memcmp(cred->diversifier, zero, PICOPASS_BLOCK_LEN) == 0) {
425+
// when doing a downgrade from a non-picopass, we need to use a fake csn
426426
if(!flipper_format_write_hex(
427-
file,
428-
furi_string_get_cstr(temp_str),
429-
cred->diversifier,
430-
PICOPASS_BLOCK_LEN)) {
427+
file, furi_string_get_cstr(temp_str), fake_csn, sizeof(fake_csn))) {
431428
block_saved = false;
432429
}
433430
} else {
434431
if(!flipper_format_write_hex(
435-
file, furi_string_get_cstr(temp_str), csn, sizeof(csn))) {
432+
file,
433+
furi_string_get_cstr(temp_str),
434+
cred->diversifier,
435+
PICOPASS_BLOCK_LEN)) {
436436
block_saved = false;
437437
}
438438
}

0 commit comments

Comments
 (0)