--- a/src/crypto/random.c
+++ b/src/crypto/random.c
@@ -21,6 +21,11 @@
 // TODO: This is linux specific
 #include <sys/random.h>
 
+#if defined(__ANDROID__) && __ANDROID_API__ < 28
+#include <syscall.h>
+#define getrandom(buf,buflen,flags) syscall(SYS_getrandom,buf,buflen,flags)
+#endif
+
 void crypto_random(uint8_t* dst, size_t len)
 {
 	getrandom(dst, len, 0);
