feat: allow to change config and cache dirs with env vars (#2159)

This commit is contained in:
Skylot
2024-04-27 21:48:42 +01:00
parent f2a6a1e942
commit 09fa35f144
13 changed files with 135 additions and 28 deletions
@@ -1,24 +1,15 @@
package jadx.gui.utils.files;
import java.nio.file.Path;
import java.nio.file.Paths;
import dev.dirs.ProjectDirectories;
import jadx.core.utils.files.FileUtils;
import jadx.commons.app.JadxCommonFiles;
public class JadxFiles {
private static final ProjectDirectories DIRS = ProjectDirectories.from("io.github", "skylot", "jadx");
private static final String CONFIG_DIR = DIRS.configDir;
private static final Path CONFIG_DIR = JadxCommonFiles.getConfigDir();
public static final Path GUI_CONF = CONFIG_DIR.resolve("gui.json");
public static final Path CACHES_LIST = CONFIG_DIR.resolve("caches.json");
public static final Path GUI_CONF = Paths.get(CONFIG_DIR, "gui.json");
public static final Path CACHES_LIST = Paths.get(CONFIG_DIR, "caches.json");
public static final Path CACHE_DIR = Paths.get(DIRS.cacheDir);
public static final Path CACHE_DIR = JadxCommonFiles.getCacheDir();
public static final Path PROJECTS_CACHE_DIR = CACHE_DIR.resolve("projects");
static {
FileUtils.makeDirs(Paths.get(CONFIG_DIR));
}
}