Open bobvann opened 1 month ago
Dear Roberto, Thanks for clarification and support. I launched a similar issue in https://github.com/johnnyb/ntag424-java/issues/5 (FileSettings.encodeToData() is returning to few data) as I tried to "save" the existing file settings in a byte array and later tried to restore the file with the exported/saved file settings. This failed as the export had too few data and the import didn't have enough data so it failed as well. It would be perfect if you could find a solution for both cases, thanks in advance. I know that Jon will be happy to get a "ready to implement" (= copy&paste) solution for the next release. Thanks in advance, Michael
FileSettings decodeFromData(byte[] data) has wrong bytes order.
It looks like SDM access rights bytes are inverted
Correct is the following:
settings.sdmSettings.sdmMetaReadPerm = ByteUtil.leftNibble(sdmAccessRights2); settings.sdmSettings.sdmFileReadPerm = ByteUtil.rightNibble(sdmAccessRights2); settings.sdmSettings.sdmReadCounterRetrievalPerm = ByteUtil.rightNibble(sdmAccessRights1);