RC RANDOM CHAOS

Klepton runs Android VR APKs natively on Apple Vision Pro — no JIT needed

· via Hacker News

Original source

Run Android ARM64 VR APKs on Apple Vision Pro

Hacker News →

Klepton is a compatibility runtime that lets Android ARM64 VR apps run on Apple’s Vision Pro and macOS without emulation or just-in-time compilation. Its klepton-ld component rewrites Android .so libraries into Apple-native .dylib and .framework binaries, leaving most of the guest instruction bytes untouched, then links them against reimplemented platform layers — synthetic bionic libc, NDK, JNI, and Oculus (ovrp_*) shims that map onto libSystem and Apple frameworks. Because it avoids JIT, it targets ‘Java-thin’ apps built on IL2CPP/Unity rather than anything needing ART or a JVM. A notable low-level detail: it patches every use of the x18 register to per-library TLS slots, since older Android code relies on x18 while macOS zeroes it on context switches.

Graphics are bridged by translating OpenGL ES 3.2 to a vendored ANGLE (GLES 3.0 on Metal) and Vulkan to MoltenVK, with ARKit, Compositor Services, GameController, and AVAudioEngine handling the platform frontend. Optional runtime mmap-based patching of .so files is available where JIT is permitted, which some scripting runtimes like LuaJIT or V8 would require.

The headline demo is Beat Saber, which runs on both macOS and visionOS with minor graphical glitches. Steam VR Link support and more general-purpose build tooling remain works in progress. Users supply their own APKs and decompile them with apktool as part of the build. The project is a striking piece of systems engineering — essentially a bespoke Android userspace stood up on Apple’s stack — even if it is early and app-specific for now.

Read the full article

Continue reading at Hacker News →

This is an AI-generated summary. Read the original for the full story.