diff options
| author | Lena <lena@omega> | 2026-01-01 00:00:00 +0000 |
|---|---|---|
| committer | Lena <lena@omega> | 2026-06-24 22:14:50 +0300 |
| commit | eb0c8951196c637e44daf3c0617b131b997d5d2c (patch) | |
| tree | 2f83b6a41cee745467e53fc401942b82cea286ea /scripts/fetch-vendor | |
| download | scrcpy-android-eb0c8951196c637e44daf3c0617b131b997d5d2c.tar.gz | |
scrcpy-android: mirror an Android device over wireless ADB0.1
Native Java app for Android 12+ that mirrors another Android
device over wireless ADB, forwarding video, audio, touch input,
and clipboard. Bundles a pinned scrcpy-server.jar and the
vendored libadb-android stack. Supports h264/h265/av1 video and
raw/opus audio with in-app codec selection. No NDK, no Kotlin.
Includes JVM unit tests and a Docker-based emulator e2e rig.
Diffstat (limited to 'scripts/fetch-vendor')
| -rwxr-xr-x | scripts/fetch-vendor | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/scripts/fetch-vendor b/scripts/fetch-vendor new file mode 100755 index 0000000..4c73381 --- /dev/null +++ b/scripts/fetch-vendor @@ -0,0 +1,44 @@ +#!/bin/sh +# Pull pinned vendor sources via git subtree. Idempotent. +# +# Usage: +# scripts/fetch-vendor # add or update to pinned tag, verify SHA +# +# Bump: +# 1. Pick a new tag from https://github.com/MuntashirAkon/libadb-android +# 2. git ls-remote https://github.com/MuntashirAkon/libadb-android.git \ +# refs/tags/<tag> +# → copy the commit hex. +# 3. Update LIBADB_TAG and LIBADB_SHA below. +# 4. Run this script. +# 5. Re-prune. This repo keeps only the libadb module plus license files +# (vendor/libadb-android/{libadb,LICENSES,COPYING,README.md, +# SERVICES.md}); the rest of upstream - sample app, gradle wrapper, +# jitpack.yml - is unused. A subtree pull re-adds it; delete it again. + +set -eu + +LIBADB_REPO='https://github.com/MuntashirAkon/libadb-android.git' +LIBADB_TAG='3.1.1' +LIBADB_SHA='c849886ebc6d48e7b46d967e78a6bb65c90c3b74' +LIBADB_PREFIX='vendor/libadb-android' + +cd "$(git rev-parse --show-toplevel)" + +# Tags can be re-pointed upstream; cross-check against the pinned commit. +remote_sha=$(git ls-remote "$LIBADB_REPO" "refs/tags/$LIBADB_TAG" | awk '{print $1}') +if [ "$remote_sha" != "$LIBADB_SHA" ]; then + echo "fetch-vendor: refs/tags/$LIBADB_TAG points at $remote_sha," >&2 + echo " expected $LIBADB_SHA. Refusing to pull." >&2 + exit 1 +fi + +if [ ! -d "$LIBADB_PREFIX" ]; then + echo "fetch-vendor: adding $LIBADB_PREFIX @ $LIBADB_TAG ($LIBADB_SHA)" + git subtree add --prefix="$LIBADB_PREFIX" "$LIBADB_REPO" "$LIBADB_TAG" --squash +else + echo "fetch-vendor: pulling $LIBADB_PREFIX @ $LIBADB_TAG ($LIBADB_SHA)" + git subtree pull --prefix="$LIBADB_PREFIX" "$LIBADB_REPO" "$LIBADB_TAG" --squash +fi + +echo "fetch-vendor: ok" |