Skip to content

Commit

Permalink
On Android, get_data_directory() should not use LOCALSTATEDIR
Browse files Browse the repository at this point in the history
  • Loading branch information
eighthave authored and uniqx committed Jul 15, 2024
1 parent 2181ff0 commit 72554cf
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/app/config/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -6905,6 +6905,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)
Expand Down

0 comments on commit 72554cf

Please sign in to comment.