aboutsummaryrefslogtreecommitdiff
path: root/src/app/config
diff options
context:
space:
mode:
Diffstat (limited to 'src/app/config')
-rw-r--r--src/app/config/config.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/app/config/config.c b/src/app/config/config.c
index a9585d98f2..102d1bbc04 100644
--- a/src/app/config/config.c
+++ b/src/app/config/config.c
@@ -6907,6 +6907,15 @@ get_data_directory(const char *val)
} else {
return tor_strdup(get_windows_conf_root());
}
+#elif defined(__ANDROID__)
+ /* Android apps can only use paths that are configured at runtime.
+ * /data/local/tmp is guaranteed to exist, but is only usable by the
+ * 'shell' and 'root' users, so this fallback is for debugging only. */
+ if (val) {
+ return tor_strdup(val);
+ } else {
+ return tor_strdup("/data/local/tmp");
+ }
#else /* !defined(_WIN32) */
const char *d = val;
if (!d)