Receipt Validation With All the Ethernet Interfaces
I’ve recently run into a case that seems to call into question all extant sample code for Mac App Store receipt validation. […] I learned that the ethernet port of the customer’s Mac was fried as a result of electrical damage from a lightning strike. The Mac’s motherboard was replaced, but afterward the customer still couldn’t launch Magnet, and now they couldn’t launch Link Unshortener either. It turns out that the Mac’s ethernet port is now
en11
rather thanen0
. Apple’s old sample code checked onlyen0
, and Apple’s new sample code checks onlyen0
anden1
, so that technique won’t work. And the technique suggested by Chris Liscio won’t work, because querying forkIOPrimaryInterface
returned no results! The customer’s Mac reported having no primary ethernet interface.My solution was to query all built-in ethernet interfaces—in technical terms,
kIOBuiltin
devices ofkIOEthernetInterfaceClass
—and attempt to validate each interface’s MAC address with the App Store receipt until a match was found. This might be the same technique suggested by Paulo Andrade, but that blog post contains no sample code.
Previously:
2 Comments RSS · Twitter · Mastodon
@Beatrix The receipt includes the MAC address so that you can verify not only that that receipt is valid but also that it corresponds to the Mac the app is running on. Each Ethernet port (or other network interface) has its own MAC address.