Skip to content

About

Automated Android terminal wrapper based on Termux. Sets up and runs the Antigravity CLI sandbox environment with on-demand proxy support (Xray/Hysteria 2) and region-bypass patcher.

Topics

Resources

Security policy

Stars

6 stars

Watchers

0 watching

Forks

Repository files navigation

Antigravity CLI Mobile Logo

antigravity-cli-mobile

Android terminal client for the Antigravity CLI — fully automated.

GitHub release License Platform Architecture Donate

Antigravity CLI Session Settings Overlay Main Menu

1. Active CLI Session  •  2. In-App Settings Overlay  •  3. Main Menu TUI
1. Сессия Antigravity CLI  •  2. Меню настроек поверх сессии  •  3. Главное меню TUI


🌍 Language / Язык


English

antigravity-cli-mobile is a fully self-contained Android terminal application built to deploy, configure, and run the Antigravity CLI on mobile devices — right out of the box, with zero user configuration required.

It is built on a deep fork of the open-source Termux terminal emulator, with a significant layer of custom engineering on top: an embedded Debian Bookworm Linux container, a smart Bash orchestration system, an on-demand proxy engine loader, automatic region-bypass patching, and hardware-compatibility fixes — all woven together into a single APK that just works.

🌟 What's New in v2.0.0

  • 📂 Full Filesystem Mount: Access all internal storage folders (/phone and /sdcard bound to /storage/emulated/0) directly from the Debian environment.
  • ⚙️ In-App Overlay TUI: Launch the environment manager instantly via the ⚙️ mobile toolbar button without interrupting running sessions.
  • 🛡️ Dedicated Patcher Menu: MultiGate V1.3.8 support (X64, ARM64, ARM64_W2, ARM64_W4) with a toggleable Update Lock to control background self-updates.
  • ⚡ Bulletproof Initial Setup: Resolved permission race conditions (Unable to install bootstrap) and streamlined pre-cached container initialization.
  • 🌐 Upgraded Proxy Subsystem: Native Hysteria 2 support with Salamander obfuscation alongside Xray Reality, startup socket synchronization, and full environment variable propagation (HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, GRPC_PROXY).

🔗 Credits & Open-Source Attribution

This project stands on the shoulders of giants:

Component Author Role
Termux App Termux Team Core terminal emulator, bootstrap installer, proot-distro runtime
Open AG Patcher (Rust Edition) Milordick Ultra-fast native Rust binary patcher (agyptch), in-place multi-gate regional & auth bypass
Xray-core XTLS Project VLESS/XTLS Reality proxy engine (downloaded on-demand)
Hysteria 2 Hysteria Project UDP-based proxy engine (downloaded on-demand)

📦 Releases & Downloads

Pre-compiled APK builds are published in the Releases tab.

Target Architecture: ARM64 (arm64-v8a)
The app is built and hardware-optimized exclusively for 64-bit ARM (aarch64) devices, which covers virtually 100% of modern Android smartphones. The pre-cached Debian rootfs, Antigravity CLI binary, and binary byte-patches are compiled specifically for ARM64.

Available APK

Variant File Target CPU Description
ARM64 ✅ agycli-arm64-v8a.apk 64-bit ARM (arm64-v8a) Recommended for all devices (full offline bootstrap & CLI support)

🚀 Feature Deep-Dive

1. ⚡ Pre-Cached Debian Bootstrap

Installing a full Linux distribution inside proot-distro normally requires downloading a 200+ MB rootfs tarball from GitHub. On mobile networks, in regions with unstable connectivity, or in airplane mode — this simply fails.

Our solution:

  • A pre-compiled Debian Bookworm (ARM64) rootfs (~42 MB compressed) is bundled directly inside the APK as an asset. (Note: Offline bootstrap is optimized for ARM64/aarch64 devices. Other architectures like x86_64 or armv7 will automatically fallback to standard online download).
  • At first launch, TermuxInstaller.java extracts the Termux bootstrap zip, then immediately copies the Debian rootfs into the exact cache path that proot-distro expects (/data/.../var/lib/proot-distro/dlcache/).
  • proot-distro install debian detects the pre-cached file and completes installation without a single network request.
  • Total time from first launch to a running Debian shell: under 30 seconds, thanks to pre-cached rootfs.

2. 🔒 Double-Bootstrap Race-Condition Fix

Android's storage permission dialog introduces a destructive race condition:

  1. App launches → setupBootstrapIfNeeded() starts an extraction thread.
  2. The permission dialog pauses the Activity → the terminal service reconnects.
  3. onServiceConnected() fires again → a second extraction thread spawns.
  4. Both threads concurrently wipe and rewrite the prefix directory, corrupting symlinks → "Unable to install bootstrap" crash.

Fix: A static synchronized boolean gate (mIsInstallingBootstrap) in TermuxInstaller.java ensures the bootstrap runs exactly once, cleanly.


3. 🌐 On-Demand Proxy Engines (Xray & Hysteria 2)

Proxy binaries are not bundled in the APK. The start-agy.sh launcher inside the Debian container checks for the binary only when the user activates the proxy:

  • If missing → downloads the correct architecture variant automatically (arm64-v8a, arm32-v7a, 64...).
  • If present → starts the proxy immediately, no download needed.

4. 🔑 One-Click Proxy URL Import (VLESS & Hysteria 2)

The built-in Python parser (generate_proxy_config.py) accepts a raw proxy share link and produces a native JSON config:

  • vless:// — Parses UUID, host, port, security mode (Reality / TLS / none), flow, WebSocket path, gRPC service name, Reality public key + shortId. Outputs a full xray_config.json with dual SOCKS5 + HTTP inbounds.
  • hysteria2:// / hy2:// — Parses auth token, server address, obfuscation, TLS SNI, insecure flag. Outputs hysteria_config.json.

All configs persist in /sdcard/AntigravityWorkspace/ — accessible from both Android and the Debian container.


5. 🛡️ Native Rust Binary Patcher (Region & Auth Bypass)

The AGY CLI binary contains eligibility and region checks blocking use outside specific areas. The app ships with a dedicated native Open AG Patcher (Rust Edition) (agyptch):

  • Ultra-fast & Zero-copy: Uses memmap and direct in-place atomic byte writes (~40 µs). Does not create temporary 200 MB files on flash storage, saving smartphone UFS/eMMC lifespan.
  • Minimal memory footprint: Requires only ~3 MB RAM (compared to ~250 MB under Python), preventing Android OOM-kills on budget devices.
  • ARM64 MultiGate & Auth Gate: Fully supports ARM64 instruction variants (w1, w2, w4) and internal auth gate bypasses.
  • Update Lock: Supports instant neutralizing and restoring of embedded auto-updater endpoints via --lock-update and --unlock-update.
  • Integrated TUI: Full interactive terminal UI (Ratatui Dark M3) accessible via the manager menu, with headless --patch-all runs executed prior to CLI start.

6. 🧩 Persistent Session & Workspace Tracking

A PROMPT_COMMAND hook in /etc/bash.bashrc tracks the user's working directory on every prompt. On next launch, start-agy.sh restores the exact directory automatically — making it feel like a persistent desktop session.


7. ⌨️ Universal ASCII Arrow Key Compatibility

Custom Android ROM fonts (e.g. Infinix XOS, TECNO HiOS, itel) fail to render Unicode arrows (←, →, ↑, ↓), showing broken characters like ij, Ы, я instead.

Fix: All toolbar arrow keys are replaced with ASCII art equivalents (<-, ->, ^, v) — works on 100% of devices.


8. 🔄 3-Second Autolaunch Menu

On startup: auto-launches in 3 seconds if initialized, or auto-starts full setup on first run. Press any key to open the interactive menu:

  1. 🚀 Launch Antigravity CLI
  2. 🔄 Update Antigravity CLI
  3. 🌐 Network & Proxy Settings
  4. 🩹 Run Antigravity Patcher
  5. 🐚 Open raw Debian shell

9. 🏥 Auto-Healing Container

On every launch, the app verifies all required Debian packages (python3, git, python3-packaging) and silently reinstalls any missing ones — recovering broken environments without user intervention.


🚀 Quick Start Guide

Step 1. Download & Install: Download the latest agycli-arm64-v8a.apk from the Releases tab and install it. Android may ask you to allow installation from unknown sources — this is expected.


Step 2 — First Launch (Fully Automatic)

On first launch the app runs a fully automated setup sequence. No input required — just watch it go:

[ First Launch Flow ]

  App opens
    └── Storage permission dialog appears
          └── Tap ALLOW
                └── Bootstrap installs (Termux base tools)
                      └── Debian Bookworm unpacked from APK assets (~30 sec)
                            └── apt-get installs: python3, git, curl, ca-certificates...
                                  └── Antigravity CLI installed inside Debian
                                        └── ✅ Ready — AGY shell opens automatically

After setup completes, the Antigravity CLI starts automatically inside the Debian container.

💡 No internet required for the Debian rootfs — it's bundled in the APK. Internet is only needed for apt-get package installation and the AGY CLI installer.


Step 3 — Subsequent Launches (3-Second Autolaunch)

Every time you open the app after setup:

App opens → Shows status banner (Workspace path, Proxy status, Last directory)
         → "Launching in 3 seconds..."
         → [Press any key] → Opens the interactive menu
         → [Wait 3 seconds] → AGY CLI starts automatically

Step 4 — Configure a Proxy (Optional)

If you need a proxy to reach certain resources:

  1. Press any key at the 3-second countdown to open the Main Menu.
  2. Choose 3) Network & Proxy settings.
  3. Choose 2) Set Proxy Type → select xray (VLESS/Reality) or hysteria2.
  4. Choose 3) Import URL → paste your vless://... or hysteria2://... link.
  5. The app parses the link, generates the config, and automatically enables the proxy.
  6. Choose 0) Back → 1) Launch Antigravity CLI — proxy is now active.

Step 5 — Run the Patcher (If Needed)

If AGY shows a regional eligibility screen:

  1. Open the Main Menu → 4) Run Antigravity Patcher.
  2. The patcher auto-downloads if not present, patches the AGY binary, and restarts it.
  3. Done — no eligibility screen anymore.

📋 Main Menu Reference

╔══════════════════════════════════════════╗
║     ANTIGRAVITY CLI  //  DEBIAN SANDBOX  ║
╚══════════════════════════════════════════╝

  Workspace : /sdcard/AntigravityWorkspace
  Proxy     : ON (xray)          ← current proxy status
  Last dir  : /workspace/myproject

  1) Launch Antigravity CLI      ← Start AGY in Debian container
  2) Select Workspace / Mode     ← Switch between internal and storage
  3) Update Antigravity CLI      ← Re-run official install script
  4) Network & Proxy settings    ← Full proxy configuration submenu
  5) Run Antigravity Patcher     ← Bypass regional eligibility check
  6) Update Lock [ ON / OFF ]    ← Prevent upstream binary auto-updates
  7) Open Debian shell           ← Raw bash inside Debian container
  0) Exit Manager

⚙️ Network & Proxy Settings — Full Reference

Access via Main Menu → 3.

  Network & Proxy Settings
  ========================

  1) Toggle proxy           [ ON / OFF ]       ← Enable or disable the proxy
  2) Set Proxy Type         [ xray ]           ← Choose proxy engine
  3) Import URL             [ VLESS or Hysteria 2 ]
  4) Manual Config Settings [ Server: ... ]   ← Edit fields manually
  0) Back to Main Menu

Option 2 — Set Proxy Type

Choice Engine Protocol Best For
1 xray VLESS + XTLS-Reality / TLS Standard V2Ray/Xray servers
2 hysteria2 UDP (QUIC-based) High-speed, lossy networks
3 socks5 SOCKS5 External SOCKS5 proxy
4 http HTTP CONNECT Corporate/external HTTP proxy

Option 3 — Import URL

Paste a full proxy share link. Supported formats:

Protocol Example
VLESS Reality vless://uuid@host:443?security=reality&flow=xtls-rprx-vision&pbk=KEY&sid=ID&sni=SNI
VLESS TLS vless://uuid@host:443?security=tls&sni=SNI
Hysteria 2 hysteria2://password@host:443?sni=SNI
Hysteria 2 + obfs hysteria2://pass@host:443?sni=SNI&obfs=salamander&obfs-password=OBF

On success: config is saved, proxy is auto-enabled. On error: the raw link is shown for troubleshooting.

Option 4 — Manual Config Settings (xray)

Instead of a URL, you can fill in individual fields:

Field Description
Server Hostname or IP of the proxy server
Port Server port (typically 443)
UUID User ID
Flow xtls-rprx-vision (Reality) or blank
SNI Server Name Indication for TLS
PubKey Reality public key
ShortID Reality short ID (leave blank if none)

For Hysteria 2 manual config, the fields map to: Server, Port, Auth/Password, SNI, Obfs Type (salamander or blank), Obfs Password.

💡 Leave any field blank to keep the existing value. Type none to clear an optional field.


💡 Tips, Quirks & Known Behaviours

🔋 Background Behaviour

  • The Debian container runs as a foreground process tied to the terminal session. Closing the app stops AGY and the proxy.
  • To keep a long-running task alive, use nohup command & inside the Debian shell.

🌐 Proxy Environment Variables

When the proxy is enabled, these variables are set automatically inside Debian:

export HTTP_PROXY="http://127.0.0.1:10809"
export HTTPS_PROXY="http://127.0.0.1:10809"
export ALL_PROXY="http://127.0.0.1:10809"

This makes apt, curl, pip, npm, and any other CLI tool route through the proxy without extra configuration.

📁 Workspace Location

All persistent data lives in /sdcard/AntigravityWorkspace/ on the Android side, mounted as /workspace inside Debian:

File Purpose
proxy_config.sh Proxy on/off toggle and type
vless_settings.sh Manual VLESS fields
vless_link.txt Last imported proxy URL
xray_config.json Generated Xray config
hysteria_config.json Generated Hysteria2 config
proxy_engine.txt Active engine (xray or hysteria)
.last_dir Last working directory in Debian
check_and_patch.py Auto-patcher fallback script
agyptch Native Rust patcher executable (Open AG Patcher)

🔄 Updating AGY

Menu → 3 runs curl -fsSL https://antigravity.google/cli/install.sh | bash inside Debian. This updates the AGY binary to the latest version. After update, re-run the patcher if needed (Menu → 5).

🐚 Raw Debian Shell

Menu → 7 drops you into a plain bash shell inside the Debian container with /workspace and storage mounted. Useful for manual debugging, installing packages, or advanced configuration.


💖 Support / Donation

If you find this project useful, you can support its development by donating via CloudTips:

👉 Support via CloudTips


🏗️ Building from Source

git clone https://github.com/Milordick/antigravity-cli-mobile.git
cd antigravity-cli-mobile

export TERMUX_SPLIT_APKS_FOR_RELEASE_BUILDS="0"
./gradlew assembleRelease
# Output: app/build/outputs/apk/release/agycli-arm64-v8a.apk

Requirements: Android SDK with NDK, JDK 11+, Gradle 7+


📁 Project Structure

termux-app/
├── app/src/main/
│   ├── assets/
│   │   ├── agy-manager.sh              ← Main orchestration script
│   │   ├── agyptch                     ← Native Rust patcher binary (2.0 MB)
│   │   ├── generate_proxy_config.py    ← VLESS/Hysteria2 URL → JSON parser
│   │   ├── check_and_patch.py          ← Fallback auto-patcher for AGY binary
│   │   └── debian-bookworm-aarch64-pd-v4.17.3.tar.xz  ← Bundled Debian rootfs (~42MB)
│   └── java/com/termux/app/
│       └── TermuxInstaller.java        ← Bootstrap installer + pre-cached Debian seeding
├── terminal-emulator/                  ← VT100/VT220 emulator library
├── terminal-view/                      ← Android View rendering the terminal
└── termux-shared/                      ← Shared utilities, constants, file ops

📄 License

This project is licensed under the GNU General Public License v3.0.

License Breakdown

Component License Notes
app/ (this project's custom code) GPL v3.0 Original automation, scripts, and modifications
terminal-emulator/, terminal-view/ Apache 2.0 From Android-Terminal-Emulator
termux-shared/ MIT / Apache 2.0 See termux-shared/LICENSE.md
Termux bootstrap packages GPL v3.0 From termux/termux-packages
Debian Bookworm rootfs (bundled asset) Various (DFSG-compatible) Standard Debian package licenses apply
Open AG Patcher (Rust Edition) MIT Standalone Rust binary patcher (agyptch), bundled offline

By using this application you accept the terms of all applicable licenses listed above.



Русский

antigravity-cli-mobile — это самодостаточное Android-приложение-терминал для развёртывания, настройки и запуска Antigravity CLI на мобильных устройствах. С автоматической установкой и без ручной настройки.

Построено на базе глубокого форка Termux с обширным слоем собственной инженерии: встроенный контейнер Debian Bookworm, умная система Bash-скриптов, загрузчик прокси-ядер по требованию, автоматическое снятие региональной блокировки и исправления совместимости — всё в одном APK.

🌟 Что нового в версии 2.0.0

  • 📂 Монтирование полной файловой системы: Прямой доступ ко всей памяти устройства (/phone и /sdcard привязаны к /storage/emulated/0) прямо из контейнера.
  • ⚙️ Меню настроек поверх терминала (Overlay TUI): Вызов меню менеджера в один клик по кнопке ⚙️ на панели быстрых клавиш без прерывания активной сессии.
  • 🛡️ Полноценное меню патчера: Интеграция MultiGate V1.3.8 (X64, ARM64, ARM64_W2, ARM64_W4) и переключатель Update Lock для защиты от нежелательного фонового автообновления.
  • ⚡ Улучшенная первоначальная установка: Устранена ошибка конкурентной распаковки бутстрапа (Unable to install bootstrap), обеспечен быстрый старт из встроенного кэша.
  • 🌐 Улучшенный встроенный прокси: Поддержка Hysteria 2 (Salamander) наряду с Xray Reality, устранение сетевых гонок на старте через проверку порта и полный экспорт переменных окружения (HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, GRPC_PROXY).

🔗 Благодарности и атрибуция

Компонент Автор Роль
Termux App Команда Termux Ядро терминального эмулятора, bootstrap-установщик, среда proot-distro
Open AG Patcher (Rust Edition) Milordick Сверхбыстрый нативный Rust-патчер (agyptch), in-place multi-gate обход региональных проверок и auth
Xray-core XTLS Project Прокси-ядро VLESS/XTLS Reality (загружается по требованию)
Hysteria 2 Hysteria Project UDP-прокси (загружается по требованию)

📦 Релизы и загрузки

Готовые APK-файлы публикуются в разделе Releases.

Поддерживаемая архитектура: ARM64 (arm64-v8a)
Приложение собрано и аппаратно оптимизировано исключительно для 64-битных ARM (aarch64) устройств (практически 100% современных смартфонов). Встроенный офлайн-образ Debian Bookworm, бинарник Antigravity CLI и байт-патчи предкомпилированы под ARM64.

Релизный APK

Вариант Файл Целевой CPU Описание
ARM64 ✅ agycli-arm64-v8a.apk 64-бит ARM (arm64-v8a) Рекомендуется для всех устройств (полная поддержка офлайн-бутстрапа и CLI)

🚀 Подробное описание ключевых функций

1. ⚡ Предварительно кэшированная установка Debian (Pre-Cached Bootstrap)

Стандартная установка через proot-distro требует скачивания образа 200+ МБ с GitHub. Без интернета — не работает.

Наше решение:

  • Предскомпилированный rootfs Debian Bookworm (ARM64) (~42 МБ) встроен прямо в APK.
  • При первом запуске TermuxInstaller.java копирует образ в точный путь кэша, ожидаемый proot-distro (/data/.../var/lib/proot-distro/dlcache/).
  • proot-distro install debian обнаруживает файл и завершает установку без единого сетевого запроса.
  • Время до работающего Debian shell: менее 30 секунд благодаря кэшированию.

2. 🔒 Защита от гонки потоков при первом запуске

Диалог разрешения хранилища Android создаёт скрытое состояние гонки: диалог приостанавливает Activity → служба переподключается → запускается второй поток распаковки → оба потока одновременно уничтожают файлы → ошибка "Unable to install bootstrap".

Решение: Статический синхронизированный флаг mIsInstallingBootstrap в TermuxInstaller.java — bootstrap выполняется ровно один раз, чисто.


3. 🌐 Загрузка прокси-ядер по требованию (Xray и Hysteria 2)

Бинарники прокси не встроены в APK. Лаунчер start-agy.sh внутри Debian проверяет наличие ядра только при активации прокси пользователем: нет — скачивает нужную архитектуру автоматически; есть — запускает сразу.


4. 🔑 Импорт прокси по ссылке (VLESS и Hysteria 2)

Встроенный Python-парсер (generate_proxy_config.py) принимает ссылку и генерирует нативный JSON-конфиг:

  • vless:// → xray_config.json с двойными inbound'ами SOCKS5 + HTTP, поддержка Reality, TLS, WebSocket, gRPC.
  • hysteria2:// → hysteria_config.json с поддержкой обфускации, TLS SNI и insecure.

Все конфиги хранятся в /sdcard/AntigravityWorkspace/.


5. 🛡️ Нативный Rust-патчер бинарника AGY (обход региональных ограничений и auth)

AGY CLI содержит региональные ограничения, блокирующие работу. Приложение поставляется с встроенным нативным Open AG Patcher (Rust Edition) (agyptch):

  • Сверхбыстрый in-place патч: Использование memmap и прямой перезаписи байтов на месте за ~40 микросекунд. Не создаёт временных 200 МБ копий на накопителе, сохраняя ресурс памяти смартфона (0 МБ износа UFS/eMMC).
  • Минимальный расход памяти: Всего ~3 МБ RAM в пике (вместо ~250 МБ у Python), предотвращая закрытие приложения по OOM Killer на смартфонах с небольшим объёмом памяти.
  • Полная поддержка ARM64 MultiGate и Auth Gate: Точные машинные опкоды для архитектур ARM64 (w1, w2, w4) и внутреннего гейта авторизации.
  • Поддержка Update Lock: Мгновенное глушение и восстановление URL серверов обновлений через ключи --lock-update / --unlock-update.
  • Встроенный терминальный TUI: Красивый интерфейс на Ratatui доступен прямо из меню менеджера, а автоматический тихий запуск --patch-all выполняется перед каждым стартом CLI.

6. 🧩 Постоянное отслеживание сессии и рабочей директории

Хук PROMPT_COMMAND в /etc/bash.bashrc сохраняет текущую директорию при каждом новом промпте. При следующем запуске start-agy.sh автоматически восстанавливает её — как постоянная десктопная сессия.


7. ⌨️ Универсальные ASCII-стрелки

Кастомные прошивки (Infinix XOS, TECNO HiOS, itel) некорректно отображают Unicode-стрелки (←, →, ↑, ↓) как ij, Ы, я.

Решение: Все стрелки заменены на ASCII (<-, ->, ^, v) — работает на 100% устройств.


8. 🔄 Меню с автозапуском за 3 секунды

При старте: авто-запуск через 3 секунды (или авто-установка при первом запуске). Любая клавиша открывает меню: запуск AGY, выбор рабочей папки, обновление, настройка прокси, запуск патчера и Debian shell.


9. 🏥 Авто-восстановление контейнера

При каждом запуске проверяет наличие всех пакетов Debian (python3, git, python3-packaging) и молча переустанавливает недостающие — восстанавливает повреждённую среду без участия пользователя.


🚀 Быстрый старт

Шаг 1 — Установить APK

Скачай последний agycli-arm64-v8a.apk из раздела Releases и установи. Android может попросить разрешить установку из неизвестных источников — это ожидаемо.


Шаг 2 — Первый запуск (полностью автоматический)

При первом запуске приложение выполняет полностью автоматическую установку. Никаких действий не требуется:

[ Первый запуск ]

  Приложение открылось
    └── Запрос прав на хранилище — нажать ALLOW
          └── Установка bootstrap (базовые инструменты Termux)
                └── Распаковка Debian Bookworm из APK (~30 сек)
                      └── apt-get: python3, git, curl, ca-certificates...
                            └── Установка Antigravity CLI внутри Debian
                                  └── ✅ Готово — AGY shell открывается автоматически

💡 Интернет не нужен для образа Debian — он встроен в APK. Интернет нужен только для apt-get и установщика AGY CLI.


Шаг 3 — Последующие запуски (автозапуск за 3 секунды)

Приложение открылось → Показывает статус (Workspace, Прокси, Последняя директория)
                    → «Launching in 3 seconds...»
                    → [Нажать любую клавишу] → Открыть интерактивное меню
                    → [Подождать 3 секунды]  → AGY CLI запускается автоматически

Шаг 4 — Настройка прокси (по желанию)

  1. Нажать любую клавишу при обратном отсчёте → Главное меню.
  2. Выбрать 3) Network & Proxy settings.
  3. Выбрать 2) Set Proxy Type → выбрать xray или hysteria2.
  4. Выбрать 3) Import URL → вставить ссылку vless://... или hysteria2://....
  5. Приложение разбирает ссылку, генерирует конфиг и автоматически включает прокси.
  6. 0) Back → 1) Launch Antigravity CLI — прокси уже активен.

Шаг 5 — Запуск патчера (если нужно)

Если AGY показывает экран региональной недоступности:

  1. Главное меню → 4) Run Antigravity Patcher.
  2. Патчер скачивается автоматически, патчит бинарник AGY и перезапускает его.
  3. Готово — экран недоступности больше не появляется.

📋 Справочник по главному меню

╔══════════════════════════════════════════╗
║     ANTIGRAVITY CLI  //  DEBIAN SANDBOX  ║
╚══════════════════════════════════════════╝

  Workspace : /sdcard/AntigravityWorkspace
  Proxy     : ON (xray)         ← текущий статус прокси
  Last dir  : /workspace/myproject

  1) Launch Antigravity CLI     ← Запустить AGY в контейнере Debian
  2) Выбор рабочей папки        ← Переключение между памятью и хранилищем
  3) Update Antigravity CLI     ← Обновить официальный AGY CLI
  4) Network & Proxy settings   ← Подменю настройки прокси
  5) Run Antigravity Patcher    ← Меню патчера и гейтов MultiGate
  6) Update Lock [ ON / OFF ]   ← Защита от автообновления бинарника
  7) Open Debian shell          ← Чистый bash внутри Debian
  0) Exit Manager

⚙️ Настройки сети и прокси — Полный справочник

Доступ: Главное меню → 3.

  Network & Proxy Settings
  ========================

  1) Toggle proxy           [ ON / OFF ]       ← Вкл/выкл прокси
  2) Set Proxy Type         [ xray ]           ← Выбор движка
  3) Import URL             [ VLESS или Hysteria 2 ]
  4) Manual Config Settings [ Server: ... ]   ← Ручная настройка полей
  0) Back to Main Menu

Пункт 2 — Тип прокси

Выбор Движок Протокол Для чего
1 xray VLESS + XTLS-Reality / TLS Стандартные V2Ray/Xray серверы
2 hysteria2 UDP (QUIC) Высокая скорость, нестабильная сеть
3 socks5 SOCKS5 Внешний SOCKS5 прокси
4 http HTTP CONNECT Корпоративный/внешний HTTP прокси

Пункт 3 — Импорт ссылки

Вставить полную прокси-ссылку. Поддерживаемые форматы:

Протокол Пример
VLESS Reality vless://uuid@host:443?security=reality&flow=xtls-rprx-vision&pbk=KEY&sid=ID&sni=SNI
VLESS TLS vless://uuid@host:443?security=tls&sni=SNI
Hysteria 2 hysteria2://password@host:443?sni=SNI
Hysteria 2 + obfs hysteria2://pass@host:443?sni=SNI&obfs=salamander&obfs-password=OBF

При успехе: конфиг сохраняется, прокси включается автоматически.

Пункт 4 — Ручная настройка (xray)

Поле Описание
Server Хост или IP прокси-сервера
Port Порт сервера (обычно 443)
UUID Идентификатор пользователя
Flow xtls-rprx-vision (Reality) или пусто
SNI Server Name Indication для TLS
PubKey Публичный ключ Reality
ShortID Short ID для Reality (оставить пустым если нет)

Для Hysteria 2 вручную: Server, Port, Auth/Password, SNI, Obfs Type (salamander или пусто), Obfs Password.

💡 Оставь поле пустым чтобы сохранить текущее значение. Введи none чтобы очистить необязательное поле.


💡 Советы, особенности и нюансы

🔋 Поведение в фоне

  • Debian-контейнер работает как процесс переднего плана, привязанный к сессии терминала. Закрытие приложения останавливает AGY и прокси.
  • Для долгих фоновых задач используй nohup команда & внутри Debian shell.

🌐 Переменные окружения прокси

Когда прокси включён, внутри Debian автоматически устанавливаются переменные:

export HTTP_PROXY="http://127.0.0.1:10809"
export HTTPS_PROXY="http://127.0.0.1:10809"
export ALL_PROXY="http://127.0.0.1:10809"

Это заставляет apt, curl, pip, npm и любые другие CLI-инструменты использовать прокси без дополнительной настройки.

📁 Расположение файлов рабочего пространства

Все постоянные данные хранятся в /sdcard/AntigravityWorkspace/ (со стороны Android), смонтированном как /workspace внутри Debian:

Файл Назначение
proxy_config.sh Вкл/выкл прокси и тип
vless_settings.sh Ручные параметры VLESS
vless_link.txt Последняя импортированная ссылка
xray_config.json Сгенерированный конфиг Xray
hysteria_config.json Сгенерированный конфиг Hysteria2
proxy_engine.txt Активный движок (xray или hysteria)
.last_dir Последняя рабочая директория в Debian
check_and_patch.py Скрипт фолбэк авто-патчера
agyptch Нативный исполняемый файл Rust-патчера (Open AG Patcher)

🔄 Обновление AGY

Меню → 3 запускает curl -fsSL https://antigravity.google/cli/install.sh | bash внутри Debian. Обновляет AGY до последней версии. После обновления при необходимости повторно запусти патчер (Меню → 5).

🐚 Чистый Debian Shell

Меню → 7 открывает обычный bash внутри Debian с примонтированными /workspace и хранилищем. Полезно для ручной отладки, установки пакетов и расширенной настройки.


💖 Поддержка проекта

Если вам нравится этот проект, вы можете поддержать его развитие чаевыми для разработчика через CloudTips:

👉 Поддержать через CloudTips


🏗️ Сборка из исходников

git clone https://github.com/Milordick/antigravity-cli-mobile.git
cd antigravity-cli-mobile

export TERMUX_SPLIT_APKS_FOR_RELEASE_BUILDS="0"
./gradlew assembleRelease
# Результат: app/build/outputs/apk/release/agycli-arm64-v8a.apk

Требования: Android SDK с NDK, JDK 11+, Gradle 7+


📄 Лицензия

Проект распространяется под лицензией GNU General Public License v3.0.

Состав лицензий

Компонент Лицензия Примечание
app/ (оригинальный код этого проекта) GPL v3.0 Автоматизация, скрипты и модификации
terminal-emulator/, terminal-view/ Apache 2.0 Из Android-Terminal-Emulator
termux-shared/ MIT / Apache 2.0 Смотри termux-shared/LICENSE.md
Bootstrap-пакеты Termux GPL v3.0 Из termux/termux-packages
Rootfs Debian Bookworm (встроенный актив) Различные (DFSG-совместимые) Применяются стандартные лицензии пакетов Debian
Open AG Patcher (Rust Edition) MIT Автономный бинарный патчер на Rust (agyptch), встроен оффлайн

Используя это приложение, вы принимаете условия всех применимых лицензий, перечисленных выше.

About

Automated Android terminal wrapper based on Termux. Sets up and runs the Antigravity CLI sandbox environment with on-demand proxy support (Xray/Hysteria 2) and region-bypass patcher.

Topics

Resources

Security policy

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages