Android 21 (minSdk) isn't actually supported
currently minSdk is 21, however some libc functions only appears in bionic in latter releases. This causes this error to show in logcat when the "Start VPN" button is pressed.
2022-09-04 19:16:58.061 7469-7469/org.torproject.artitoyvpn E/art: dlopen("/data/app/org.torproject.artitoyvpn-1/lib/x86/libonionmasq_mobile.so", RTLD_LAZY) failed: dlopen failed: cannot locate symbol "freeifaddrs" referenced by "libonionmasq_mobile.so"...
2022-09-04 19:16:58.061 7469-7469/org.torproject.artitoyvpn E/AndroidRuntime: FATAL EXCEPTION: main
Process: org.torproject.artitoyvpn, PID: 7469
java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "freeifaddrs" referenced by "libonionmasq_mobile.so"...
This is the list of symbols causing problems and at what API level I believe they become available:
-
lockf
: API 24 (already reimplemented in rust, does not cause issues) -
clock_getcpuclockid
: API 23 -
getgrgid_r
: API 24 -
getgrnam_r
: API 24 -
getifaddrs
: API 24 -
freeifaddrs
: API 24
The main options I see to fix this issue are:
- change what is considered supported to be API level 24/Android 7.0
- find some way to not link to these functions
- re-implement these functions as for
lockf
- provide stub implementations which always error. If the functions are linked but never actually called, it may be enough, otherwise it will break in terrible ways