zeroclaw/scripts/android/termux-install.sh
Preventnetworkhacking 8a1dea306e feat(android): Phase 4 - Widget, accessibility, one-liner installers
Phase 4 polish features:

Widget:
- ZeroClawWidget for home screen
- Shows agent status (running/stopped)
- Toggle button to start/stop
- Tap to open app
- Material 3 styling with rounded corners

Accessibility:
- AccessibilityUtils for TalkBack support
- Content descriptions for all UI elements
- Screen reader detection
- Live region announcements
- ContentDescriptions constants

Install Scripts:
- termux-install.sh - One-liner for Termux users
- adb-install.sh - Install from computer via USB
- android-install.html - Web installer page with:
  - Platform detection (Android vs desktop)
  - Direct APK download
  - QR code for desktop users
  - Step-by-step instructions
  - Copy-to-clipboard for commands

Files:
- widget/ZeroClawWidget.kt (128 lines)
- accessibility/AccessibilityUtils.kt (123 lines)
- res/layout/widget_zeroclaw.xml
- res/xml/widget_info.xml
- res/drawable/widget_*.xml
- scripts/android/*.sh
- site/android-install.html

Total: +799 lines across 12 files
2026-02-26 21:34:06 -08:00

68 lines
2.1 KiB
Bash

#!/data/data/com.termux/files/usr/bin/bash
#
# ZeroClaw Termux Installer
#
# Usage: curl -fsSL https://zeroclaw.dev/termux | bash
#
# This script installs ZeroClaw in Termux with minimal user interaction.
#
set -e
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
CYAN='\033[0;36m'
NC='\033[0m'
echo -e "${CYAN}"
echo " ╔═══════════════════════════════════════╗"
echo " ║ 🦀 ZeroClaw Termux Installer ║"
echo " ╚═══════════════════════════════════════╝"
echo -e "${NC}"
# Check if running in Termux
if [ ! -d "/data/data/com.termux" ]; then
echo -e "${RED}Error: This script must be run in Termux${NC}"
echo "Install Termux from F-Droid: https://f-droid.org/packages/com.termux/"
exit 1
fi
echo -e "${BLUE}[1/5]${NC} Updating packages..."
pkg update -y && pkg upgrade -y
echo -e "${BLUE}[2/5]${NC} Installing dependencies..."
pkg install -y rust git openssl
echo -e "${BLUE}[3/5]${NC} Installing ZeroClaw..."
cargo install zeroclaw
echo -e "${BLUE}[4/5]${NC} Setting up config directory..."
mkdir -p ~/.config/zeroclaw
echo -e "${BLUE}[5/5]${NC} Running setup wizard..."
echo ""
# Check if already configured
if [ -f ~/.config/zeroclaw/config.toml ]; then
echo -e "${YELLOW}Config already exists. Skipping wizard.${NC}"
else
echo -e "${GREEN}Starting configuration wizard...${NC}"
echo ""
zeroclaw init
fi
echo ""
echo -e "${GREEN}╔═══════════════════════════════════════╗${NC}"
echo -e "${GREEN}║ ✓ ZeroClaw installed! ║${NC}"
echo -e "${GREEN}╚═══════════════════════════════════════╝${NC}"
echo ""
echo -e "Run ${CYAN}zeroclaw${NC} to start"
echo -e "Run ${CYAN}zeroclaw config${NC} to change settings"
echo ""
echo -e "${YELLOW}Tip: Add to .bashrc for auto-start:${NC}"
echo " echo 'zeroclaw daemon &' >> ~/.bashrc"
echo ""