#!/data/data/com.termux/files/usr/bin/bash set -e RED='\033[1;31m'; GREEN='\033[1;32m'; YELLOW='\033[1;33m' CYAN='\033[1;36m'; BOLD='\033[1m'; RESET='\033[0m' ok() { printf "${GREEN}[+]${RESET} %s\n" "$*"; } err() { printf "${RED}[x]${RESET} %s\n" "$*" >&2; } warn() { printf "${YELLOW}[!]${RESET} %s\n" "$*"; } info() { printf "${CYAN}[i]${RESET} %s\n" "$*"; } step() { printf "${CYAN}[*]${RESET} %s\n" "$*"; } printf "${CYAN}" cat << 'BANNER' _____ _____ ____ __ __ _ _ __ __ |_ _| ____| _ \| \/ | | | | \/ | | | | _| | |_) | |\/| | | | | |\/| | | | | |___| _ <| | | | |_| | | | | |_| |_____|_| \_\_| |_|\___/|_| |_| T E R M U X T O O L S S U I T E BANNER printf "${RESET}\n" REPO_URL="${TERMUX_TOOLS_REPO:-https://github.com/P00KE00M/pokemon-tools.git}" TARGET="$HOME/termux-tools" step "Installing dependencies..." for pkg in curl wget git jq tar openssh sshpass; do command -v "$pkg" >/dev/null 2>&1 || pkg install -y "$pkg" >/dev/null 2>&1 done ok "Dependencies ready" echo step "Installing Termux Tools Suite..." if [ -d "$TARGET" ]; then warn "Existing install found" printf " Backup and reinstall? [y/N]: " read -r ans case "$ans" in [yY]*) mv "$TARGET" "$TARGET.old.$(date +%s)"; ok "Backed up" ;; *) info "Keeping existing"; ;; esac fi if [ ! -d "$TARGET" ]; then step "Cloning from GitHub..." git clone --depth=1 "$REPO_URL" "$TARGET" >/dev/null 2>&1 || { err "Clone failed — check URL" exit 1 } ok "Cloned" fi # FIX: Set executable permissions step "Setting permissions..." chmod +x "$TARGET/bin/termux-tools" 2>/dev/null chmod +x "$TARGET/termux-tools" 2>/dev/null chmod +x "$TARGET/install.sh" 2>/dev/null find "$TARGET/lib" -name "*.sh" -exec chmod +x {} \; 2>/dev/null ok "Permissions set" step "Installing command..." TARGET_BIN="$PREFIX/bin/termux-tools" TARGET_ALIAS="$PREFIX/bin/tt" cat > "$TARGET_BIN" << L #!/data/data/com.termux/files/usr/bin/bash exec "$TARGET/bin/termux-tools" "\$@" L chmod +x "$TARGET_BIN" ln -sf "$TARGET_BIN" "$TARGET_ALIAS" mkdir -p "$HOME/.termux-tools" ok "Command: termux-tools" ok "Alias : tt" echo printf "${GREEN}${BOLD}══════════════════════════════════════════════${RESET}\n" printf "${GREEN}${BOLD} ✓ Installed Successfully!${RESET}\n" printf "${GREEN}${BOLD}══════════════════════════════════════════════${RESET}\n" echo printf "Run: ${CYAN}${BOLD}termux-tools${RESET} or ${CYAN}${BOLD}tt${RESET}\n" echo printf "Launch now? [Y/n]: " read -r ans case "$ans" in [nN]*) info "Run 'tt' when ready." ;; *) clear; exec "$TARGET_BIN" ;; esac