Skip to content

mveril/MobileDeviceSharp

Repository files navigation

MobileDeviceSharp

A C# object-oriented wrapper around Libimobiledevice

Libimobiledevice is a cool project. It is useful to interact programmatically with Apple devices exactly like iTunes do. It's a C Open source library. An Open source .NET bindings library exits on NuGet, and it's called imobiledevice-net, but this library is just a binding and remains a 100 % functional programming API. So it does not respect C# language standards. The objective of this project is to provide a fully object-oriented API for C# and .NET developers to interact with Apple device. It uses Libimobiledevice under the hood but try to use all the C# languages features to provide an easy-to-use API. Somme examples:

  • The LockdownSession.ParAsync API can be used to pair a device asynchronously.
  • The PlistDictionary implement IDictionary<String,PlistNode> interface.
  • The AFCStream class allow interacting with Apple device files using the Apple file conduit protocol with the standard .NET Stream API.
  • With all supported framework the overloads of InstallationProxySession.GetApplications() return an IEnumerable<Application> and on .NET Core 3 or greater InstallationProxySession.GetApplicationsAsync() return an IAsyncEnumerable<Application>

Main API and associated libraries

We have created some libraries, indeed we wanted to separate the project into different libraries as much as possible (in the future we could try to make other separations if possible). In this part we will describe the content of the already implemented APIs (when it's possible a link with it's main associated native Libimobiledevice library is provided)

MobileDeviceSharp library

MobileDeviceSharp

This namespace contains the core APIs.

MobileDeviceSharp.Usbmuxd

  • UsbmuxdService

MobileDeviceSharp.ProperyList

  • PlistDocument
  • PlistDictionary
  • PlistArray

MobileDeviceSharp.DiagnosticsRelay

Provide .NET API for diagnostics_relay.h

  • DiagnosticRelaySession

MobileDeviceSharp.NotificationProxy

Provide .NET API for notification_proxy.h

  • NotificationProxySession

MobileDeviceSharp.AFC library

MobileDeviceSharp.AFC

Provide .NET API for afc.h

  • AFCSession
  • AFC2Session
  • AFCFile
  • AFCDirectory
  • AFCStream

MobileDeviceSharp.InstallationProxy library

MobileDeviceSharp.InstallationProxy

Provide .NET API for installation_proxy.h

  • InstallationProxySession
  • Application
  • CapabilityMatcher
  • InstallationProxyArchiveOptions
  • InstallationProxyInstallOptions

MobileDeviceSharp.HouseArrest library

MobileDeviceSharp.HouseArrest

Provide .NET API for house_arrest.h

  • HouseArrestSession
  • AFCHouseArrestSession

MobileDeviceSharp.SpringBoardServices library

MobileDeviceSharp.SpringBoardServices

Provide .NET API for sbservices.h

  • SpringBoardServiceSession

We also have MobileDeviceSharp.SourceGenerator and MobileDeviceSharp.CompilerServices to make programming these libraries easier using Source Generators.

Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Contributing

We welcome contributions to the MobileDeviceSharp project. Please check out the CONTRIBUTING.md file for more information on how to get started.

Please note that currently, this project does not have any unit tests. So, we ask that contributors take extra care to ensure the stability and reliability of the code when making changes. Thank you!

Conclusion

We are aware that there is still a lot of work to implement all the APIs proposed in the Libimobiledevice library in a modern C# compliant way, but it is a good starting point, and we hope that this project can grow over time to make it easy to develop software that connects with Apple Devices in .NET.