Skip to content

Commit

Permalink
do not use SHARE_DATADIR on Android
Browse files Browse the repository at this point in the history
There is no absolute install path that an app can expect data files on
Android.  Everything is expected to be a path inside of the app, and those
paths depend on the Application ID of the app.  /data/local/tmp is
guaranteed to exist, but will only be usable by the 'shell' and 'root'
users, so this fallback is for debugging only.

This fixes a reproducible issue where the tor-android build harness ended
up including build paths for SHARE_DATADIR.

https://gitlab.torproject.org/tpo/core/tor/-/merge_requests/460
  • Loading branch information
eighthave authored and syphyr committed Jun 1, 2024
1 parent f28be88 commit ffd7e9b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/app/config/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,13 @@ static const config_var_t option_vars_[] = {
#ifdef _WIN32
V(GeoIPFile, FILENAME, "<default>"),
V(GeoIPv6File, FILENAME, "<default>"),
#elif defined(__ANDROID__)
/* Android apps use paths that are configured at runtime.
* /data/local/tmp is guaranteed to exist, but will only be
* usable by the 'shell' and 'root' users, so this fallback is
* for debugging only. */
V(GeoIPFile, FILENAME, "/data/local/tmp/geoip"),
V(GeoIPv6File, FILENAME, "/data/local/tmp/geoip6"),
#else
V(GeoIPFile, FILENAME,
SHARE_DATADIR PATH_SEPARATOR "tor" PATH_SEPARATOR "geoip"),
Expand Down

0 comments on commit ffd7e9b

Please sign in to comment.