How can I change SmartCardServices configuration on Big Sur?

I am developing a Java app that integrates with SmartCard reader. One of the features that I try to implement is reading/setting terminal (card reader) configuration without a tag being present on the reader. This can be done by sending so called escape codes.

But to enable these escape codes we need to enable them in the driver. In case of macOS this will be SmartCardServices and the file that I should edit is: /usr/libexec/SmartCardServices/drivers/ifd-ccid.bundle/Contents/Info.plist

I need to set ifdDriverOptions property to 0x0001.

This procedure was described in this helpful GitHub comment https://github.com/pokusew/nfc-pcsc/issues/13

I tried to follow other instructions provided there but I hit the wall with read-only file system error.

I wonder if there is an idiomatic way to change these settings.

Why this is important? Sending new configuration via escape command is the only way to un-brick terminal that was (by mistake) wrongly configured.


Any luck with this? I too am stuck with this.

Looking to use escape codes with the ccid drivers as well. I feel like unless someone from Apple provides us a way to edit that configuration themselves, we'll be locked out of being able to edit the plist for quite a while. Seems they only provide using /etc/synthetic.conf to create directories that show up as if they exist in the root directory, however there are no clues to a mechanics that they envision us using to edit the Info.plist file to achieve what we need to re-enable the support.

How are smart card reader developers able to implement support with the CCID driver if they can't add new vendor and device IDs to the list?

It took Apple completely dropping the ball with Sonoma in terms of smart card reader support for the solution to this problem to come to light. In turns out, there is a way to completely ignore the CCID driver that comes with OSX and just install you own. Not sure why I never thought about doing that until I was forced to do it. Here are the steps I took to achieve this:

Make sure you have installed both libusb and pkg-config from brew.

  1. Download the latest CCID driver from here https://ccid.apdu.fr/files/ and unzip it
  2. In terminal, cd to where the libs from libusb are installed (mine was in /opt/homebrew/Cellar/libusb/1.0.26/lib) and run these 2 commands:
  • mv libusb-1.0.dylib libusb-1.0.lib
  • mv libusb-1.0.0.dylib libusb-1.0.0.lib
  1. cd to where you the CCID stuff and run these 2 commands:
  • pkg-config --libs libusb-1.0
  • pkg-config --cflags libusb-1.0
  1. Install the driver using these commands:
  • ./MacOSX/configure
  • make
  • sudo make install

Assuming you've followed along correctly and everything ran without issues, you should now have a new CCID driver installed in /usr/local/libexec/SmartCardServices/drivers/ifd-ccid.bundle. If you open the bundle, you can find the same Info.plist but this one is editable.

Once you have made all your changes, in order for this driver to take effect you have to reboot the system.

How can I change SmartCardServices configuration on Big Sur?
 
 
Q