Echo

A chat application that needs no account, no network no server just a device.

This is a fork of damnbadcoder/Echo, kept for reference and contributions. It is not an original project.

Echo

Echo is a decentralized, off-grid peer-to-peer messaging application for Android. It operates directly device-to-device over Bluetooth Low Energy (BLE) without internet access, cellular networks, Wi-Fi infrastructure, or centralized servers.


Current Features


System Requirements


Environment Setup by Operating System

Linux (Ubuntu / Debian)

  1. Update packages and install OpenJDK 17 and dependencies:

    sudo apt update
    sudo apt install -y openjdk-17-jdk git curl unzip
  2. Install Node.js (LTS):

    curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
    sudo apt install -y nodejs
  3. Install Android Command Line Tools or Android Studio:
    Download Android Studio from the official website or install the command line tools.
    Export the environment variables in your ~/.bashrc or ~/.zshrc:

    export ANDROID_HOME=$HOME/Android/Sdk
    export PATH=$PATH:$ANDROID_HOME/emulator
    export PATH=$PATH:$ANDROID_HOME/platform-tools
    export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin

    Apply changes:

    source ~/.bashrc

Linux (Arch Linux)

  1. Install JDK 17, Node.js, and Android platform tools:

    sudo pacman -S jdk17-openjdk nodejs npm android-tools
  2. Set default Java version:

    sudo archlinux-java set java-17-openjdk
  3. Configure environment variables in ~/.bashrc or ~/.zshrc:

    export ANDROID_HOME=$HOME/Android/Sdk
    export PATH=$PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/cmdline-tools/latest/bin

macOS

  1. Install Homebrew if not already installed, then install OpenJDK 17 and Node.js:

    brew install openjdk@17 node android-platform-tools
  2. Symlink OpenJDK for the system Java wrapper:

    sudo ln -sfn $(brew --prefix)/opt/openjdk@17/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-17.jdk
  3. Install Android Studio via Homebrew or manually:

    brew install --cask android-studio
  4. Configure environment variables in ~/.zshrc:

    export JAVA_HOME=$(/usr/libexec/java_home -v 17)
    export ANDROID_HOME=$HOME/Library/Android/sdk
    export PATH=$PATH:$ANDROID_HOME/emulator
    export PATH=$PATH:$ANDROID_HOME/platform-tools
    export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin

    Apply changes:

    source ~/.zshrc

Windows

  1. Install OpenJDK 17, Node.js LTS, and Android Studio using Windows Package Manager (winget in PowerShell as Administrator):

    winget install Microsoft.OpenJDK.17
    winget install OpenJS.NodeJS.LTS
    winget install Google.AndroidStudio
  2. Configure System Environment Variables:

    • Set JAVA_HOME to your JDK directory (typically C:\Program Files\Microsoft\jdk-17...).
    • Set ANDROID_HOME to C:\Users\<YourUsername>\AppData\Local\Android\Sdk.
    • Add the following paths to your system Path variable:
      • %ANDROID_HOME%\platform-tools
      • %ANDROID_HOME%\cmdline-tools\latest\bin
      • %JAVA_HOME%\bin
  3. Open a new PowerShell terminal to verify:

    java -version
    node -v
    adb --version

Build and Run Instructions

1. Clone and Install Dependencies

git clone https://github.com/damnbadcoder/Echo.git
cd Echo
npm install

2. Run Automated Tests

Run the test suite to verify cryptographic operations, binary wire protocol framing, chunking pipelines, and dispatcher queues:

npx vitest run

3. Start Development Server

To start Metro and the Expo development server:

npx expo start

To run directly on a connected Android device with development client:

npx expo run:android

For frontend layout and styling inspection in a browser:

npx expo start --web

A lightweight web fallback (store.web.ts) is provided solely for browser UI previewing. Full BLE mesh routing requires an Android device.

4. Build Standalone Android APK

Linux / macOS

cd android
./gradlew assembleRelease
cd ..

Windows (PowerShell / Command Prompt)

cd android
.\gradlew.bat assembleRelease
cd ..

The compiled release APK will be generated at:

android/app/build/outputs/apk/release/app-release.apk

To build a debug APK instead, replace assembleRelease with assembleDebug.

5. Install APK via ADB

Ensure your Android device is connected via USB and recognized:

adb devices

Install the APK:

adb install -r android/app/build/outputs/apk/release/app-release.apk

Sideloading, Play Protect, and Developer Setup

1. Enabling Developer Mode and USB Debugging

To install the APK directly from your computer over USB, your phone must have Developer Mode and USB Debugging enabled:

  1. Open Settings on your Android device.
  2. Navigate to About Phone (or Software Information on Samsung devices).
  3. Tap Build Number repeatedly seven (7) times until a prompt announces "You are now a developer!".
  4. Go back to Settings -> System -> Developer Options (or Additional Settings on Xiaomi/MIUI).
  5. Toggle USB Debugging to ON.
  6. Connect the phone to your computer with a USB cable.
  7. When the prompt "Allow USB debugging?" appears on your device screen, check "Always allow from this computer" and tap Allow.

2. Resolving Google Play Protect Warnings

Because Echo is built locally or downloaded outside of the Google Play Store, it is signed with a local/custom certificate. Google Play Protect will flag sideloaded APKs with a security warning.

Common Play Protect Scenarios and Solutions:

3. Permissions and OEM Background Restrictions

For Echo to function properly off-grid, the following device settings must be configured:


Repository Structure

Echo/
├── android/                  # Native Android project configuration and Gradle scripts
├── assets/                   # App icons, splash graphics, and tab drawables
├── modules/
│   └── ble-mesh/             # Native Android BLE GATT server and central manager module
├── src/
│   ├── app/
│   │   ├── _layout.tsx       # Root layout, theme setup, and permission gateway
│   │   ├── index.tsx         # Node discovery, RSSI signal display, and channel navigation
│   │   └── chat.tsx          # Real-time chat screen, message feed, and room controller
│   ├── components/
│   │   ├── RadioAccessGate.tsx # Runtime Bluetooth and Location permission controller
│   │   ├── animated-icon.tsx   # Startup splash animation overlay
│   │   └── app-tabs.tsx        # Bottom tab navigation bar
│   └── lib/
│       ├── MeshService.ts    # BLE lifecycle manager, GATT routing, and packet scheduler
│       ├── protocol.ts       # Binary wire protocol framing and serialization
│       ├── chunker.ts        # MTU packet chunker and reassembly buffer
│       ├── crypto-core.ts    # Ed25519, X25519, and XChaCha20-Poly1305 cryptographic engine
│       ├── store.ts          # SQLite message history and SecureStore identity persistence
│       ├── store.web.ts      # Web storage fallback for browser UI preview
│       ├── dispatcher.ts     # Internal packet event dispatcher
│       └── tag-manager.ts    # Anti-tracking rotating advertisement tag generator
├── package.json              # Project dependencies and operational scripts
└── tsconfig.json             # TypeScript compiler configuration

License

This project is licensed under the MIT License. See the LICENSE file for details.