diff options
Diffstat (limited to 'app/src/main/java/org/pacien')
-rw-r--r-- | app/src/main/java/org/pacien/tincapp/context/AppPaths.kt | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/app/src/main/java/org/pacien/tincapp/context/AppPaths.kt b/app/src/main/java/org/pacien/tincapp/context/AppPaths.kt index 5b88714..f94f1a4 100644 --- a/app/src/main/java/org/pacien/tincapp/context/AppPaths.kt +++ b/app/src/main/java/org/pacien/tincapp/context/AppPaths.kt | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Tinc Mesh VPN: Android client and user interface | 2 | * Tinc Mesh VPN: Android client and user interface |
3 | * Copyright (C) 2017-2023 Euxane P. TRAN-GIRARD | 3 | * Copyright (C) 2017-2024 Euxane P. TRAN-GIRARD |
4 | * | 4 | * |
5 | * This program is free software: you can redistribute it and/or modify | 5 | * This program is free software: you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
@@ -50,13 +50,12 @@ object AppPaths { | |||
50 | private val context by lazy { App.getContext() } | 50 | private val context by lazy { App.getContext() } |
51 | 51 | ||
52 | private fun privateCacheDir() = context.cacheDir!! | 52 | private fun privateCacheDir() = context.cacheDir!! |
53 | private fun publicCacheDir() = context.externalCacheDir!! | 53 | private fun privateFilesDir() = context.filesDir |
54 | private fun publicFilesDir() = context.getExternalFilesDir(null) | ||
55 | private fun binDir() = File(context.applicationInfo.nativeLibraryDir) | 54 | private fun binDir() = File(context.applicationInfo.nativeLibraryDir) |
56 | 55 | ||
57 | fun runtimeDir() = withDir(File(privateCacheDir(), APP_TINC_RUNTIME_DIR)) | 56 | fun runtimeDir() = withDir(File(privateCacheDir(), APP_TINC_RUNTIME_DIR)) |
58 | fun logDir() = withDir(File(publicCacheDir(), APP_LOG_DIR)) | 57 | fun logDir() = withDir(File(privateCacheDir(), APP_LOG_DIR)) |
59 | fun confDir() = withDir(File(publicFilesDir(), APP_TINC_NETWORKS_DIR)) | 58 | fun confDir() = withDir(File(privateFilesDir(), APP_TINC_NETWORKS_DIR)) |
60 | 59 | ||
61 | fun confDir(netName: String) = File(confDir(), netName) | 60 | fun confDir(netName: String) = File(confDir(), netName) |
62 | fun hostsDir(netName: String) = File(confDir(netName), NET_HOSTS_DIR) | 61 | fun hostsDir(netName: String) = File(confDir(netName), NET_HOSTS_DIR) |