public async Task Connect_Works_Async() { // Sample traffic from https://www.theiphonewiki.com/wiki/Usbmux ("lockdownd protocol") var muxer = new Mock <MuxerClient>(); var device = new MuxerDevice(); using (var traceStream = new TraceStream("Lockdown/connect-device.bin", "Lockdown/connect-host.bin")) { muxer .Setup(m => m.ConnectAsync(device, 0xF27E, default)) .ReturnsAsync(traceStream); var factory = new LockdownClientFactory(muxer.Object, new DeviceContext() { Device = device }, NullLogger <LockdownClient> .Instance); await using (await factory.CreateAsync(default))
/// <summary> /// Initializes a new instance of the <see cref="SpringBoardClientFactory"/> class. /// </summary> /// <param name="muxer"> /// The <see cref="MuxerClient"/> which represents the connection to the iOS USB Multiplexor. /// </param> /// <param name="context"> /// The <see cref="DeviceContext"/> which contains information about the device with which /// we are interacting. /// </param> /// <param name="propertyListProtocolFactory"> /// A <see cref="PropertyListProtocolFactory"/> which can be used to create new instances of the <see cref="PropertyListProtocol"/> class. /// </param> /// <param name="lockdownClientFactory"> /// A <see cref="LockdownClientFactory"/> which can create a connection to lockdown. /// </param> /// <param name="logger"> /// A <see cref="ILogger"/> which can be used when logging. /// </param> public SpringBoardClientFactory(MuxerClient muxer, DeviceContext context, PropertyListProtocolFactory propertyListProtocolFactory, LockdownClientFactory lockdownClientFactory, ILogger <SpringBoardClient> logger) : base(muxer, context, propertyListProtocolFactory, lockdownClientFactory, logger) { }