← All reportsPublic report

genymobile/scrcpy

Display and control your Android device

148k stars C View on GitHubprofiled 11d ago
Try GitZoid
0PRs this week
0Contributors
0Deps scanned
0Issues found
01 · Repo overview

How scrcpy is put together

scrcpy is a desktop application that mirrors and controls an Android device over USB or TCP/IP. It has two halves built by different toolchains: a C client (built with Meson) that renders the device screen via SDL/OpenGL, decodes media via FFmpeg, sends input/control messages, and records streams; and a Java 'scrcpy-server' APK-like artifact (built with Gradle) pushed to the device and run via app_process, which captures display/camera/audio through hidden Android APIs and executes injected input events. The client launches the server over an adb tunnel; raw H.264/H.265/AV1/OPUS/AAC frames flow device-to-client while control/device messages flow client-to-device over plain sockets established by adb forward/reverse. There is no web layer, no datastore, and no authentication mechanism.

Languages

CJavaShell

Frameworks

SDL (via app/deps/sdl.sh)FFmpeg/libav (via app/deps/ffmpeg.sh)libusb (via app/deps/libusb.sh)dav1d (via app/deps/dav1d.sh)Android SDK / android.jar (server)OpenGL

Infrastructure

adb (Android Debug Bridge) transport/tunnelsUSB via libusb (AOA/HID, OTG mode)V4L2 webcam sink (Linux)Windows/macOS/Linux cross builds via meson cross files

Major components

Client core (app/src/scrcpy.c, main.c)

Orchestrates startup: parses CLI options, connects adb tunnel, starts the on-device server, and wires together demuxer, decoder, controller, recorder, and screen.

Media pipeline (demuxer.c, decoder.c, packet_merger.c, audio_player.c, frame_buffer.c)

Receives encoded video/audio packets from the device socket, merges fragmented packets, feeds FFmpeg decoders, and renders/plays them with clock/regulator-based synchronization.

Screen rendering (screen.c, opengl.c, texture.c, icon.c)

Manages the SDL window and OpenGL textures that display mirrored frames, including rotation, fullscreen, and resize handling.

Control/input (controller.c, input_manager.c, control_msg.c, receiver.c)

Serializes mouse/keyboard/gamepad/clipboard actions into control messages sent to the device and processes device-to-client messages.

USB/HID subsystem (usb/, hid/, uhid/, aoa_hid.c, scrcpy_otg.c)

Implements physical keyboard/mouse/gamepad simulation over USB HID/AOA/UHID and OTG-mode control without USB debugging.

ADB integration (app/src/adb/)

Locates the adb binary, lists devices, parses device state, and establishes forward/reverse socket tunnels to reach the on-device server.

scrcpy-server (server/src/main/java/com/genymobile/scrcpy)

Java process executed on the Android device via app_process that captures display/camera/audio using hidden APIs, encodes with MediaCodec/MediaRecorder, injects input events, and manages lifecycle/cleanup.

Device-side wrappers & workarounds (wrappers/, Workarounds, FakeContext, CleanUp)

Reflectively accesses hidden Android system services (WindowManager, ActivityManager, etc.), fakes a shell-UID context, applies OEM workarounds, and restores modified device settings after exit.

02 · Weekly changes

No digest this week

1 weeksWeek of

03 · Security check

Dependencies and code review

0 dependencies scanned

Dependency advisories

Security Watch

No known advisories across 0 scanned dependencies.

No known advisories in the scanned dependencies.

Code review

No concrete code-level issues confirmed.

Get this report every week for your repos.

GitZoid learns each repo, reports what changed, and flags what needs attention. One flat price for the whole team.

$19 a month, flat · First 10 outputs free · No card required