flipperzero-firmware icon indicating copy to clipboard operation
flipperzero-firmware copied to clipboard

NFC user dict list, delete, and de-duplication.

Open djsime1 opened this issue 3 years ago • 14 comments

What's new

  • Mifare Classic user keys can be listed and deleted.
  • Duplicate keys (from user DB) can't be added to user database.
  • ~~(WIP) A memory leak! Find a way to close strings used in submenu entries.~~ Fixed.

Verification

  • Open Mifare Classic Keys menu in NFC
  • If user dict is not empty, list button (right) will be active.
  • Add a few keys, then select one in the list to delete.
  • Verify the correct key was deleted.
  • Try to add a key already present in user database, and get informed it already exists.

Checklist (For Reviewer)

  • [ ] PR has description of feature/bug or link to Confluence/Jira task
  • [ ] Description contains actions to verify feature/bugfix
  • [ ] I've built this code, uploaded it to the device and verified feature/bugfix

djsime1 avatar Aug 04 '22 06:08 djsime1

Hello @djsime1. Thank you for the PR!

Dealing with duplicated keys is a good idea. Also our UX/UI team liked your idea with User dictionary keys listing and deleting. However, we want to add this a little bit differently. Our designer is working on UI for this feature right now and soon it will be in public Miro https://miro.com/app/board/uXjVOlznagk=/?share_link_id=903187096944

I will let you know when the design is ready. Please tell me if you want to rework this PR once design is finalized.

gornekich avatar Aug 17 '22 18:08 gornekich

Also some changes came to dev recently. Please, sync the PR with latest dev

gornekich avatar Aug 17 '22 18:08 gornekich

Got dev merged, I have limited availability the next few weeks but I'll keep an eye out for that UI/UX being published.

djsime1 avatar Aug 18 '22 02:08 djsime1

Jumped up to latest dev and fixed issues caused by icon asset changes.

djsime1 avatar Aug 26 '22 15:08 djsime1

Hello @djsime1 We updated user dictionary flow here https://miro.com/app/board/uXjVOlznagk=/ Please, tell me if you will implement it in this PR

gornekich avatar Aug 26 '22 16:08 gornekich

Hello @djsime1 We updated user dictionary flow here https://miro.com/app/board/uXjVOlznagk=/ Please, tell me if you will implement it in this PR

Yes, I can implement that flow. I'll go with the top "Key exists" screen since I don't know how to draw a canvas atop the byteinput. Even if I did, switching to a popup scene is still simpler.

image

djsime1 avatar Aug 26 '22 16:08 djsime1

Hopefully I'll have this ready by tomorrow night.

djsime1 avatar Aug 27 '22 15:08 djsime1

@gornekich I'm almost ready to push my changes, however Miro won't let me download this icon in its raw format. Could you please reply with the icon attached? Thanks. image

djsime1 avatar Aug 29 '22 18:08 djsime1

@djsime1 I added this asset myself, it's already in dev. Is your PR ready for review?

gornekich avatar Aug 30 '22 11:08 gornekich

@djsime1 I added this asset myself, it's already in dev. Is your PR ready for review?

The keychain icon currently present in dev is not the same as the Miro keychain icon. The dev one is significantly larger, resulting in the scenes title being truncated from "Mifare Classic Keys" to "MF Classic Keys." ~~Additionally, I think there's one tiny bug about pressing LEFT in the delete confirmation screen.~~

Besides that, it is ready for review. My next commit will ~~fix that LEFT bug,~~ as well as the smaller keychain icon if I receive it before the commit is pushed.

EDIT: Forgot I already fixed the bug with previous commit, so the icon is the only thing that's left. Ready for review!

djsime1 avatar Aug 30 '22 15:08 djsime1

Hi bro! We attach that new picture here. Small_keychain_36x39

It was pinned to Miiro board but sometimes it's tricky to download it ((

Karator avatar Aug 30 '22 15:08 Karator

Wrong again I was! The confirmation cancel bug was an odd quirk with the order in which scene loading is handled. Long story short, MFC dict was allocated before the if statement, and free'd at the end of the event callback function. Little did I know the current scenes exit and next scenes enter functions were called in between. Sure enough, the next scene's MFC dict allocate statement was called before our free statement. One last commit and this PR will be finished.

djsime1 avatar Aug 30 '22 18:08 djsime1

Alright, everything's ready to go!

djsime1 avatar Aug 30 '22 18:08 djsime1

Sure, I'll get to work on that when I can.

djsime1 avatar Aug 31 '22 23:08 djsime1

Could someone please review/merge this commit? I've not gotten any feedback in the past week. Thanks!

djsime1 avatar Sep 15 '22 21:09 djsime1

I’ll take a look today. We’ve been waiting for elf support to be merged first.

skotopes avatar Sep 16 '22 03:09 skotopes

Readme changes must have been added by the merge, since I hadn't touched the file at all. I was confused at how the API symbols system worked so I just let it do its thing, but I'll change it back to 1.0. Maintainer push access has been enabled since I originally opened the PR. Lastly, my though process for popup scenes was that you'd be able to dictate where they return too if needed instead of always going to file select. I guess I can undo my changes to the deleted popup since a MFC-Key specific delete scene was added.

djsime1 avatar Sep 16 '22 15:09 djsime1

Done.

djsime1 avatar Sep 16 '22 17:09 djsime1