frida / frida-tools

Frida CLI tools
Other
348 stars 97 forks source link

Use correct directory for each file type #73

Closed yotamN closed 2 years ago

yotamN commented 2 years ago

The current implementation did not fit well in any operation system. There was some work on support xdg directories but in reality it was rarely used because most people use the default XDG directory without setting the environment variable.

This patch support XDG directories properly in addition of supporting the native folder location in Windows (someone with a bit more knowledge about MacOS could improve it there too). Not only that but I made sure to separate the directories to config, state and data directories just like in the XDG specification (there are more directories that were ignored for now).

NOTICE: It might seems like a lot of code but I had to make sure that I'm migrating the old files properly and I kept the _get_or_create_config_dir even though we don't need it anymore so that same mistake won't happen in the future. I might also want to use it soon in a different patch