Skip to content

Commit 82b40e2

Browse files
committed
fix: also use keyutils on android
1 parent 54977ee commit 82b40e2

File tree

3 files changed

+3
-24
lines changed

3 files changed

+3
-24
lines changed

src/lobby/credentials/secret.cpp

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
#include "./secret.hpp"
33

4-
#if defined(__linux__)
4+
#if defined(__linux__) || defined(__ANDROID__)
55

66
#include <core/helper/utils.hpp>
77
#include <fmt/format.h>
@@ -165,27 +165,6 @@ secret::SecretStorage::store(const std::string& key, const std::string& value, b
165165
}
166166

167167

168-
[[nodiscard]] std::optional<std::string> secret::SecretStorage::remove(const std::string& key) const {
169-
return std::nullopt;
170-
}
171-
172-
173-
#elif defined(__ANDROID__)
174-
//TODO: use https://developer.android.com/privacy-and-security/keystore
175-
176-
secret::SecretStorage::SecretStorage(KeyringType type) : m_type{ type } { }
177-
178-
179-
[[nodiscard]] helper::expected<std::string, std::string> secret::SecretStorage::load(const std::string& key) const {
180-
return result_string;
181-
}
182-
183-
[[nodiscard]] std::optional<std::string>
184-
secret::SecretStorage::store(const std::string& key, const std::string& value, bool update) const {
185-
return std::nullopt;
186-
}
187-
188-
189168
[[nodiscard]] std::optional<std::string> secret::SecretStorage::remove(const std::string& key) const {
190169
return std::nullopt;
191170
}

src/lobby/credentials/secret.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace secret {
2020
private:
2121
KeyringType m_type;
2222

23-
#if defined(__linux__)
23+
#if defined(__linux__) || defined(__ANDROID__)
2424
key_serial_t m_ring_id;
2525
#elif defined(__CONSOLE__) || defined(__APPLE__)
2626
std::string m_file_path;

tools/dependencies/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ if build_application
280280

281281
endif
282282

283-
if host_machine.system() == 'linux'
283+
if host_machine.system() == 'linux' or (meson.is_cross_build() and host_machine.system() == 'android')
284284
keyutils_dep = dependency('keyutils', required: true, allow_fallback: true)
285285
graphics_lib += {'deps': [graphics_lib.get('deps'), keyutils_dep]}
286286
endif

0 commit comments

Comments
 (0)