neuland-ingolstadt / neuland.app-native

React Native version of neuland.app
GNU Affero General Public License v3.0
11 stars 13 forks source link

NFC Reading function for the Students ID #76

Open FabianSimonGross opened 2 years ago

FabianSimonGross commented 2 years ago

Since it's a bit of a pain in the ass to always remember how much money is on the Students ID we could integrate a NFC Reading function so we can e.g. get the current balance, save it in the cookies and display it somewhere?

Or are we with this violating the TOS of THI because we are reading the ID with unauthorized machines?

M4GNV5 commented 2 years ago

This page seems to include some information on reading NDEF tags from the browser: https://web.dev/nfc/, browser support seems to be only android-chrome currently though: https://caniuse.com/?search=NDEFReader The student ID cards are MIFARE Classic cards. While encryption keys can be extracted using e.g. mfoc i am not sure if the web NDEFReader can be used to read "encrypted" mifare classic tags. For mobile we probably should use a native plugin for accesing the native NFC capabilities like this one

I did some reverse engineering on the students ID cards in the past. The remaining mensa balance is saved as a 2-byte integer representing cents, i.e. 1713 means 17.13€. Other data included on the Card includes the "matrikelnummer", "bibliotheksnummer" etc. in ASCII format. This data however is also available via the THI-App API using the persdata request and already displayed in our App on the /personal page.