1
0
mirror of git://f0xx.org/android_cast synced 2026-07-29 03:18:32 +03:00

vpn service sync

This commit is contained in:
Anton Afanasyeu
2026-06-11 13:43:15 +02:00
parent 6ed53e80ab
commit 8735fe4177
43 changed files with 1185 additions and 181 deletions

View File

@@ -1,36 +1,5 @@
#!/usr/bin/env bash
# Initialize wireguard-android submodule (third-party/wireguard-android in .gitmodules).
# Back-compat wrapper — wireguard-android is one of the third-party submodules.
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT"
SUB_PATH="third-party/wireguard-android"
SUB_NAME="third-party/wireguard-android"
if ! grep -q "$SUB_PATH" .gitmodules 2>/dev/null; then
echo "error: .gitmodules missing $SUB_PATH" >&2
exit 1
fi
# .gitmodules without a gitlink in the tree breaks plain `git submodule update`.
if ! git cat-file -e "HEAD:$SUB_PATH" 2>/dev/null \
&& ! git ls-files --stage "$SUB_PATH" | grep -q '^160000'; then
url="$(git config -f .gitmodules --get "submodule.$SUB_NAME.url" || true)"
if [ -z "$url" ]; then
echo "error: no url for submodule.$SUB_NAME in .gitmodules" >&2
exit 1
fi
sha="$(git ls-remote "$url" HEAD | awk 'NR==1 {print $1}')"
if [ -z "$sha" ]; then
echo "error: could not resolve HEAD for $url" >&2
exit 1
fi
echo "registering missing gitlink for $SUB_PATH at $sha"
git update-index --add --cacheinfo 160000,"$sha","$SUB_PATH"
echo "warning: gitlink was missing from the tree — commit third-party/wireguard-android after init" >&2
fi
git submodule sync "$SUB_PATH"
git submodule update --init --recursive "$SUB_PATH"
echo "wireguard-android ready under $SUB_PATH"
echo "Gradle includes :tunnel when $SUB_PATH/tunnel exists."
exec "$ROOT/scripts/init-third-party-submodules.sh" --only third-party/wireguard-android