Add Android NDK compatibility layer (Phase 0)
Implements the core infrastructure needed to load and run ARM64 Android
game binaries on the Switch:
- ELF loader: memalign + RELA relocations (RELATIVE, GLOB_DAT, JUMP_SLOT,
ABS64), svcSetMemoryPermission for code segments, DT_INIT_ARRAY support
- JNI environment: complete 233-slot void* function table, JavaVM (8-slot),
RegisterNatives for native method bridging
- Shim table: ~300 symbol mappings across libc, libm, pthread (single-
threaded stubs), libdl, libandroid, liblog, EGL and GLES 2/3 passthrough
to switch-mesa
- Android shims: AAssetManager (reads from extracted assets/), ANativeWindow
wrapping libnx NWindow, ALooper/AInputQueue stubs, AConfiguration
- High-level launcher (launchApk): extracts lib/arm64-v8a/ + assets/ from
APK, loads main .so, sets up ANativeActivity, calls JNI_OnLoad and
ANativeActivity_onCreate, drives lifecycle callbacks
- Logs everything to sdmc:/BareDroidNX/compat_log.txt for on-device debugging
Threads are single-threaded stubs (pt_create is a no-op); this is Phase 0.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>