diff options
| -rw-r--r-- | README | 69 |
1 files changed, 51 insertions, 18 deletions
@@ -9,15 +9,16 @@ the same way scrcpy(1) does. Source device runs this app; target is any Android 11+ device with Wireless Debugging enabled. Video, audio, touch, key, and clipboard are forwarded. No root required on either side. -Java only, no Kotlin, no NDK. ADB stack vendored from -MuntashirAkon/libadb-android. scrcpy-server.jar is a pinned upstream binary -in `app/src/main/assets/`. +The application code is plain Java. Runtime dependencies include the native +Conscrypt and SPAKE2 libraries. The ADB stack is vendored from +MuntashirAkon/libadb-android. `scrcpy-server.jar` is a pinned upstream binary +in `app/src/main/assets/` and every APK packaging task verifies its checksum. How to run it ------------- -Prerequisites: Android Studio (Iguana or newer) or JDK 17 + Android SDK with -platform-tools and platform 35. +Prerequisites: JDK 17 and Android SDK with platform-tools and platform 35, or +an Android Studio release supporting AGP 8.7. ./scripts/update-server # download + verify pinned scrcpy-server.jar ./gradlew :app:assembleDebug # build debug APK @@ -26,20 +27,34 @@ platform-tools and platform 35. The vendored libadb-android tree is committed; scripts/fetch-vendor is only needed when bumping its pinned tag, not for building. +F-Droid builds `scrcpy-server.jar` from the pinned source submodule. Its recipe +must pass the locally built artifact's checksum as +`-PscrcpyServerSha256=<sha256>`; normal builds verify the tracked upstream +binary checksum. + For a signed release APK, see "How to build a release APK" below. On the target device: Settings -> Developer options -> Wireless debugging -> -Pair device with pairing code. Note the displayed ip:port and 6-digit code. +Pair device with pairing code. Note the pairing port and 6-digit code from +that dialog. Also note the usually different connection port shown on the +parent Wireless debugging screen. -In the app on the source device: enter ip:port and the pairing code, tap -Pair. Then tap the saved device row to connect and mirror. +In the app on the source device: enter the target address, pairing port, +pairing code, and connection port, then tap Pair. Tap the saved device row to +connect and mirror. How to test it -------------- -A `./test` entrypoint runs tests inside a project-local Docker image -(JDK 17, Android cmdline-tools, platform 35, build-tools 35, x86_64 -emulator). The image is built on first run and cached. +A direct host/VM quality gate is available when JDK 17 and Android SDK 35 are +installed: + + ./scripts/check # wrapper/server integrity, all JVM tests, Android lint + +A `./test` entrypoint runs tests inside project-local Docker images. The small +unit target contains JDK 17, Android cmdline-tools, platform 35, and build-tools +35; emulator tiers add the x86_64 API-35 emulator. Images are built on first +use and cached. ./test # JVM unit tests (Wire, Sync, ControlMessages, # Devices, plus piped-stream parser tests for @@ -86,9 +101,9 @@ Set four environment variables and run the release script: The signed APK lands at `app/build/outputs/apk/release/app-release.apk` and its sha256 is -printed at the end. If `apksigner` is reachable (either on $PATH or -under $ANDROID_SDK_ROOT/build-tools/) the script also runs a -post-build `apksigner verify`. +printed at the end. Build-tools 35.0.0 `apksigner` must be available on +`$PATH` or under `$ANDROID_SDK_ROOT`; the script fails unless independent +signature verification succeeds. Generate a release keystore once with: @@ -112,7 +127,7 @@ at pairing time): adb connect ok push /data/local/tmp/scrcpy-server.jar bytes=... spawn server ver=<v> scid=<hex> - openAbstract scrcpy_<scid> ok (attempt <n>) (x3) + openAbstract scrcpy_<scid> ok (x3) video meta codec=h264 audio meta codec=raw (or opus if selected in Settings) video session meta <w>x<h> client_resize=false @@ -122,6 +137,24 @@ Server stdout/stderr is pumped into the same log stream prefixed with `server: ` so target-side errors are visible without an extra adb shell. +Security and privacy +-------------------- +Pairing creates a software-backed ADB key under the app's private files +directory. Revoke it from the target's Wireless debugging screen or clear the +app's data. Clipboard synchronization is automatic in both directions while +a session is connected; do not mirror an untrusted target while sensitive +clipboard contents are present. + +Recordings and crash logs are written under the app-specific external files +directory and are removed when the app is uninstalled. They may contain +screen contents, entered text, addresses, and diagnostic data. + +The continuous foreground service is classified as `mediaPlayback` because +it presents a live remote audio/video stream. This avoids Android 15's +six-hour `dataSync` foreground-service timeout and adds no runtime permission +prompt. + + Layout ------ app/ Android module (Java) @@ -149,6 +182,6 @@ Constraints License ------- -Apache-2.0; see LICENSE. Bundles libadb-android (dual GPL-3.0-or-later OR -Apache-2.0, used here under Apache-2.0) and a pinned, checksum-verified -scrcpy-server.jar from Genymobile/scrcpy (Apache-2.0). +Apache-2.0; see LICENSE. Bundled dependency licenses, source locations, and +the LGPL replacement notice for SPAKE2 are recorded in +`app/src/main/assets/THIRD_PARTY_NOTICES`, which is shipped in the APK. |