#!/usr/bin/env bash
# Initialize wireguard-android submodule for embedded tunnel (optional but recommended for production WG).
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT"
if [[ ! -d third-party/wireguard-android/.git ]]; then
  git submodule add https://git.zx2c4.com/wireguard-android third-party/wireguard-android || \
    git clone --depth 1 https://git.zx2c4.com/wireguard-android third-party/wireguard-android
fi
git submodule update --init --recursive third-party/wireguard-android
echo "wireguard-android ready under third-party/wireguard-android"
echo "Gradle includes :tunnel when third-party/wireguard-android/tunnel exists."
