Current section

Files

Jump to
exmobiledevice lib ex_mobile_device image_mounter manifest_provider.ex
Raw

lib/ex_mobile_device/image_mounter/manifest_provider.ex

defmodule ExMobileDevice.ImageMounter.PersonalizedManifestProvider do
@moduledoc """
A behaviour for providing personalized device manifest data for DDI mounting operations.
## Usage
To implement this behaviour, create a module that implements the following callbacks:
`fetch_manifest/3` and `get_manifest_from_device/2`.
```elixir
defmodule MyManifestProvider do
@behaviour ExMobileDevice.ImageMounter.PersonalizedManifestProvider
def fetch_manifest(udid, image_name, build_manifest) do
# Implementation here
end
def get_manifest_from_device(udid, signature) do
# Implementation here
end
end
```
"""
@doc """
Fetches a signed DDI manifest for the device and image combination
"""
@callback fetch_manifest(
udid :: String.t(),
image_name :: String.t(),
build_manifest :: binary()
) :: {:ok, manifest :: binary()} | {:error, any()}
@doc """
Queries a device for a signed personalization manifest
"""
@callback get_manifest_from_device(udid :: String.t(), signature :: binary()) ::
{:ok, manifest :: binary()} | {:error, any()}
end