From eb0c8951196c637e44daf3c0617b131b997d5d2c Mon Sep 17 00:00:00 2001 From: Lena Date: Thu, 1 Jan 2026 00:00:00 +0000 Subject: scrcpy-android: mirror an Android device over wireless ADB 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. --- scripts/fetch-vendor | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 scripts/fetch-vendor (limited to 'scripts/fetch-vendor') 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/ +# → 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" -- cgit v1.2.3