Feature/device hub#1703
Open
doronz88 wants to merge 8 commits into
Open
Conversation
5206d8a to
097d37b
Compare
pymobiledevice3/osu/win_util.py imports win32security but pywin32 was never declared. Previously the Windows CI happened to pull it in transitively (via pywintunx-pmd3); since that dep was removed in e0e5b20 the Windows job fails at conftest import time with: ModuleNotFoundError: No module named 'win32security' Declare pywin32 directly, gated on platform_system == "Windows".
- PEP 723 shebang (uv run --script) so the sniffer is self-installing and no longer relies on the surrounding pyproject's env. - XpcInt64Type / XpcUInt64Type repr override — pformat() now shows ``Int64(12)`` / ``UInt64(12)`` instead of bare ints, preserving the wire-type distinction that matters when reproducing the format from a client. - log each decoded XPC frame as full raw hex too, not just hyperframe's truncated 10-byte preview — needed to actually decode the wire format byte-by-byte when writing a client.
- send_request: bump next_message_id[ROOT_CHANNEL] so fire-and-forget calls get distinct ids on the wire (devicectl always uses monotonic ids; many iOS daemons reject or drop duplicates). - _do_handshake: emit Headers#3 between the two stream-1 init frames to match the order devicectl uses. dtuhidd's RemoteServiceDiscovery rejects out-of-order init with "Invalid or missing remote device connection version flags" + xpc_connection_cancel() otherwise. - RemoteXPCConnection.local_address property: typed (host, port) of the local end of the connection — useful when telling the device a callback endpoint on this host's tunnel interface (e.g. RTP receiver port in mediastreamstart).
Some CoreDevice features take both a feature identifier and an action identifier (e.g. com.apple.coredevice.feature.startmediastream is paired with com.apple.coredevice.action.mediastreamstart). Pass it through as CoreDevice.actionIdentifier when provided. Also bump CORE_DEVICE_VERSION to "629.3" to match the version devicectl on macOS Tahoe sends, and CoreDeviceDDIProtocolVersion to 2.
Wraps com.apple.coredevice.screencaptureservice / feature.capturescreenshot. Returns the raw PNG bytes from CoreDevice.output["image"] together with the display identifier and image format. Wire CLI: pymobiledevice3 developer core-device screen-capture screenshot <path>
097d37b to
08a1176
Compare
Adds three RemoteXPC services and their CLI surface:
- IndigoHIDService (com.apple.coredevice.hid.indigo) — generic HID button,
scroll, digitizer, and vendor-defined events. Buttons addressable both
by raw (usagePage, usageCode) and by friendly name (home, power, sleep,
volume-up, volume-down, mute, siri, lock). The wire envelope used here
is the {messageType, payload, featureIdentifier} format consumed by
dtuhidd's IndigoHIDServer.
- UniversalHIDService (com.apple.coredevice.hid.universalhid) — virtual
HID device management (attach/detach by HIDDeviceType, send raw HID
reports, list supported devices).
- UniversalHIDServiceService (com.apple.coredevice.hid.universalhidservice)
— register/inspect virtual HID services. ``list-connected`` enumerates
the device's currently active HID services (touchscreen, keyboard,
mainScreenButtons, etc.).
- DeviceControlService (com.apple.coredevice.devicecontrol) — orientation
control (portrait, portrait-upside-down, landscape-left, landscape-right).
Sample press: pymobiledevice3 developer core-device hid button home press
Three new modules and two CLI commands for the device's screen stream:
- display_service.py — DisplayService (com.apple.coredevice.displayservice)
with start_video_stream() (mediastreamstart action) and stop_media_stream
(best-effort: action identifier is a guess; we treat the device's
IncompleteReadError-on-channel-close as success since it's empirically
how a successful stop responds). Also get_media_support_info /
get_media_stream_server_status.
- media_stream_offer.py — builds the negotiatorOffer bplist that
mediastreamstart requires. Reproduces Apple's exact wire format
including the zlib-compressed avcMediaStreamNegotiatorMediaBlob
protobuf (codec descriptors, "Viceroy 1.7.0" decoder identification,
bitrate ranges).
- screen_stream.py — pure-stdlib pipeline that sits above DisplayService:
asyncio UDP receive -> RFC 7798 RTP/HEVC depacketize
-> cache VPS/SPS/PPS+IDR + parse SPS for WebCodecs codec string
-> HTTP chunked stream of framed access units
-> built-in HTML viewer that decodes with WebCodecs VideoDecoder
No external player or transcoder needed; the browser drives the OS
hardware HEVC decoder (VideoToolbox on macOS).
- misc/rtp_dump.py — offline RTP capture -> Annex-B HEVC bitstream
converter for the raw-capture mode. Handles RFC 7798 Aggregation
Packets (nal_type 48) and Fragmentation Units (nal_type 49).
CLI:
developer core-device display get-media-support-info
developer core-device display get-media-stream-server-status
developer core-device display start-video-stream <path> # raw RTP capture
developer core-device display serve-video-stream # HTTP+WebCodecs viewer
Wraps com.apple.coredevice.locationservice / feature.simulatelocation. ``available-scenarios`` action returns the device's built-in scenarios (City Run, City Bicycle Ride, Apple, Freeway Drive, ...). CLI: pymobiledevice3 developer core-device location available-scenarios
08a1176 to
e51801c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.