Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Has anyone reversed engineered the protocol used by Apple's iOS Remote app for controlling an Apple TV over IP?

I'm curious if it's possible for me to write programs that can control an Apple TV, specifically an Apple TV 4th gen running tvOS 9.1.1, like Apple's Remote app for iOS can. I'd like to send it commands for navigating in the four cardinal directions, selecting an item on the screen, going up the navigation stack -- essentially what Apple's Remote app can do.

Has anyone done any work reverse engineering the protocol it uses? Cursory Googling only has so far yielded out of date results about earlier generation Apple TVs and the DAAP protocol which looks like something different than what I want.

like image 705
Bri Bri Avatar asked Feb 12 '16 05:02

Bri Bri


People also ask

Can Apple TV be controlled remotely?

If you have an Apple TV (4th generation or later), HomePod, or HomePod mini, or if you set up an iPad (with iOS 10.3 or later, or with iPadOS) that you leave at home, you can use remote access. The Apple TV, HomePod, HomePod mini, or iPad acts as a home hub, which allows remote access to your accessories.

Can Apple TV be controlled by iPhone?

With the Apple TV Remote in Control Center, you can control your Apple TV or AirPlay 2-compatible smart TV with your iPhone, iPad, or iPod touch.

Can Apple Remote control other devices?

The remote uses Bluetooth 5.0 to communicate with Apple TV 4K and IR technology to control other devices. Learn more about your Siri Remote or Apple TV Remote.

Why did Apple get rid of remote app?

So the discontinuation of the app could have been done to encourage users to use the new Remote feature which has been built in the Control Center in iOS 1. With the new Remote feature that has been built in the Control Center in iOS 12, Apple TV users will be able to get access to all the controls on Siri Remote.


1 Answers

I captured the traffic on my iPhone using tcpdump and analyzed it with WireShark. The Remote app asks the Apple TV with normal HTTP requests on port 3689.

The workflow of the app consists in four HTTP requests:

  • /server-info for getting infos about the Apple TV. It responds with a Apple proprietary DAAP response (Digital Audio Access Protocol) providing some tags about the device, like the display name.
  • /login is performed during connection, when the app displays the "Connecting to Apple TV..." message. It responds with a DAAP about the login status.
  • Here's the bottleneck. /home-share-verify validates the connection between the app and the Apple TV. This call needs a Client-DAAP-Validation header with a long unknown string value. According to Wikipedia, this seems to be like an hash generated by a certificate exchange between verified sources that was introduced in iTunes 7.0+ and never reverse engineered.
  • /ctrl-int/1/{controlpromptupdate|controlpromptentry|playstatusupdate} seems to be the calls made for the input buttons.

Some other minor calls are fired in between (like a Bonjour service update or a /databases call).

Here and here you can find more infos. Hope this helps for getting an overview of how this simple (but protected) app works.

like image 123
Nicola Giancecchi Avatar answered Oct 12 '22 21:10

Nicola Giancecchi