Skip to content

About

Lightweight ARM32-on-ARM64 Android emulator & APK bridge for running 32-bit Android games on 64-bit-only devices

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TinyDroid32

Lightweight ARM32-on-ARM64 Android 32-bit emulator & APK runtime bridge for running legacy armeabi-v7a / armeabi games and apps on 64-bit-only Android devices (Android 14–17+, ARMv9 / Pixel 8+ / Snapdragon 8 Gen 3+, 16 KB page-size devices) — without root or a full Android VM.

Why TinyDroid32?

Modern ARMv9 / 64-bit-only Android devices dropped hardware AArch32 execution and 32-bit Zygote support. Legacy 32-bit APKs (lib/armeabi-v7a/*.so or lib/armeabi/*.so) fail to install (INSTALL_FAILED_NO_MATCHING_ABIS) or crash on launch.

TinyDroid32 solves this by relocating the APK's 32-bit native libraries into assets/tinydroid32/armeabi-v7a/, injecting a ~3.2 MB ARM64 Dynarmic JIT runtime (libtinydroid32.so) plus per-library ~9.3 KB lib/arm64-v8a/*.so shims (shim_arm64.so), and transparently bridging CPU execution, Bionic32 libc, JNI, OpenGL ES 2.0/EGL, and OpenSL ES to the host 64-bit Android process.

Architecture

  Java / ART (64-bit Host Process)
        │  System.loadLibrary("game")
        ▼
  lib/arm64-v8a/libgame.so  (shim_arm64.so patched with TINYDROID32_LIBNAME_SLOT)
        │  tinydroid32_shim_onload(vm, "libgame.so")
        ▼
  lib/arm64-v8a/libtinydroid32.so
   ├── Dynarmic A32 -> ARM64 JIT (ARMv7 / Thumb-2 / VFPv3 / NEON + Fastmem)
   ├── Out-of-Band Guest Heap Allocator & Linux ARM32 kuser Helpers (0xFFFF0Fxx)
   ├── ELF32 Loader (ET_DYN, PT_LOAD, DT_HASH/DT_GNU_HASH, DT_NEEDED, PT_ARM_EXIDX)
   ├── Bidirectional 32<->64 JNI Bridge & Scoped ARM64 JIT Trampolines
   ├── HLE Bionic32 (libc, libm, pthread, sem_*, __aeabi_*, __sFILE, fcntl, sockets, dlopen)
   ├── Android NDK HLE (ANativeWindow, AAssetManager/AAsset, AndroidBitmap)
   └── Hardware Pass-Through: Mali/Adreno EGL 1.4 + GLES 2.0 (shadow glMapBufferOES) & OpenSL ES
        │
        ▼
  assets/tinydroid32/armeabi-v7a/libgame.so  (Guest 32-bit ARM binary)

Key Features

  • Tiny footprint: ~4.5 MB manager APK (TinyDroid32.apk), ~3.2 MB native runtime (libtinydroid32.so), ~9.3 KB per-library ARM64 shim.
  • Fast JIT execution: Powered by azahar-emu/dynarmic A32 frontend with 4 GB flat guest address space (fastmem) and multi-threaded ExclusiveMonitor.
  • Crash-hardened memory & Bionic32 HLE:
    • 100% out-of-band host-metadata guest heap allocator (malloc/calloc/realloc/memalign/free) immune to guest buffer overruns.
    • Bionic32 struct __sFILE (_file / _flags) synchronization, full POSIX errno propagation, pthread IDs, fcntl 32-bit flock, and setjmp/longjmp.
    • Scoped JNI local-reference frame management with generation-tagged object handles.
    • Per-buffer shadow-mapped glMapBufferOES / glMapBufferRangeEXT for 32-bit callers on 64-bit GPUs.
  • Broad APK compatibility:
    • Supports both lib/armeabi-v7a/ and legacy lib/armeabi/ APKs.
    • Automatic recursive DT_NEEDED guest library loading and DT_GNU_HASH / DT_HASH symbol resolution.
    • Safe libc++_shared.so isolation (host ARM64 libc++_shared.so stays intact while guest 32-bit libc++_shared.so loads inside guest RAM).
    • 16 KB page-aligned STORED .so entries and built-in APK Signature Scheme v2 signer on device.

Tested Working Games

Verified 32-bit (armeabi-v7a) games running on 64-bit-only ARMv9 Android devices via TinyDroid32:

Game Version Package Name Original ABI Status
Need for Speed: No Limits 1.0.47 (2279) com.ea.game.nfs14_row armeabi-v7a Playable
Rival Knights 1.2.3d (12325) com.gameloft.android.ANMP.GloftOKHM armeabi-v7a Playable

Directory Layout

  • native/ — C++20 emulator core, Dynarmic integration, HLE subsystems, ELF32 loader, JNI bridge, shim_arm64.c, and selftest.cpp.
  • android/ — Android manager UI (MainActivity.java, ApkBridgeBuilder.java), APK build script (build.py), and CLI bridge (bridge_apk.py).

Building from Source

1. Build Dynarmic (one-time)

bash native/build_deps.sh

Clones azahar-emu/dynarmic into $HOME/tmp/tinydroid32-build/deps/dynarmic and compiles static libraries (libdynarmic.a, libmcl.a, libfmt.a) with -march=armv8-a.

2. Build Native Runtime & Self-Test

bash native/build_native.sh

Produces libtinydroid32.so, shim_arm64.so, libc++_shared.so, and tinydroid32_selftest in $HOME/tmp/tinydroid32-build/out.

3. Build Manager App (TinyDroid32.apk)

python3 android/build.py

Outputs dist/TinyDroid32.apk (pass --out <path> to override). Requires aapt2, d8, zipalign, apksigner, keytool, javac, and an android.jar ($ANDROID_HOME, $ANDROID_SDK_ROOT, or $HOME/.android-sdk).

Usage

On-Device App (TinyDroid32.apk)

  1. Install TinyDroid32.apk on your 64-bit Android device.
  2. Grant All Files Access (for scanning Downloads/ & Documents/) or tap Pick APK to select any .apk via Android's document picker.
  3. Tap Emulate & Install on any 32-bit APK to generate <name>-TinyDroid32.apk (16 KB aligned & v2-signed) and launch the Android package installer.

CLI Bridge

python3 android/bridge_apk.py path/to/game32.apk path/to/game32-TinyDroid32.apk

Headless Self-Test

# Core JIT, Thumb-2, GuestHeap, and kuser helper tests:
"$HOME/tmp/tinydroid32-build/out/tinydroid32_selftest"

# Also test loading all 32-bit .so libraries from an APK:
"$HOME/tmp/tinydroid32-build/out/tinydroid32_selftest" path/to/game32.apk

Debugging New Games & Extending HLE

If a bridged 32-bit game crashes or behaves unexpectedly, capture logs over ADB:

adb logcat -s TinyDroid32

Look for:

  • UNRESOLVED symbol '<name>' — add the missing function/data thunk in native/hle_libc.cpp, native/hle_gles.cpp, or native/hle_opensles.cpp.
  • UNRESOLVED HLE SYMBOL CALLED! PC=... LR=... — shows the exact guest library + offset that called an unimplemented symbol.

Roadmap

  • Expand libandroid.so / ANativeActivity / ALooper / AAssetManager HLE for pure-NDK games.
  • Add libjnigraphics.so (AndroidBitmap_*) and additional OpenGL ES 3.0 entry points.
  • Expand compatibility testing across Unity (IL2CPP/Mono), Cocos2d-x, Unreal Engine 3/4, and legacy Gameloft titles.

License & Credits

About

Lightweight ARM32-on-ARM64 Android emulator & APK bridge for running 32-bit Android games on 64-bit-only devices

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages