Skip to main content

Nestvane documentation

Nestvane runs a full Android 17 system, built from the Android Open Source Project (AOSP), inside an ordinary iOS app. It uses no just-in-time compiler, no jailbreak and no hypervisor. iOS does not let an app create executable memory, so every guest instruction that runs natively was translated before the app was built and ships as signed code inside it.

These documents describe how that works, how the parts are built, and what state the project is in. They are written for a developer who has not seen the project before.

中文版见 zh-CN/README.md。

The documents​

DocumentWhat it covers
architecture.mdThe whole system in one read: the constraint, the four pieces, how a guest process runs and how a system call travels.
static-rewriting.mdHow a guest ARM64 ELF file becomes host code: reserved registers, the rewriting rules, stable load addresses, packaging, and code without a translation.
kernel-layer.mdThe Linux kernel that the guest sees, implemented in user space: tasks, memory, files and mounts, Binder, signals, sockets, SELinux, seccomp, devices.
devices.mdGraphics, storage, network, sound, battery, time zone and touch: where the guest meets the phone.
building.mdWhat is needed to build the app and the order of the steps, quoted from the scripts.
design-notes.mdDecisions and pitfalls: a selection of problems met on the way, each as problem, cause and fix.
status.mdWhat works, what does not, measured numbers and known limitations.
installing.mdHow to sign the released IPA and put it on a phone.
reporting.mdReporting a problem: exporting diagnostics, what to include, and where to send it (GitHub issues, Discord, Telegram, email).
using.mdUsing it: installing apps, files, the menu, root and KernelSU Manager, backups, and what to do when Android seems stuck.
measurements.mdVersion 1.0 in numbers: one run from a fresh install, and where the numbers stop.
comparison.mdNestvane next to Twoyi and Andarium, and what it owes them.

A suggested order for a first read is architecture, static rewriting, kernel layer, devices, then status. The building document and the design notes can be read on their own.

Terms used throughout​

TermMeaning here
HostThe iOS app and the phone it runs on. Host code is code the iOS loader accepted and signed.
GuestThe Android system and everything in it: its processes, memory, files and addresses.
Guest addressAn address as an Android process sees it. It is not a host address; a table maps one to the other.
ModuleOne guest ELF file (an executable, a shared library, or a file of compiled Java code) together with its translation.
TranslationThe host code produced ahead of time from a module's instructions.
RewriterThe program that produces a translation: experiments/g0/e3/rewrite.py.
Kernel layerThe user-space implementation of the Linux kernel interface: runtime/ProbeLinux.cpp and the files around it.
InterpreterThe ARM64 interpreter that runs guest code which has no translation: runtime/AArch64.cpp.
Guest rootThe directory tree the guest boots from, assembled on the build side and shipped as a resource of the app.
Reference emulatorThe standard Android emulator running the same Android build on a real Linux kernel. It is used to collect inputs and to compare behaviour.
APEXAndroid's packaging format for updatable system modules. Each is a read-only ext4 image mounted under /apex.
ARTThe Android Runtime, which runs Java and Kotlin code. Its compiler, dex2oat, produces ARM64 code in .oat and .odex files.
ZygoteThe Android process from which every app process is forked.
BinderAndroid's inter-process call mechanism, a kernel driver on a real device.

Where things are in the repository​

PathContents
runtime/The runtime linked into the app: kernel layer, interpreter, native-code entry, guest address space, device models.
ios/The iOS app: the view that shows Android's display, touch, APK hand-off, settings, sound output.
tools/Build and validation scripts, and the patches applied to gfxstream.
experiments/aosp/The edits to the AOSP tree and the scripts that build it.
experiments/g0/The feasibility experiments, including the rewriter.
fixtures/Small guest programs, resource overlays, the home-screen app and test apps.
results/Records of measurements and device reports.
generated/Build outputs: the guest root, the translated code, the Xcode project inputs. Not checked in.

The records behind these documents​

The documents summarise; the records hold the detail.

  • results/G0.md is the running lab record, in Chinese. "G0" is the name the project gave to the set of five feasibility experiments (address space, copy-on-write remapping, register reservation and rewriting, fault recovery, loading signed code) that had to pass before the current design was adopted. The record continues past those experiments through every later measurement. Its sub-experiments are named E1 to E5; the rewriter lives under experiments/g0/e3 because it began as the third.
  • PLAN.md is the project plan, in Chinese.
  • AOT.md and REVIEW.md are earlier design notes, in Chinese.
  • The results/P1.md and results/P2-*.md files record an earlier phase in which all guest code was interpreted. The kernel layer was built in that phase and is still the one in use.

Scope and accuracy​

Every number in these documents comes from results/G0.md and names the device it was measured on. Where something has not been verified, the text says so. The project is released under the Apache License, Version 2.0; see LICENSE.

Contact​