Closed fersingb closed 1 year ago
@fersingb i can't reproduce it :(
@LionZXY you actually reproduced it. The key is missing the first 0
The key should be 0a1b2c3d4e5f
EDIT: I think I found the issue here https://github.com/flipperdevices/Flipper-Android-App/blob/686127bf93878efc6d01e1f78080e6e75ba18a66/components/nfc/mfkey32/screen/src/main/java/com/flipperdevices/nfc/mfkey32/screen/viewmodel/MfKey32ViewModel.kt#L159
I guess you should use something like "%012X".format(key)
instead to preserve the leading zeros.
The following code demonstrates the issue:
/**
* You can edit, run, and share this code.
* play.kotlinlang.org
*/
fun main() {
val test = 0x0a1b2c3d4e5f;
val teststr1 = test.toString(radix = 16).uppercase()
val teststr2 = "%012X".format(test)
println(teststr1)
println(teststr2)
}
Oh, thank you, it's my fault
Describe the bug Keys that start with a
0
are not displayed/saved properly. The leading zero is missing, resulting in an invalid keyTo Reproduce Steps to reproduce the behavior:
.mfkey32.log
with the following content:Sec 0 key A cuid 2f05ec42 nt0 bebf5b50 nr0 d34d3251 ar0 a4463233 nt1 a3cfc299 nr1 507d9fde ar1 dac188a7
Expected behavior Leading 0 is correctly displayed and saved
Recovering the key using the CLI tool works without any issue: