I have a phone (Samsung Galaxy A320F (AKA "A3 (2017)") with the stock ROM that contains a 64-bit armv8l kernel (Linux 3.18.14) and 32-bit userspace with 32-bit Android 8.0.0 platform. Some Android applications provide only 64-bit NDK-based libraries, which makes them incompatible with this setup.
I've tried transferring a few ELF64 binaries to the phone, like
gphoto2 along with
ld-linux-aarch64.so.1 and other parts of glibc. They run fine, so I'm confident in the kernel's ability to handle such binaries.
Now I'd like to try and make the Android platform 64-bit capable. In particular, I'm interested in making the 64-bit-only APK able to communicate with the display, touchscreen and a USB device attached to the phone. I have root access (via Magisk), so in principle, I can hack the system however I like.
My question is now: what components actually make the Android platform 32- or 64-bit? Is it just the VM, or maybe some additional libraries? Or does there have to also be a 64-bit part of the HAL? How many of these components could be taken from e.g. Lineage OS without actually installing the complete Lineage OS? Has anyone even tried to do a similar mod?