kormax/apple-home-key

Example of code

Closed this issue · 4 comments

Hey
Big thanks for all this information

Do you have an example of the code you were using when you got the homekey to trigger on the phone?
https://raw.githubusercontent.com/kormax/apple-enhanced-contactless-polling/main/assets/PN532.ECP.DEMO.webp

Having a look at:
https://github.com/kormax/apple-enhanced-contactless-polling/blob/main/examples/implementations/nfcpy/main.py

Im trying to work out how to setup the broadcast variable, specifically where to obtain the "reader group identifier" or if there is other parts of the response that need to be sent after

Had managed to add the key to the phone via:
https://github.com/KhaosT/HAP-NodeJS/blob/80cdb1535f5bee874cc06657ef283ee91f258815/lock.js

Many Thanks

kormax commented

Hello.

Info about calculation of reader group identifier can found in a following repository created by other person here. (Note that they call it reader identifier, but it means the same thing in that case), to calculate it you have to retrieve reader private key programmed via HAP and do a SHA256 over static data + your key, later taking a part of that data to be used inside of ECP frame.
More info about calculation can be seen in this thread closer to the bottom.
Beware that it covers just the NFC protocol activation part, with the whole communication/encryption part needed to be done on your own as there are no examples available yet.

Regarding the demo code. That is something we are working on, but I cannot give any exact timeframes.

Hey
Many thanks for that, that makes more sense now

And thats great to hear that demo code something your working on, Look forward to seeing/testing this out

Here you can find what you've sought for.