Hi all,
I tried to modify Erel's original code in order to access an internal code on a Tag sent to me by a partner.
They call it SID (Siemens SID from ScryptCard), but I wasn't able to find any doc about it.
As far as technologies, UID, ATQA and SAK are concerned I read the same values as the NFC Tool app does.
When it comes to discover the SID I receive a Success = false reply. Below my code (I tried both NfcA and IsoDep):
Command codes appearing in the transceive commands are those that the partner sent to me. First one is to get an Application_ID while the second one is to get the SID.
NFC Tools identifies my tag as an ISO 14443-4, NXP MIFARE DESFire / NXP MIFARE DESFIRE EV1.
Anyone worked with tags like this one before? Any hint? TIA
I tried to modify Erel's original code in order to access an internal code on a Tag sent to me by a partner.
They call it SID (Siemens SID from ScryptCard), but I wasn't able to find any doc about it.
As far as technologies, UID, ATQA and SAK are concerned I read the same values as the NFC Tool app does.
When it comes to discover the SID I receive a Success = false reply. Below my code (I tried both NfcA and IsoDep):
B4X:
Sub Activity_Resume
'forces all nfc intents to be sent to this activity
nfc.EnableForegroundDispatch
Dim si As Intent = Activity.GetStartingIntent
'check that the intent is a new intent
If si.IsInitialized = False Or si = prevIntent Then Return
prevIntent = si
If si.Action.EndsWith("TECH_DISCOVERED") Or si.Action.EndsWith("NDEF_DISCOVERED") Or si.Action.EndsWith("TAG_DISCOVERED") Then
Dim techs As List = nfc.GetTechList(si)
Log($"Techs: ${techs}"$)
If techs.IndexOf("android.nfc.tech.NfcA") > -1 Then
TagTech.Initialize("TagTech", "android.nfc.tech.NfcA" , si)
'Get the UID
Dim jo As JavaObject = TagTech
Dim tag As JavaObject = jo.RunMethod("getTag", Null)
Dim rawId() As Byte = tag.RunMethod("getId", Null)
Dim bc As ByteConverter
Log(bc.HexFromBytes(rawId))
'Connect to the tag
TagTech.Connect
Else
ToastMessageShow("Tag does not support Ndef/NfcA/IsoDep...", True)
End If
End If
End Sub
Private Sub TagTech_Connected (Success As Boolean)
Log($"Connected: ${Success}"$)
If Success = False Then
ToastMessageShow("Error connecting to tag", True)
Log(LastException)
Else
If rdbRead.Checked Then
'after connection
TagTech.RunAsync("TT", "transceive", Array(Array As Byte(0x90, 0x5A, 0x00, 0x00, 0x03, 0xC0, 0x8E, 0xF4, 0x00)), 0)
Wait For TT_RunAsync (Flag As Int, Success As Boolean, Result As Object)
Log(Success)
TagTech.RunAsync("TT", "transceive", Array(Array As Byte(0x90, 0xBD, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00)), 0)
Wait For TT_RunAsync (Flag As Int, Success As Boolean, Result As Object)
Log(Success)
TagTech.Close
Else
WriteNdef(Array(nfc.CreateMimeRecord("text/plain", flTxt1.Text.GetBytes("UTF8")), _
nfc.CreateMimeRecord("text/plain", flTxt2.Text.GetBytes("UTF8"))))
End If
End If
End Sub
NFC Tools identifies my tag as an ISO 14443-4, NXP MIFARE DESFire / NXP MIFARE DESFIRE EV1.
Anyone worked with tags like this one before? Any hint? TIA