|
| 1 | +# AnyClaw (Android) |
| 2 | + |
| 3 | +Android APK that embeds a Termux-style Linux bootstrap environment, installs OpenClaw + Codex on first run, and presents the AnyClaw UI inside a WebView. |
| 4 | + |
| 5 | +## Architecture |
| 6 | + |
| 7 | +``` |
| 8 | +┌─────────────────────────────────────────┐ |
| 9 | +│ Android APK │ |
| 10 | +│ │ |
| 11 | +│ ┌──────────────┐ ┌────────────────┐ │ |
| 12 | +│ │ WebView │ │ Bootstrap │ │ |
| 13 | +│ │ │ │ Installer │ │ |
| 14 | +│ │ localhost: │ │ │ │ |
| 15 | +│ │ 18923 │ │ Extracts │ │ |
| 16 | +│ │ │ │ Termux env │ │ |
| 17 | +│ └──────┬───────┘ └───────┬────────┘ │ |
| 18 | +│ │ │ │ |
| 19 | +│ ▼ ▼ │ |
| 20 | +│ ┌──────────────────────────────────┐ │ |
| 21 | +│ │ /data/data/com.codex.mobile/ │ │ |
| 22 | +│ │ files/usr/ (Termux prefix) │ │ |
| 23 | +│ │ │ │ |
| 24 | +│ │ ├── bin/node │ │ |
| 25 | +│ │ ├── bin/codex │ │ |
| 26 | +│ │ └── lib/node_modules/ │ │ |
| 27 | +│ │ └── codex-web-local/ │ │ |
| 28 | +│ │ ├── dist/ (Vue) │ │ |
| 29 | +│ │ └── dist-cli/ (srv) │ │ |
| 30 | +│ └──────────────────────────────────┘ │ |
| 31 | +└─────────────────────────────────────────┘ |
| 32 | +``` |
| 33 | + |
| 34 | +## Prerequisites |
| 35 | + |
| 36 | +- Android Studio (or just the Android SDK command-line tools) |
| 37 | +- Java 17+ |
| 38 | +- curl (for downloading bootstrap) |
| 39 | + |
| 40 | +## Build Instructions |
| 41 | + |
| 42 | +### 1. Download the Termux bootstrap |
| 43 | + |
| 44 | +```bash |
| 45 | +cd android |
| 46 | +./scripts/download-bootstrap.sh |
| 47 | +``` |
| 48 | + |
| 49 | +This downloads `bootstrap-aarch64.zip` (~30 MB) from Termux releases into `app/src/main/assets/`. |
| 50 | + |
| 51 | +### 2. (Optional) Bundle the server |
| 52 | + |
| 53 | +If you want to pre-bundle the codex-web-local server in the APK so users don't need to `npm install` it on first run: |
| 54 | + |
| 55 | +```bash |
| 56 | +./scripts/build-server-bundle.sh |
| 57 | +``` |
| 58 | + |
| 59 | +This builds the Vue frontend + Express CLI from the parent project and copies them into `app/src/main/assets/server-bundle/`. |
| 60 | + |
| 61 | +### 3. Build the APK |
| 62 | + |
| 63 | +```bash |
| 64 | +./gradlew assembleDebug |
| 65 | +``` |
| 66 | + |
| 67 | +The APK will be at `app/build/outputs/apk/debug/app-debug.apk`. |
| 68 | + |
| 69 | +For a release build: |
| 70 | + |
| 71 | +```bash |
| 72 | +./gradlew assembleRelease |
| 73 | +``` |
| 74 | + |
| 75 | +## First Run |
| 76 | + |
| 77 | +On first launch, the app will: |
| 78 | + |
| 79 | +1. Extract the bootstrap environment (~30 MB compressed, ~100 MB extracted) |
| 80 | +2. Run `apt-get install nodejs-lts` (downloads ~30 MB) |
| 81 | +3. Run `npm install -g @openai/codex codex-web-local` |
| 82 | +4. Prompt for your OpenAI API key (stored encrypted on device) |
| 83 | +5. Start the server and load the WebView |
| 84 | + |
| 85 | +Steps 1-3 only happen once. Subsequent launches skip straight to step 4-5. |
| 86 | + |
| 87 | +## Minimum Requirements |
| 88 | + |
| 89 | +- Android 7.0 (API 24) or higher |
| 90 | +- arm64-v8a device (most modern Android phones) |
| 91 | +- ~500 MB free storage for bootstrap + Node.js + Codex |
| 92 | +- Internet connection (for API calls and first-run package installs) |
0 commit comments