diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2019-04-01 18:08:28 +0000 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2019-04-03 16:46:18 +0000 |
| commit | 91eef5351fde647b1fe66e21c7cb23be144d770c (patch) | |
| tree | 0c073cd7b72b66041cbec28d900bda33680eaf40 | |
| parent | 25d75659ebac90cb8bc5c5b94961ad26999f16e9 (diff) | |
| download | mullvadvpn-91eef5351fde647b1fe66e21c7cb23be144d770c.tar.xz mullvadvpn-91eef5351fde647b1fe66e21c7cb23be144d770c.zip | |
Configure resources path on Android
| -rw-r--r-- | mullvad-paths/src/resources.rs | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/mullvad-paths/src/resources.rs b/mullvad-paths/src/resources.rs index 6b8e1383af..2ae2e5e2b6 100644 --- a/mullvad-paths/src/resources.rs +++ b/mullvad-paths/src/resources.rs @@ -10,19 +10,26 @@ pub fn get_resource_dir() -> PathBuf { } pub fn get_default_resource_dir() -> PathBuf { - match env::current_exe() { - Ok(mut path) => { - path.pop(); - path - } - Err(e) => { - log::error!( - "Failed finding the install directory. Using working directory: {}", - e - ); - PathBuf::from(".") + #[cfg(not(target_os = "android"))] + { + match env::current_exe() { + Ok(mut path) => { + path.pop(); + path + } + Err(e) => { + log::error!( + "Failed finding the install directory. Using working directory: {}", + e + ); + PathBuf::from(".") + } } } + #[cfg(target_os = "android")] + { + PathBuf::from(crate::APP_PATH) + } } pub fn get_api_ca_path() -> PathBuf { |
