proxmark3 icon indicating copy to clipboard operation
proxmark3 copied to clipboard

User preferences: implement user preferred paths

Open doegox opened this issue 4 years ago • 9 comments

Continuation of doegox/proxmark-internal#203

It implies probably fixing RfidResearchGroup/proxmark3#129 first and discuss here the exact user experience we'd like to see, in different scenarios.

doegox avatar Apr 26 '20 09:04 doegox

Started work on the initial user preferred paths. for a sanity check, my approach is as follows. Phase 1 - for load calls.

  • have an array of path pointers (this will allow for 1 or more paths and we can then loop through when searching for a file)
  • update loadFileJSON, loadFileEML and loadFile to call searchFile (...) searchFile then (as is) calls searchFinalFile (...)
  • At the bottom of searchFinalFile () i have added the code to loop through the paths array.

If at any point in the searchFinalFile, it finds the file, it will return with that match (i.e. first match). So, if the file is in the current working directory, that will be returned (order can be reviewed in phase 2).

  • In the additional code -- if the first character is a "/" (e.g. /pm3/data) or the 2nd character is a ":" (e.g. d:\pm3\data) then it will assume its a full path, if not, it assumes its relative and prepends get_my_user_directory()

mwalker33 avatar May 03 '20 06:05 mwalker33

Hi @mwalker33 Beware we're chasing extra warnings in the "strict" branch which could impact merging. You can safely backport the changes from that branch for just the preferences.c file if you prefer to avoid difficulties later.

  • https://github.com/RfidResearchGroup/proxmark3/commit/3529aea157fdb488fef2371b4fffbfcace000ed1#diff-e8ac9c7a2a75b77b1e11a68be3f9f276

  • use (void)

  • use static

  • the strdup is because the returned value will be freed by the caller

doegox avatar May 03 '20 10:05 doegox

For 2) please consider also path starting with ./ or .\ which will mean relative to the current working directory

doegox avatar May 03 '20 10:05 doegox

No offence but again, before coding, I'd prefer to have a clear view of scenarios and agree on what we want as user experience before rather than trying to figure out user experience from the changes implemented in code.

doegox avatar May 03 '20 10:05 doegox

Sorry lads.... works got me very busy atm. Did you have an eta for the "strict" to go live? Might pay to wait? Thanks.

mwalker33 avatar May 05 '20 04:05 mwalker33

strict branch is now "green" and @iceman1001 fixed some RPIZ warnings today so it should be good for merge, @iceman1001 ?

doegox avatar May 05 '20 09:05 doegox

With all your fixes, its only down to "warnings" for cmdtrace.c which we are already chatting about. Merge, go go go!
Don't forget I updated to BT manual in Master.

iceman1001 avatar May 05 '20 09:05 iceman1001

done

doegox avatar May 05 '20 09:05 doegox

@mwalker33 what was left for your implementation to be finished?

iceman1001 avatar Feb 05 '22 11:02 iceman1001