AirPlay is a proprietary protocol stack/suite developed by Apple Inc. that allows wireless streaming between devices of audio, video, device screens, and photos, together with related metadata. Originally implemented only in Apple's software and devices, it was called AirTunes and used for audio only. Apple has since licensed the AirPlay protocol stack as a third-party software component technology to manufacturers that build products compatible with Apple's devices
Airplay has 4 main functions: music playing, video playing, picture playing, and mirror playing.The picture playing function has been removed after iOS9, and the picture display is using mirror function.
Using Bonjour, you can refer to mDNSResponder, jmdns, and register two services: airtunes and airplay, AirplayTxt, and RaopTxt can be filled in with demo, and the values can be modified according to their own requirements.
It needs to be noted as follows:
Airtunes: "12345@wirelessdisplay", "_raop._tcp."
Airplay: "wirelessdisplay", "_airplay._tcp."
The parameter "_airplay._tcp." and "_raop._tcp." can not be modified.
After publishing the service, the Server terminal should be searched in the IOS device.
Pair-setup, pair-verify pairing verification, the server responds according to the received information, and the format is similar to RTSP
Fp-setup (first and second), related to Fairplay.
The first setup phase will receive a large string of data, which is generated according to the plist format. The corresponding methods can be used to obtain ekey and eiv information for subsequent decryption.
The second setup phase obtains the type, determines the video data or audio data by type, notifies the receiving end to establish a transmission channel ready for the transmission of audio and video data, and the encrypted screen image data is sent to the receiving through the designated port (generally 7100). end.
After receiving the transmitted data, the receiving end decrypts the decrypted data, and the decrypted data can be played.
There may also be GET_PARAMETER, SET_PARAMETER to adjust the volume and other information.
Transmission is transmitted using TCP protocol, audio is AAC, and video data is H264.
There are currently two main methods for decrypting the part:
1. Get it from apptv or macOS.
2. Obtained from the existing screenable products available on the market.