-
-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NFC: Add parser for CSC Service Works Reloadable Cash Card #137
Conversation
thank you! ill get to reviewing the code shortly
you should be able to drag and drop into the github text box. if not, open up a ticket on discord :D (i think you already have one, if so let us know there and we'll open a new one)
i assume "refill times" means how many times the card balance was refilled? and if it was never refilled, it shows "new card"? if so, maybe "Topped up X times" or "Top-up Count: X" could work on the other hand, im not sure what the difference between "balance" and "refilled balance" is, and what "card usage left" means |
Sure. I will send that to you on Discord. I see. Top-up count does sound better. Balance is the remaining balance while refilled balance is how much there were when last refilled. So for example if I refilled 20 dollars and spent 10, then I have balance of 10 and refilled balance of 20. Card usage left is a counter that I found on the card memory. It decrements by one each time I use it. |
nice, so maybe "Top-up Count", "Last Top-up", "Card Usages Left", and "Card Value" for new card, those sound good to me ) gonna get to reviewing properly tomorrow, and thanks for the files. also, the section with the checkboxes in the PR template is for the reviewer checking your code :D leave them unchecked, we will check them once we try the code |
Cool! I just changed the wordings accordingly. Thanks and sorry about the checkboxes. This is my first time being involved in a public repo. Still have a lot to learn. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code looks good to me, only need some improvements on key verification, check the individual comments. i can add the key b verification if you want, but need more info from you on the value(s) of key b. also if possible check if key is same for others in same building? having only 1 key could be limiting if its not universal
undraft when ready |
I completely agree about hardcoding key values affecting universal applicability. I have been learning more about the parser verification process and about how to avoid false positives & misses. From my understanding, inside the _verify function one can't access card memory. But the most robust way to verify is checking the format of the memory because they are ususally the most custom designed for the specific company. So I will move all verification steps into the _parser function and leave the task of decoding keys to the users. It's a MFC 1k anyway. To answer your question about Key B, I don't have the value of Key B but Key A suffices reading 16/16 blocks. I tried flipper nested but it didn't support this kind of card. And I don't have a pm3 at hand so... It will be a mystery to be solved. I will send in my commit shortly. Thanks for the review! |
- Deleted key-based verification - Added memory based checksum and backup block checks to ensure better verification performance
Added card type checks and verify for csc specific memory format Formatted the code (indentation etc.)
I am not a developer but I greatly admire the work that all developers do. It's a great job they do |
@zinongli sorry for the delay, i finally looked better at the implementation and it seems meaningful. i cleaned it up a little, remvoed read and verify rather than returning true. can you please verify if it still works correctly? thanks :D |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just waiting for confirmation of functionality
Works great on my end too. Ready for merge! |
thank you! |
What's new
If it's a normal card:
If it's a new card. The card price is read from the card itself. If there were no signature of refill from a vending machine, then the last refill value in the card would reflect the price for getting this card.
For the reviewer