diff options
author | euxane | 2024-09-18 23:41:13 +0200 |
---|---|---|
committer | euxane | 2024-09-18 23:41:13 +0200 |
commit | ec3ed8359e80310927770ce5de02a5095ebf9a00 (patch) | |
tree | a8e36cdfb5d76f3d3cf9290b8f8a00db5207ac76 | |
parent | 4b2aa927f8ea1a027bdfa7bc464a6b6bd7acb419 (diff) | |
download | tincapp-ec3ed8359e80310927770ce5de02a5095ebf9a00.tar.gz |
app/paths: move config files and logs back to private storage
-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) |