Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nk521/upi-lite-x
https://github.com/nk521/upi-lite-x
Last synced: 19 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/nk521/upi-lite-x
- Owner: nk521
- Created: 2024-10-09T14:17:05.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-10-09T14:58:12.000Z (2 months ago)
- Last Synced: 2024-11-26T20:40:55.174Z (26 days ago)
- Language: Python
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# The NFC side of UPI Lite X
# Notes:
1. [IsoDep](https://developer.android.com/reference/android/nfc/tech/IsoDep) to get hold of PICC
2. some Ndef elements in code; not sure what they do. Can be found in Payer class.
3. A different thread to manage NFC session and take care of transactions. Keyword to search is "transceive"; https://developer.android.com/reference/android/nfc/tech/IsoDep#transceive(byte[])
4. JSON encoded data sent/recvd
5. Models are dumped in nfc_models.py
6. IsoDep manages ISO-14443-4 cards. (Not a smart card. Maybe just mimicing ultralight.)LegRequest(VtpRequest(type="OpenContext", data={"contextData": ContextData(...).dict()}))
# The flow (AFAIU)
```mermaid
sequenceDiagram
participant A as Sender (PCD)
participant B as Receiver (PICC)Note over A,B: Possible AID selection
(relay rig fails to properly record this)B->>A: HandshakeModel(0, [1])
A->>B: HandshakeModel(0, [1])
B->>A: LegRequest with ContextData(...)
A->>B: LegResponse with ContextData(...)
B->>A: LegRequest with AuthData(...)
A->>B: LegResponse with AuthData(...)B->>A: LegRequest with StartTransferData(...) [IMPORTANT]
A->>B: LegResponse with RequestValue(...)
B->>A: LegRequest with TransferValue(...)
A->>B: LegResponse with TransferValue(...)Note over A,B: vvv These doesn't matter. vvv
B->>A: LegRequest with empty VtpRequest of type "ContextClose"
A->>B: LegResponse with empty VtpRequest of type "ContextClose"
```