How erfanoabdi/apklayer works
apklayer runs Android APKs as host processes: the CLI installs and converts an APK, the JVM runtime hosts its Android framework and native libraries, and Android services use host hardware interfaces before apps appear in Wayland windows. The README documents the main data path and capabilities; source excerpts confirm CLI dispatch, dex conversion, binder operation, storage callbacks, and shell startup. Several service and hub implementations are unsampled, so their internal links are omitted or shown only where the README documents them.
Main entry points: Main.java Application host · Access.cpp Android services · main.cpp apklayer CLI · HubClient.java Instance hub
Components 22
App lifecycle
- apklayer CLI
cli/main.cpp - Install and manage
cli/apps.cpp - DEX converter
runtime/dex2jvm/io/github/kksimp/dex2jvm/DexConverter.java - Bytecode translator
runtime/dex2jvm/io/github/kksimp/dex2jvm/Translator.java - Desktop manager
manager/src/main.cpp
Android runtime
- Application host
runtime/host/java/apklayer/host/Main.java - Native bridge
bridge/native/native_bridge.c - Userspace binder
bridge/binderd/main.cpp
Android services
- Instance hub
runtime/host/java/apklayer/host/HubClient.java - Hub directory
runtime/host/java/apklayer/host/HubDirectory.java - Package services
runtime/host/java/apklayer/host/ShadowHostPackageManager.java - Storage integration
runtime/host/java/apklayer/host/HostVolumes.java - Android services
aosp/hals/servicemanager/Access.cpp
Host hardware
- Graphics HAL
aosp/hals/graphics/allocator/Allocator.cpp - Audio HAL
aosp/hals/audio/Service.cpp - Media services
aosp/hals/media/services/MediaServices.cpp - Linux interfaces
bridge/hals/graphics/graphics.c - Texture decompression
aosp/hals/graphics/vulkan/gfxstream/vulkan/emulated_textures/gpu_decompression_pipeline.cpp
User interface
- Wayland shell
bridge/shell/main.c - App window
bridge/shell/window.c
Other components
- Linux user
- APK package
Connections 25
- Linux user → apklayer CLI: invokes
README.md - APK package → Install and manage: installs
- apklayer CLI → Install and manage: dispatches
cli/main.cpp - Install and manage → DEX converter: converts DEX
cli/apps.cpp - DEX converter → Bytecode translator: translates bytecode
- apklayer CLI → Application host: launches app
README.md - Application host → Native bridge: loads native libraries
README.md - Application host → Userspace binder: uses binder
README.md - Userspace binder → Android services: connects services
README.md - Application host → Package services: provides package APIs
- Application host → Instance hub: uses instance hub
README.md - Instance hub → Hub directory: routes requests
- Instance hub → Storage integration: coordinates volumes
- Storage integration → Hub directory: binds service
- Android services → Graphics HAL: provides graphics
README.md - Android services → Audio HAL: provides audio
README.md - Android services → Media services: provides media
README.md - Graphics HAL → Linux interfaces: uses host graphics
README.md - Audio HAL → Linux interfaces: uses host audio
README.md - Media services → Linux interfaces: uses host media
README.md - Android services → Texture decompression: emulates textures
- Application host → Wayland shell: presents app
README.md - Wayland shell → App window: creates window
- Linux user → Desktop manager: manages apps
README.md - Desktop manager → apklayer CLI: runs CLI
manager/src/main.cpp