{
  "added_at": "2026-11-01",
  "additional_evidence_urls": [
    "https://github.com/postlund/pyatv/blob/b277a4c8222ecdcbaab8a24e3e713ca44765adb4/README.md",
    "https://github.com/postlund/pyatv/blob/b277a4c8222ecdcbaab8a24e3e713ca44765adb4/docs/documentation/protocols.md#L13-L18",
    "https://github.com/postlund/pyatv/blob/b277a4c8222ecdcbaab8a24e3e713ca44765adb4/docs/documentation/protocols.md#L363-L375",
    "https://github.com/postlund/pyatv/blob/b277a4c8222ecdcbaab8a24e3e713ca44765adb4/docs/documentation/atvproxy.md",
    "https://github.com/postlund/pyatv/blob/b277a4c8222ecdcbaab8a24e3e713ca44765adb4/docs/documentation/supported_features.md",
    "https://github.com/postlund/pyatv/blob/b277a4c8222ecdcbaab8a24e3e713ca44765adb4/docs/documentation/documentation.md",
    "https://github.com/postlund/pyatv/blob/b277a4c8222ecdcbaab8a24e3e713ca44765adb4/docs/internals/testing.md",
    "https://github.com/postlund/pyatv/blob/b277a4c8222ecdcbaab8a24e3e713ca44765adb4/docs/support/acknowledgements.md",
    "https://github.com/postlund/pyatv/blob/b277a4c8222ecdcbaab8a24e3e713ca44765adb4/.github/workflows/tests.yml",
    "https://github.com/postlund/pyatv/blob/b277a4c8222ecdcbaab8a24e3e713ca44765adb4/pyproject.toml",
    "https://github.com/postlund/pyatv/blob/b277a4c8222ecdcbaab8a24e3e713ca44765adb4/CHANGES.md",
    "https://github.com/postlund/pyatv/blob/b277a4c8222ecdcbaab8a24e3e713ca44765adb4/LICENSE.md",
    "https://github.com/postlund/pyatv/releases/tag/v0.18.0",
    "https://pypi.org/project/pyatv/0.18.0/"
  ],
  "category": "reconstruction-cases",
  "description_en": "Asyncio Python library and command-line tools that act as an independent client for Apple TV and AirPlay devices by reimplementing the DMAP/DACP, Media Remote Protocol, Companion Link, AirPlay and RAOP protocols, which its protocol documentation describes as reverse engineered. That page records the recovered binary formats, Zeroconf properties, the OPACK encoding, pair-setup and pair-verify exchanges and Companion commands, with some request headers taken from Wireshark captures of the iPhone Remote app, and the bundled atvproxy relays MRP, Companion and AirPlay sessions to print decrypted messages for further analysis. On this basis pyatv provides remote control, metadata with push updates, app and account switching, audio-output management and AirPlay streaming to Apple TVs, HomePods and third-party receivers.",
  "description_zh": "基于 asyncio 的 Python 库和命令行工具，通过重新实现 DMAP/DACP、Media Remote Protocol、Companion Link、AirPlay 和 RAOP 协议，充当 Apple TV 与 AirPlay 设备的独立客户端；其协议文档称这些协议均经逆向工程得出。该文档记录了恢复出的二进制格式、Zeroconf 属性、OPACK 编码、pair-setup 与 pair-verify 交互以及 Companion 命令，其中部分请求头取自 iPhone Remote 应用的 Wireshark 抓包；附带的 atvproxy 可中继 MRP、Companion 和 AirPlay 会话并打印解密后的消息，供进一步分析。在此基础上，pyatv 提供遥控、带推送更新的元数据、应用与账户切换、音频输出管理，以及向 Apple TV、HomePod 和第三方接收器的 AirPlay 推流。",
  "entry_url": "https://awesomerea.org/resources/pyatv-apple-tv-airplay-protocols-case/",
  "entry_url_zh": "https://awesomerea.org/zh/resources/pyatv-apple-tv-airplay-protocols-case/",
  "evidence_url": "https://github.com/postlund/pyatv/blob/b277a4c8222ecdcbaab8a24e3e713ca44765adb4/docs/documentation/protocols.md",
  "group": "cases",
  "id": "pyatv-apple-tv-airplay-protocols-case",
  "json_url": "https://awesomerea.org/resources/pyatv-apple-tv-airplay-protocols-case/record.json",
  "kind": "case-study",
  "markdown_url": "https://awesomerea.org/resources/pyatv-apple-tv-airplay-protocols-case/index.md",
  "markdown_url_zh": "https://awesomerea.org/zh/resources/pyatv-apple-tv-airplay-protocols-case/index.md",
  "name": "pyatv: a reverse-engineered client for Apple TV and AirPlay protocols",
  "name_zh": "pyatv：逆向工程实现的 Apple TV 与 AirPlay 协议客户端",
  "record_type": "resource",
  "relationship": "independent-reconstruction",
  "requirements": [
    "Release at review: 0.18.0, published to GitHub and PyPI on 2026-06-19 as a tvOS-compatibility release; the reviewed master commit is the release commit, while the v0.18.0 tag points to a parallel commit that differs only in CHANGES.md and pyatv/const.py. The protocol page limits itself to what has been reverse engineered: its Companion Link section is called mostly speculation and guesses, the OPACK description is incomplete and unverified, and the MRP implementation section is still marked TBD. The acknowledgements say MRP support builds on Jean Regisser's mediaremotetv-protocol findings.",
    "No Apple software, firmware or keys are bundled. pyatv connects to the user's own Apple TV, HomePod, AirPort Express or other AirPlay receiver on the local network; most protocols require pairing with a PIN shown on the device, and credentials and settings are kept in pyatv's storage. On tvOS 15 and later AirPlay must be set up because MRP moved into an AirPlay 2 stream, and RAOP supports only legacy pairing.",
    "Requires Python 3.9+ and installs from PyPI or the project's container images; the installation guide lists build-essential, libssl-dev, libffi-dev and Python headers for building dependencies on Debian-style systems, and RAOP audio streaming relies on miniaudio. CI runs on Ubuntu, macOS and Windows with Python 3.9 to 3.14.",
    "Tests are mostly unit tests, plus functional tests for DMAP, MRP, Companion, RAOP, mDNS and scanning that run against a fake device which, according to the testing guide, implements limited functionality and is only meant to be compatible with pyatv. atvproxy is described as an incubating script that depends on internal APIs.",
    "MIT (LICENSE.md). Apple's protocols, devices and software keep their own rights; pyatv is an independent implementation."
  ],
  "requirements_zh": [
    "审阅时的版本为 0.18.0，于 2026-06-19 同时发布到 GitHub 和 PyPI，主要为兼容新版 tvOS；所审阅的 master 分支提交即发布提交，而 v0.18.0 标签指向另一个并行提交，两者仅在 CHANGES.md 和 pyatv/const.py 上有差异。协议文档只涵盖已逆向得出的内容：Companion Link 一节自称大多是推测和猜想，OPACK 的描述并不完整且未经验证，MRP 的实现一节仍标为待定。致谢页称 MRP 支持建立在 Jean Regisser 的 mediaremotetv-protocol 研究成果之上。",
    "仓库未附带任何 Apple 软件、固件或密钥。pyatv 连接使用者自己在局域网中的 Apple TV、HomePod、AirPort Express 或其他 AirPlay 接收器；多数协议需要用设备上显示的 PIN 配对，凭据和设置保存在 pyatv 的存储中。tvOS 15 及更高版本因 MRP 已移入 AirPlay 2 数据流，必须先设置好 AirPlay；RAOP 仅支持旧式配对。",
    "需要 Python 3.9+，可从 PyPI 或项目的容器镜像安装；安装指南列出在 Debian 类系统上构建依赖所需的 build-essential、libssl-dev、libffi-dev 和 Python 头文件，RAOP 音频推流依赖 miniaudio。CI 在 Ubuntu、macOS 和 Windows 上以 Python 3.9 至 3.14 运行。",
    "测试以单元测试为主，另有针对 DMAP、MRP、Companion、RAOP、mDNS 和扫描的功能测试；据测试指南，这些测试连接的模拟设备只实现有限功能，且仅求与 pyatv 兼容。atvproxy 也被描述为处于孵化阶段、依赖内部 API 的脚本。",
    "采用 MIT 许可（LICENSE.md）。Apple 的协议、设备和软件保留其各自权利；pyatv 是独立实现。"
  ],
  "targets": [
    "protocol"
  ],
  "url": "https://github.com/postlund/pyatv",
  "verification": "source-reviewed",
  "verified_at": "2026-10-19"
}
