#!/data/data/com.termux/files/usr/bin/bash # Read-only diagnostics: no installation, no WhatsApp, no identifiers or secrets. set -eu printf 'Hawala phone compatibility probe (read only)\n' if ! command -v getprop >/dev/null 2>&1; then printf 'RESULT: not running on Android; phone compatibility unverified\n' exit 2 fi printf 'Model: %s\n' "$(getprop ro.product.model)" printf 'Android: %s\n' "$(getprop ro.build.version.release)" printf 'Android API: %s\n' "$(getprop ro.build.version.sdk)" printf 'Architecture: %s\n' "$(uname -m)" awk '/MemTotal:/{printf "Total RAM: %.0f MB\n",$2/1024} /MemAvailable:/{printf "Available RAM: %.0f MB\n",$2/1024}' /proc/meminfo df -h "${PREFIX:-.}" | tail -n 1 for task_dependency in python node tesseract restic; do if command -v "$task_dependency" >/dev/null 2>&1; then printf '%s: installed\n' "$task_dependency" else printf '%s: missing\n' "$task_dependency" fi done if command -v node >/dev/null 2>&1; then if ! node --input-type=module -e 'import {DatabaseSync} from "node:sqlite"; let d=new DatabaseSync(":memory:"); d.exec("CREATE TABLE probe(id INTEGER)"); d.close(); console.log("Node:",process.version,"built-in SQLite: OK")'; then printf 'Node built-in SQLite: unavailable; connector compatibility unverified\n' fi fi if command -v python >/dev/null 2>&1; then if ! python -c 'import sqlite3; from cryptography.hazmat.primitives.ciphers.aead import AESGCM; c=sqlite3.connect(":memory:"); c.execute("CREATE TABLE probe(id INTEGER)"); c.close(); key=bytes(32); nonce=bytes(12); a=AESGCM(key); assert a.decrypt(nonce,a.encrypt(nonce,b"probe",b"test"),b"test")==b"probe"; print("Python SQLite and AES-GCM: OK (dummy data only)")'; then printf 'Python SQLite or encryption library: unavailable\n' fi fi if command -v tesseract >/dev/null 2>&1; then tesseract --list-langs 2>/dev/null; fi if command -v curl >/dev/null 2>&1; then printf 'Public pilot health check (no credentials):\n' if ! curl --proto '=https' --connect-timeout 8 --max-time 15 --fail --silent --show-error 'https://hawala-sync-access.pages.dev/health'; then printf '\nNetwork check: pilot endpoint not reachable from this phone\n' fi printf '\n' fi printf 'RESULT: diagnostics only; this does not certify production readiness\n'