novotnyllc / mifare Goto Github PK
View Code? Open in Web Editor NEWMiFare Classic support for UWP and Windows Desktop apps
License: MIT License
MiFare Classic support for UWP and Windows Desktop apps
License: MIT License
Maybe some version mismatch in package 1.0.0.0, but I cannot use last version (as it shows message that it requires newer Win10 version (16299) than my phone can support (15254)).
Error in sample MiFareReader.UWP, file MainPage.xaml.cs, GetDevices method, line:
Reader = await CardReader.FindAsync();
Runtime error System.EntryPointNotFoundException: 'Unable to find an entry point named 'SCardListReadersA' in DLL 'WinScard.dll'.'
I keep getting the following error whenever I try to build the project
Severity Code Description Project File Line Suppression State Error The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\16.0\Bin\Microsoft.CSharp.targets" was not found. Confirm that the expression in the Import declaration "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\16.0\Bin\Microsoft.CSharp.targets" is correct, and that the file exists on disk. MiFareReader.Desktop
I want to use this project to read and write Mifare 1k cards, I know the values for KeyA and KeyB but I can't find the proper combination to perform the read and write over the card.
There is a way for achieve this, I can't see a sample who uses such values.
I try to put together that but I'm stuck with the order of the actions.
After the card is detected and the card object is filled, I try for sector 9:
From the Card Added Event I have:
this.Card = args.SmartCard.CreateMiFareCard();
Outside the event on a button I want to get the sector to Authenticate with the keys
var sector = Card.GetSector(9);
But the authentication fails with Message:
System.AggregateException: One or more errors occurred. ---> MiFare.Classic.CardLoginException: Unable to login in sector 9 with key A or B
at MiFare.Classic.Sector.<GetDataBlockInt>d__25.MoveNext() in C:\Users\Oren\Source\Git\MiFareRT\src\MiFare.Shared\Classic\Sector.cs:line 222
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task`1.get_Result()
at MiFare.Classic.Sector.set_KeyA(String value) in C:\Users\Oren\Source\Git\MiFareRT\src\MiFare.Shared\Classic\Sector.cs:line 67
at SpeeronCheckIn.Hardware.CardReadersWriters.Iso14443_PcSc_Implementation.Write(LogMetaDataEntity callerData, String[] text) in C:\Users\Speeron\Documents\SpeeronTemp\TestProjects\EncodersTest\SpeeronCheckIn.Hardware.CardReadersWriters\Iso14443_PcSc_Implementation.cs:line 262
---> (Inner Exception #0) MiFare.Classic.CardLoginException: Unable to login in sector 9 with key A or B
at MiFare.Classic.Sector.<GetDataBlockInt>d__25.MoveNext() in C:\Users\Oren\Source\Git\MiFareRT\src\MiFare.Shared\Classic\Sector.cs:line 222<---
Looks like I can write the cards and something is missing but I can't find the way, any sugestion to make it work in Mifare 1K?
Hi, Im trying to integrate this device MIFARE ENCODER MF-ECD03 into our application which is written in c#. I'm not really sure where could i start. I tried this library but it cannot detect the encoder.
Can anyone please point me out to the right direction.
Thank you so much.
Guess this shouldn't be that way but trying to dump my card I stumpled over some bug.
Easy to replicate: (for shortening here I didn't use await)
byte[] rawDataS0B0 = card.GetSector(sector).GetData(0).Result; card.Flush().Wait();
throws Exception "CardWriteException: Unable to write in sector 0, block 0".
Only guessing but every GetData also sets the blocks changed property to true? This would extremly shorten the lifespan. Please check into this. Not sure but could be related to #3
I want to use this library to read/write from MiFare DesFire EV1.
It currently support only Mifare Ultralight EV1
I can work and contribute, But I need help, any ideas please how and where to start.
If you attempt calling SmartCardReader reader = await CardReader.FindAsync()
and no card reader is connected, you will get "System.NullReferenceException: Object reference not set to an instance of an object.", because it attempts to await null. It should either return Task.FromResult(null), or be rewritten so it's actually async.
The workaround I had to use is SmartCardReader reader = CardReader.FindAsync()?.Result;
Hi,
The projects do not compile in an updated VS2017 with NET framework 4.7.2.
The errors gotten:
1 -> Error Code: CS0006 | Description: Metadata file 'C:\Users\XXXX\Downloads\MiFare-master\src\MiFare\bin\Debug\net45\MiFare.dll' could not be found | Project: MiFare.Desktop.Tests | File: C:\Users\XXXX\Downloads\MiFare-master\tests\MiFare.Desktop.Tests\CSC | Line: 1 | Suppression State: Active
2 -> Error Code: CS0006 | Description: Metadata file 'C:\Users\XXXX\Downloads\MiFare-master\src\MiFare\bin\Debug\net45\MiFare.dll' could not be found | Project: MiFareReader.Desktop | File: C:\Users\XXXX\Downloads\MiFare-master\samples\MiFareReader.Desktop\CSC | Line: 1 | Suppression State: Active
3 -> Error Code: | Description: Unable to locate repository containing directory 'C:\Users\XXXX\Downloads\MiFare-master\src\MiFare'. | Project: MiFare | File: C:\Users\X.Gisbert.nuget\packages\microsoft.build.tasks.git\1.0.0-beta-63127-02\build\Microsoft.Build.Tasks.Git.targets | Line: 20 | Suppression State:
4 -> Error Code: | Description: Unable to locate repository containing directory 'C:\Users\X.Gisbert\Downloads\MiFare-master\src\MiFare'. | Project: MiFare | File: C:\Users\X.Gisbert.nuget\packages\microsoft.build.tasks.git\1.0.0-beta-63127-02\build\Microsoft.Build.Tasks.Git.targets | Line: 20 | Suppression State:
I have removed my user from the captions.
I infer that the .dll is created when compiling the source code, but it looks like there it's having the repository location problem. I can't see where to hardcode the parent directory to the repository, not in the project properties. Any help to get it running and maybe commit the default config to the master branch?
Thanks
@onovotny Hi, I have problem to use specific authentication
I want to use a specific authentication like this
Thank you in advance.
MiFare.Classic.DataBlock
public bool IsChanged => (!data.Equals(origData));
is maybe
public bool IsChanged => (!data.SequenceEqual(origData));
I'm using ACS ACR122U as reader/writer. According to their docs there are just two key locations (00h~01h). The source code assumes an incrementing location index.
So the question: are just two key locations common for card reader? If so I'd submit a PR for this case.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.