novotnyllc / MiFare

MiFare Classic support for UWP and Windows Desktop apps
MIT License
37 stars 29 forks source link

Fix: wrong isChanged #5

Closed f-israel closed 5 years ago

f-israel commented 5 years ago

Fix for issue #3 & #4 - wrong equality check for isChanged (credits to @qyen) Every GetData() (or more accurate GetDataBlockInt()) read the datablock but on flush the isChanged flag was determined wrongly resulting in writing identical data. Without reading cards internals I guess this would extremly shorten the lifespan.

clairernovotny commented 5 years ago

Thanks. I'll merge this in and get an updated nuget out shortly.

clairernovotny commented 5 years ago

What platform do you need this on? Looking to see if I can nuke Win8/WP8 as those are much harder to build now.

f-israel commented 5 years ago

Well I tested with default Desktop .NET. I guess the SequenceEqual is plattform specific? In that case we could try to build our own byte array comparer. I'm not firm with compiling other plattforms.

clairernovotny commented 5 years ago

Those are not platform specific, but I'd release an update with just Desktop .NET and UWP. I wanted to confirm that'd work for you.

f-israel commented 5 years ago

Not sure if understood correctly but until now no update to nuget. Creating a fast test for UWP shouldn't be take too long.

clairernovotny commented 5 years ago

I've just pushed 1.1.3 of the library to NuGet; it should show up there shortly. Thanks for the fix!

f-israel commented 5 years ago

Sry for late response: everything seems right now. Test successfull on .Net and UWP.