├── .editorconfig ├── .gitattributes ├── .github └── ISSUE_TEMPLATE │ ├── api-documentation-issue-or-improvement.md │ ├── api-proposal.md │ ├── bug-report.md │ ├── feature-request.md │ └── service-implementation-request.md ├── .gitignore ├── .vscode ├── launch.json └── tasks.json ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── MobileDeviceSharp.sln ├── README.md ├── docs ├── .gitignore ├── Docs.csproj ├── api │ ├── .gitignore │ └── index.md ├── articles │ ├── intro.md │ └── toc.yml ├── docfx.json ├── index.md └── toc.yml ├── runtimes ├── osx-x64 │ └── native │ │ ├── idevice_id │ │ ├── idevicebackup │ │ ├── idevicebackup2 │ │ ├── idevicecrashreport │ │ ├── idevicedate │ │ ├── idevicedebug │ │ ├── idevicedebugserverproxy │ │ ├── idevicediagnostics │ │ ├── ideviceenterrecovery │ │ ├── ideviceimagemounter │ │ ├── ideviceinfo │ │ ├── ideviceinstaller │ │ ├── idevicename │ │ ├── idevicenotificationproxy │ │ ├── idevicepair │ │ ├── ideviceprovision │ │ ├── idevicerestore │ │ ├── idevicescreenshot │ │ ├── idevicesetlocation │ │ ├── idevicesyslog │ │ ├── inetcat │ │ ├── ios_webkit_debug_proxy │ │ ├── iproxy │ │ ├── irecovery │ │ ├── libideviceactivation-1.0.2.dylib │ │ ├── libideviceactivation-1.0.dylib │ │ ├── libimobiledevice-1.0.6.dylib │ │ ├── libimobiledevice-1.0.dylib │ │ ├── libimobiledevice-net-lighthouse.dylib │ │ ├── libios_webkit_debug_proxy.0.dylib │ │ ├── libios_webkit_debug_proxy.dylib │ │ ├── libirecovery-1.0.3.dylib │ │ ├── libirecovery-1.0.dylib │ │ ├── libplist++-2.0.3.dylib │ │ ├── libplist++-2.0.dylib │ │ ├── libplist-2.0.3.dylib │ │ ├── libplist-2.0.dylib │ │ ├── libusbmuxd.6.dylib │ │ ├── libusbmuxd.dylib │ │ ├── plistutil │ │ └── usbmuxd ├── win-x64 │ └── native │ │ ├── bz2.dll │ │ ├── getopt.dll │ │ ├── iconv-2.dll │ │ ├── idevice_id.exe │ │ ├── ideviceactivation.dll │ │ ├── ideviceactivation.exe │ │ ├── idevicebackup.exe │ │ ├── idevicebackup2.exe │ │ ├── idevicecrashreport.exe │ │ ├── idevicedate.exe │ │ ├── idevicedebug.exe │ │ ├── idevicedebugserverproxy.exe │ │ ├── idevicediagnostics.exe │ │ ├── ideviceenterrecovery.exe │ │ ├── ideviceimagemounter.exe │ │ ├── ideviceinfo.exe │ │ ├── ideviceinstaller.exe │ │ ├── idevicename.exe │ │ ├── idevicenotificationproxy.exe │ │ ├── idevicepair.exe │ │ ├── ideviceprovision.exe │ │ ├── idevicerestore.exe │ │ ├── idevicescreenshot.exe │ │ ├── idevicesyslog.exe │ │ ├── imobiledevice-net-lighthouse.dll │ │ ├── imobiledevice.dll │ │ ├── ios_webkit_debug_proxy.exe │ │ ├── iproxy.exe │ │ ├── irecovery.dll │ │ ├── irecovery.exe │ │ ├── libcrypto-1_1-x64.dll │ │ ├── libcurl.dll │ │ ├── libssl-1_1-x64.dll │ │ ├── libusb-1.0.dll │ │ ├── libusb0.dll │ │ ├── libxml2.dll │ │ ├── lzma.dll │ │ ├── pcre.dll │ │ ├── pcreposix.dll │ │ ├── plist.dll │ │ ├── plist_cmp.exe │ │ ├── plist_test.exe │ │ ├── plistutil.exe │ │ ├── pthreadVC3.dll │ │ ├── readline.dll │ │ ├── usbmuxd.dll │ │ ├── usbmuxd.exe │ │ ├── vcruntime140.dll │ │ ├── zip.dll │ │ └── zlib1.dll └── win-x86 │ └── native │ ├── bz2.dll │ ├── getopt.dll │ ├── iconv-2.dll │ ├── idevice_id.exe │ ├── ideviceactivation.dll │ ├── idevicebackup.exe │ ├── idevicebackup2.exe │ ├── idevicecrashreport.exe │ ├── idevicedate.exe │ ├── idevicedebug.exe │ ├── idevicedebugserverproxy.exe │ ├── idevicediagnostics.exe │ ├── ideviceenterrecovery.exe │ ├── ideviceimagemounter.exe │ ├── ideviceinfo.exe │ ├── ideviceinstaller.exe │ ├── idevicename.exe │ ├── idevicenotificationproxy.exe │ ├── idevicepair.exe │ ├── ideviceprovision.exe │ ├── idevicerestore.exe │ ├── idevicescreenshot.exe │ ├── idevicesyslog.exe │ ├── imobiledevice-net-lighthouse.dll │ ├── imobiledevice.dll │ ├── ios_webkit_debug_proxy.exe │ ├── iproxy.exe │ ├── irecovery.dll │ ├── irecovery.exe │ ├── libcrypto-1_1.dll │ ├── libcurl.dll │ ├── libssl-1_1.dll │ ├── libusb-1.0.dll │ ├── libusb0.dll │ ├── libxml2.dll │ ├── lzma.dll │ ├── pcre.dll │ ├── pcreposix.dll │ ├── plist.dll │ ├── plist_cmp.exe │ ├── plist_test.exe │ ├── plistutil.exe │ ├── pthreadVC3.dll │ ├── readline.dll │ ├── usbmuxd.dll │ ├── usbmuxd.exe │ ├── vcruntime140.dll │ ├── zip.dll │ └── zlib1.dll ├── samples └── SampleConsole │ ├── Program.cs │ └── SampleConsole.csproj └── src ├── Directory.Build.props ├── MobileDeviceSharp.AFC ├── AFC2Session.cs ├── AFCDirectory.cs ├── AFCDriveInfo.cs ├── AFCException.cs ├── AFCFile.cs ├── AFCItem.cs ├── AFCItemType.cs ├── AFCSession.cs ├── AFCSessionBase.cs ├── AFCStream.cs ├── AFCSymbolicLink.cs ├── MobileDeviceSharp.AFC.csproj └── Native │ ├── AFC.cs │ ├── AFCDictionaryMarshaler.cs │ ├── AFCError.cs │ ├── AFCLinkType.cs │ ├── AFCLockOp.cs │ ├── AfcFileMode.cs │ └── SeekWhence.cs ├── MobileDeviceSharp.CompilerServices ├── GenerateHandleAttribute.cs ├── MobileDeviceSharp.CompilerServices.csproj └── NotificationProxyEventName.cs ├── MobileDeviceSharp.HouseArrest ├── AFCHouseArrestSession.cs ├── HouseArrestLocations.cs ├── HouseArrestSession.cs ├── MobileDeviceSharp.HouseArrest.csproj └── Native │ ├── HouseArrest.cs │ └── HouseArrestError.cs ├── MobileDeviceSharp.InstallationProxy ├── Application.cs ├── ApplicationType.cs ├── ArchiveType.cs ├── CapabilityMatcher.cs ├── EnumerateOperationStatusContext.cs ├── InstallationProxyArchiveOptions.cs ├── InstallationProxyInstallOptions.cs ├── InstallationProxyOperationException.cs ├── InstallationProxyOperationOptions.cs ├── InstallationProxySession.cs ├── InstallationProxyStatusCallBack.cs ├── InstalltionProxyLookupOptions.cs ├── MobileDeviceSharp.InstallationProxy.csproj ├── Native │ ├── InstallationProxy.cs │ └── InstallationProxyError.cs ├── OperationStatusContext.cs └── TaskWithProgressOperationStatusContext.cs ├── MobileDeviceSharp.SourceGenerator ├── DefaultServiceSessionGenerator.cs ├── ExceptionGenerator.cs ├── HandleGenerator.cs ├── MobileDeviceSharp.SourceGenerator.csproj ├── NotificationProxyEventMappingGenerator.cs ├── PartialFactory.cs ├── Properties │ └── launchSettings.json └── npEventSyntaxBuilder.cs ├── MobileDeviceSharp.SpringBoardServices ├── ApplicationExtension.cs ├── MobileDeviceSharp.SpringBoardServices.csproj ├── Native │ ├── SpringBoardServicesError.cs │ └── SpringBoardServicies.cs ├── SpringBoardDissposition.cs ├── SpringBoardServicesSession.cs └── UIInterfaceOrientation.cs └── MobileDeviceSharp ├── Battery.cs ├── BuildNumber.cs ├── DeviceClass.cs ├── DeviceEventArgs.cs ├── DeviceWatcher.cs ├── DiagnosticsRelay ├── DiagnosticsRelaySessionBase.cs ├── IDeviceExtention.cs └── Native │ ├── DiagnosticsRelay.cs │ ├── DiagnosticsRelayAction.cs │ └── DiagnosticsRelayError.cs ├── ExceptionAttribute.cs ├── ExceptionMessageAttribute.cs ├── ExceptionUtils.cs ├── GenerateHandle.txt ├── IDevice.cs ├── LibraryResolver.cs ├── LockdownDomain.cs ├── LockdownSession.cs ├── MobileDeviceException.cs ├── MobileDeviceSharp.csproj ├── Native ├── ArrayMarshaller.cs ├── ClientNewCallback.cs ├── ClientNewFromParentServiceCallBack.cs ├── CustomMashaler.cs ├── DeviceActivation.cs ├── DictionaryMarshaler.cs ├── HandleWrapperBase.cs ├── IDevice.cs ├── IDeviceConnectionType.cs ├── IDeviceDebugCallBack.cs ├── IDeviceError.cs ├── IDeviceEventCallBack.cs ├── IDeviceEventType.cs ├── IDeviceListExtendedMarshaler.cs ├── IDeviceListMarshaler.cs ├── IOSSafeHandle.cs ├── Lockdown.cs ├── LockdownError.cs ├── StartServiceCallback.cs ├── UTF8DecomposedMarshaler.cs ├── UTF8Marshaler.cs └── lockdownd_client_private.cs ├── NotificationProxy ├── InsecureNotificationProxySession.cs ├── Native │ ├── NotificationProxy.cs │ ├── NotificationProxyError.cs │ ├── NotificationProxyEvents.cs │ └── NotificationProxyNotifyCallBack.cs ├── NotificationProxyEvent.cs ├── NotificationProxyEventArgs.cs ├── NotificationProxySessionBase.Events.cs ├── NotificationProxySessionBase.cs └── NotificationProxySessionBase.tasks.cs ├── OSVersion.cs ├── PairingState.cs ├── PropertyList ├── Native │ ├── Plist.cs │ ├── PlistHandle.cs │ ├── PlistHandleNotOwnedMarshaller.cs │ └── PlistType.cs ├── PlistArray.cs ├── PlistArrayEnumerator.cs ├── PlistBoolean.cs ├── PlistContainer.cs ├── PlistData.cs ├── PlistDate.cs ├── PlistDateValue.cs ├── PlistDictionary.cs ├── PlistDictionaryEnumerator.cs ├── PlistDictionaryKeysCollection.cs ├── PlistDictionaryValuesCollection.cs ├── PlistDocument.cs ├── PlistDocumentFormats.cs ├── PlistInteger.cs ├── PlistKey.cs ├── PlistNode.cs ├── PlistReal.cs ├── PlistString.cs ├── PlistUID.cs └── PlistValueNode.cs ├── ServiceSessionBase.cs ├── UIDeviceBatteryState.cs └── Usbmuxd ├── Native ├── Usbmuxd.cs ├── UsbmuxdDeviceInfo.cs ├── UsbmuxdEvent.cs ├── UsbmuxdEventCallBack.cs ├── UsbmuxdEventType.cs ├── UsbmuxdSocketType.cs └── iDeviceLookupOptions.cs └── UsbmuxdService.cs /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | ############################################################################### 6 | # Set default behavior for command prompt diff. 7 | # 8 | # This is need for earlier builds of msysgit that does not have it on by 9 | # default for csharp files. 10 | # Note: This is only used by command line 11 | ############################################################################### 12 | #*.cs diff=csharp 13 | ############################################################################### 14 | # Set the merge driver for project and solution files 15 | # 16 | # Merging from the command prompt will add diff markers to the files if there 17 | # are conflicts (Merging from VS is not affected by the settings below, in VS 18 | # the diff markers are never inserted). Diff markers may cause the following 19 | # file extensions to fail to load in VS. An alternative would be to treat 20 | # these files as binary and thus will always conflict and require user 21 | # intervention with every merge. To do so, just uncomment the entries below 22 | ############################################################################### 23 | #*.sln merge=binary 24 | #*.csproj merge=binary 25 | #*.vbproj merge=binary 26 | #*.vcxproj merge=binary 27 | #*.vcproj merge=binary 28 | #*.dbproj merge=binary 29 | #*.fsproj merge=binary 30 | #*.lsproj merge=binary 31 | #*.wixproj merge=binary 32 | #*.modelproj merge=binary 33 | #*.sqlproj merge=binary 34 | #*.wwaproj merge=binary 35 | ############################################################################### 36 | # behavior for image files 37 | # 38 | # image files are treated as binary by default. 39 | ############################################################################### 40 | #*.jpg binary 41 | #*.png binary 42 | #*.gif binary 43 | ############################################################################### 44 | # diff behavior for common document formats 45 | # 46 | # Convert binary document formats to text before diffing them. This feature 47 | # is only available from the command line. Turn it on by uncommenting the 48 | # entries below. 49 | ############################################################################### 50 | #*.doc diff=astextplain 51 | #*.DOC diff=astextplain 52 | #*.docx diff=astextplain 53 | #*.DOCX diff=astextplain 54 | #*.dot diff=astextplain 55 | #*.DOT diff=astextplain 56 | #*.pdf diff=astextplain 57 | #*.PDF diff=astextplain 58 | #*.rtf diff=astextplain 59 | #*.RTF diff=astextplain 60 | *.dll filter=lfs diff=lfs merge=lfs -text 61 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/api-documentation-issue-or-improvement.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "API Documentation issue or improvement \U0001F4DA" 3 | about: Report issues in our API documentation comments. 4 | title: "[Documentation]: " 5 | labels: documentation 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## Problem with API Documentation 11 | 12 | [Describe the issue or problem with the API documentation, such as missing information, outdated content, or incorrect explanations.] 13 | 14 | ## Suggested Changes 15 | 16 | [Describe the changes or additions you would like to see in the API documentation to resolve the issue.] 17 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/api-proposal.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "API Proposal \U0001F4A1" 3 | about: Suggest new API. 4 | title: "[API Proposal]:" 5 | labels: API, enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## Description 11 | 12 | Briefly describe what you want to accomplish with this API and why it is necessary. 13 | 14 | ## API Details 15 | 16 | Include detailed information on the features you would like to include in the API, such as input and output methods, required parameters, etc. 17 | 18 | ## Proposed API surface (provide sample code, optional): 19 | Use C# code to show wanted API (you can also suggest to implement specific base class or interface from the [.NET base class library](https://learn.microsoft.com/dotnet/standard/framework-libraries#base-class-library)). 20 | 21 | ## Proposed API implementation (provide sample code, optional): 22 | 23 | ## Use Cases 24 | 25 | Provide concrete examples showing how developers could use this API in their own code. 26 | 27 | ## Concerns 28 | 29 | Indicate which teams or projects would be directly affected by this API proposal and how. 30 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "Bug report \U0001F41B" 3 | about: Create a report to help us improve. 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## Describe the bug 11 | A clear and concise description of what the bug is. 12 | 13 | ## To Reproduce 14 | Steps to reproduce the behavior (Please provide sample code): 15 | ## Expected behavior 16 | A clear and concise description of what you expected to happen. 17 | 18 | ## Screenshots 19 | If applicable, add screenshots to help explain your problem. 20 | ## Device description. 21 | ### Desktop (please complete the following information): 22 | - OS: [e.g. Windows 11] 23 | - Version [e.g. 10.0.22621] 24 | 25 | ### Apple device (please complete the following information): 26 | - Device: [e.g. iPhone 6] 27 | - OS: [e.g. iOS 8.1] 28 | - Build number [e.g. 12B410] 29 | - Is jailbroken [e.g. false] 30 | 31 | ## Dependencies. 32 | - .NET target version [e.g. .NET Framework 4.7.1/.NET 5] 33 | - iTunes version (for Windows only) [e.g. 12.12.7.1 (Microsoft store) 34 | - libimobiledevice version (if it's not the version provided on the runtimes folder): 35 | - libplist version (if it's not the version provided on the runtimes folder):: [e.g. 2.2.0] 36 | - usbmuxd version (if it's not the version provided on the runtimes folder):: [e.g. 1.1.1] 37 | 38 | ## Additional context 39 | Add any other context about the problem here. 40 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "Feature request \U0001F680" 3 | about: Suggest an idea for this project. 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## Is your feature request related to a problem? Please describe. 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | ## Describe the solution you'd like 14 | A clear and concise description of what you want to happen. 15 | 16 | ## Describe alternatives you've considered 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | ## Additional context 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/service-implementation-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "Service implementation request \U0001F4F1" 3 | about: Request to implement C# API surface for a new libimobiledevice service. 4 | title: "[New service]: Service name" 5 | labels: enhancement, New service 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## Is your service implementation request related to a problem? Please describe. 11 | 12 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 13 | 14 | ## Describe the Service you want to use. 15 | 16 | A clear and concise description of the service you want to use. 17 | 18 | ## Service url and name (from [libimiobiledevice documentation](https://docs.libimobiledevice.org/libimobiledevice/latest/files.html)) 19 | 20 | Example [House Arrest](https://docs.libimobiledevice.org/libimobiledevice/latest/house__arrest_8h.html) 21 | 22 | ## Proposed API surface (provide sample code, optional): 23 | 24 | Use C# code to show wanted API (you can also suggest to implement specific base class or interface from the [.NET base class library](https://learn.microsoft.com/dotnet/standard/framework-libraries#base-class-library)). 25 | 26 | ## Proposed API implementation (provide sample code, optional): 27 | 28 | ## Additional context 29 | 30 | Add any other context or screenshots about the feature request here. 31 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | // Use IntelliSense to find out which attributes exist for C# debugging 6 | // Use hover for the description of the existing attributes 7 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md 8 | "name": ".NET Core Launch (console)", 9 | "type": "coreclr", 10 | "request": "launch", 11 | "preLaunchTask": "build", 12 | // If you have changed target frameworks, make sure to update the program path. 13 | "program": "${workspaceFolder}/samples/SampleConsole/bin/Debug/net6.0/win-x64/SampleConsole.dll", 14 | "args": [], 15 | "cwd": "${workspaceFolder}/samples/SampleConsole", 16 | // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console 17 | "console": "internalConsole", 18 | "stopAtEntry": false 19 | }, 20 | { 21 | "name": ".NET Core Attach", 22 | "type": "coreclr", 23 | "request": "attach" 24 | } 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "build", 6 | "command": "dotnet", 7 | "type": "process", 8 | "args": [ 9 | "build", 10 | "${workspaceFolder}/samples/SampleConsole/SampleConsole.csproj", 11 | "/property:GenerateFullPaths=true", 12 | "/consoleloggerparameters:NoSummary" 13 | ], 14 | "problemMatcher": "$msCompile" 15 | }, 16 | { 17 | "label": "publish", 18 | "command": "dotnet", 19 | "type": "process", 20 | "args": [ 21 | "publish", 22 | "${workspaceFolder}/samples/SampleConsole/SampleConsole.csproj", 23 | "/property:GenerateFullPaths=true", 24 | "/consoleloggerparameters:NoSummary" 25 | ], 26 | "problemMatcher": "$msCompile" 27 | }, 28 | { 29 | "label": "watch", 30 | "command": "dotnet", 31 | "type": "process", 32 | "args": [ 33 | "watch", 34 | "run", 35 | "--project", 36 | "${workspaceFolder}/samples/SampleConsole/SampleConsole.csproj" 37 | ], 38 | "problemMatcher": "$msCompile" 39 | } 40 | ] 41 | } -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of Conduct for MobileDeviceSharp 2 | 3 | The MobileDeviceSharp project is committed to providing a welcoming and inclusive environment for all contributors. We expect all participants, including contributors, maintainers, and users, to abide by the following code of conduct. 4 | 5 | ## Behavior 6 | 7 | - Be respectful and considerate of others. 8 | - Do not engage in any form of harassment or discrimination, including but not limited to: racism, sexism, homophobia, and transphobia. 9 | - Avoid using language or behavior that can be perceived as hostile, threatening, or abusive. 10 | - Respect the privacy of others and do not share confidential information without their consent. 11 | - Do not engage in any form of spamming or promoting commercial products or services. 12 | 13 | ## Reporting Violations 14 | 15 | If you experience or witness any behavior that violates this code of conduct, please report it to the project maintainers. Reports can be made by email, through an issue on the repository, or by any other means. 16 | 17 | ## Consequences 18 | 19 | Violations of this code of conduct may result in temporary or permanent expulsion from the project and its community. The project maintainers will review each case and determine the appropriate course of action. 20 | 21 | ## Contact 22 | 23 | If you have any questions or concerns about this code of conduct, please contact the project maintainers. 24 | 25 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to MobileDeviceSharp 2 | 3 | MobileDeviceSharp is an open-source project and we welcome contributions from everyone. Whether you're fixing a bug, improving existing features or adding new ones, we're always happy to see you. 4 | 5 | ## How to Contribute 6 | 7 | 1. Fork the MobileDeviceSharp repository 8 | 2. Clone the repository to your local machine 9 | 3. Create a new branch with a descriptive name 10 | 4. Make your changes 11 | 5. Test your changes thoroughly 12 | 6. Commit your changes with a clear and concise message 13 | 7. Push your changes to your forked repository 14 | 8. Create a pull request on the original MobileDeviceSharp repository 15 | 16 | ## Code of Conduct 17 | 18 | All contributors to MobileDeviceSharp are expected to follow the project's [Code of Conduct](CODE_OF_CONDUCT.md). 19 | 20 | ## Issues and Bugs 21 | 22 | If you encounter any bugs or issues while using MobileDeviceSharp, please create a new issue in the project's [Issues Tracker](https://github.com/mveril/MobileDeviceSharp/issues). Please include a clear and concise description of the problem, steps to reproduce it and any relevant information to help us resolve it. 23 | 24 | ## Feature Requests 25 | 26 | If you have any ideas for new features or improvements to existing ones, please create a new issue in the project's [Issues Tracker](https://github.com/mveril/MobileDeviceSharp/issues) and tag it as a feature request. Please provide a clear and concise description of the feature and why you think it would be valuable to MobileDeviceSharp. 27 | 28 | ## License 29 | 30 | All contributions to MobileDeviceSharp are subject to the project's [MIT License](LICENSE). 31 | 32 | ## Thank You 33 | 34 | Thank you for considering contributing to MobileDeviceSharp! Your contributions help make this project better for everyone. 35 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Mickaël Véril 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | ############### 2 | # folder # 3 | ############### 4 | /**/DROP/ 5 | /**/TEMP/ 6 | /**/packages/ 7 | /**/bin/ 8 | /**/obj/ 9 | _site 10 | log.txt 11 | -------------------------------------------------------------------------------- /docs/Docs.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | all 10 | runtime; build; native; contentfiles; analyzers; buildtransitive 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/api/.gitignore: -------------------------------------------------------------------------------- 1 | ############### 2 | # temp file # 3 | ############### 4 | *.yml 5 | .manifest 6 | -------------------------------------------------------------------------------- /docs/api/index.md: -------------------------------------------------------------------------------- 1 | # PLACEHOLDER 2 | TODO: Add .NET projects to the *src* folder and run `docfx` to generate **REAL** *API Documentation*! 3 | -------------------------------------------------------------------------------- /docs/articles/intro.md: -------------------------------------------------------------------------------- 1 | # Add your introductions here! 2 | -------------------------------------------------------------------------------- /docs/articles/toc.yml: -------------------------------------------------------------------------------- 1 | - name: Introduction 2 | href: intro.md 3 | -------------------------------------------------------------------------------- /docs/docfx.json: -------------------------------------------------------------------------------- 1 | { 2 | "metadata": [ 3 | { 4 | "src": [ 5 | { 6 | "files": [ 7 | "**.csproj" 8 | ], 9 | "src": "..\\src\\" 10 | } 11 | ], 12 | "dest": "api", 13 | "disableGitFeatures": false, 14 | "disableDefaultFilter": false 15 | } 16 | ], 17 | "build": { 18 | "content": [ 19 | { 20 | "files": [ 21 | "api/**.yml", 22 | "api/index.md" 23 | ] 24 | }, 25 | { 26 | "files": [ 27 | "articles/**.md", 28 | "articles/**/toc.yml", 29 | "toc.yml", 30 | "*.md" 31 | ] 32 | } 33 | ], 34 | "resource": [ 35 | { 36 | "files": [ 37 | "images/**" 38 | ] 39 | } 40 | ], 41 | "overwrite": [ 42 | { 43 | "files": [ 44 | "apidoc/**.md" 45 | ], 46 | "exclude": [ 47 | "obj/**", 48 | "_site/**" 49 | ] 50 | } 51 | ], 52 | "dest": "_site", 53 | "globalMetadataFiles": [], 54 | "fileMetadataFiles": [], 55 | "template": [ 56 | "default" 57 | ], 58 | "postProcessors": [], 59 | "markdownEngineName": "markdig", 60 | "noLangKeyword": false, 61 | "keepFileLink": false, 62 | "cleanupCacheHistory": false, 63 | "disableGitFeatures": false 64 | } 65 | } -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | # This is the **HOMEPAGE**. 2 | Refer to [Markdown](http://daringfireball.net/projects/markdown/) for how to write markdown files. 3 | ## Quick Start Notes: 4 | 1. Add images to the *images* folder if the file is referencing an image. 5 | -------------------------------------------------------------------------------- /docs/toc.yml: -------------------------------------------------------------------------------- 1 | - name: Articles 2 | href: articles/ 3 | - name: Api Documentation 4 | href: api/ 5 | homepage: api/index.md 6 | -------------------------------------------------------------------------------- /runtimes/osx-x64/native/idevice_id: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/idevice_id -------------------------------------------------------------------------------- /runtimes/osx-x64/native/idevicebackup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/idevicebackup -------------------------------------------------------------------------------- /runtimes/osx-x64/native/idevicebackup2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/idevicebackup2 -------------------------------------------------------------------------------- /runtimes/osx-x64/native/idevicecrashreport: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/idevicecrashreport -------------------------------------------------------------------------------- /runtimes/osx-x64/native/idevicedate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/idevicedate -------------------------------------------------------------------------------- /runtimes/osx-x64/native/idevicedebug: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/idevicedebug -------------------------------------------------------------------------------- /runtimes/osx-x64/native/idevicedebugserverproxy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/idevicedebugserverproxy -------------------------------------------------------------------------------- /runtimes/osx-x64/native/idevicediagnostics: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/idevicediagnostics -------------------------------------------------------------------------------- /runtimes/osx-x64/native/ideviceenterrecovery: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/ideviceenterrecovery -------------------------------------------------------------------------------- /runtimes/osx-x64/native/ideviceimagemounter: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/ideviceimagemounter -------------------------------------------------------------------------------- /runtimes/osx-x64/native/ideviceinfo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/ideviceinfo -------------------------------------------------------------------------------- /runtimes/osx-x64/native/ideviceinstaller: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/ideviceinstaller -------------------------------------------------------------------------------- /runtimes/osx-x64/native/idevicename: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/idevicename -------------------------------------------------------------------------------- /runtimes/osx-x64/native/idevicenotificationproxy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/idevicenotificationproxy -------------------------------------------------------------------------------- /runtimes/osx-x64/native/idevicepair: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/idevicepair -------------------------------------------------------------------------------- /runtimes/osx-x64/native/ideviceprovision: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/ideviceprovision -------------------------------------------------------------------------------- /runtimes/osx-x64/native/idevicerestore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/idevicerestore -------------------------------------------------------------------------------- /runtimes/osx-x64/native/idevicescreenshot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/idevicescreenshot -------------------------------------------------------------------------------- /runtimes/osx-x64/native/idevicesetlocation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/idevicesetlocation -------------------------------------------------------------------------------- /runtimes/osx-x64/native/idevicesyslog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/idevicesyslog -------------------------------------------------------------------------------- /runtimes/osx-x64/native/inetcat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/inetcat -------------------------------------------------------------------------------- /runtimes/osx-x64/native/ios_webkit_debug_proxy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/ios_webkit_debug_proxy -------------------------------------------------------------------------------- /runtimes/osx-x64/native/iproxy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/iproxy -------------------------------------------------------------------------------- /runtimes/osx-x64/native/irecovery: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/irecovery -------------------------------------------------------------------------------- /runtimes/osx-x64/native/libideviceactivation-1.0.2.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/libideviceactivation-1.0.2.dylib -------------------------------------------------------------------------------- /runtimes/osx-x64/native/libideviceactivation-1.0.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/libideviceactivation-1.0.dylib -------------------------------------------------------------------------------- /runtimes/osx-x64/native/libimobiledevice-1.0.6.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/libimobiledevice-1.0.6.dylib -------------------------------------------------------------------------------- /runtimes/osx-x64/native/libimobiledevice-1.0.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/libimobiledevice-1.0.dylib -------------------------------------------------------------------------------- /runtimes/osx-x64/native/libimobiledevice-net-lighthouse.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/libimobiledevice-net-lighthouse.dylib -------------------------------------------------------------------------------- /runtimes/osx-x64/native/libios_webkit_debug_proxy.0.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/libios_webkit_debug_proxy.0.dylib -------------------------------------------------------------------------------- /runtimes/osx-x64/native/libios_webkit_debug_proxy.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/libios_webkit_debug_proxy.dylib -------------------------------------------------------------------------------- /runtimes/osx-x64/native/libirecovery-1.0.3.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/libirecovery-1.0.3.dylib -------------------------------------------------------------------------------- /runtimes/osx-x64/native/libirecovery-1.0.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/libirecovery-1.0.dylib -------------------------------------------------------------------------------- /runtimes/osx-x64/native/libplist++-2.0.3.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/libplist++-2.0.3.dylib -------------------------------------------------------------------------------- /runtimes/osx-x64/native/libplist++-2.0.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/libplist++-2.0.dylib -------------------------------------------------------------------------------- /runtimes/osx-x64/native/libplist-2.0.3.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/libplist-2.0.3.dylib -------------------------------------------------------------------------------- /runtimes/osx-x64/native/libplist-2.0.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/libplist-2.0.dylib -------------------------------------------------------------------------------- /runtimes/osx-x64/native/libusbmuxd.6.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/libusbmuxd.6.dylib -------------------------------------------------------------------------------- /runtimes/osx-x64/native/libusbmuxd.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/libusbmuxd.dylib -------------------------------------------------------------------------------- /runtimes/osx-x64/native/plistutil: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/plistutil -------------------------------------------------------------------------------- /runtimes/osx-x64/native/usbmuxd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/osx-x64/native/usbmuxd -------------------------------------------------------------------------------- /runtimes/win-x64/native/bz2.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d1de667597c11ca5760d3baaa758aaf08ccf6fb2b1e5bae2eace7659337af789 3 | size 75264 4 | -------------------------------------------------------------------------------- /runtimes/win-x64/native/getopt.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f36763d439aa23ddf110f1a841acd4b0196ae7228db07089cea0d62629b863bb 3 | size 19968 4 | -------------------------------------------------------------------------------- /runtimes/win-x64/native/iconv-2.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e8a4a09fd639b87927b83d14fe2485a03fe3ecc813c24ee8bdd2b12fa3e425bf 3 | size 1021440 4 | -------------------------------------------------------------------------------- /runtimes/win-x64/native/idevice_id.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x64/native/idevice_id.exe -------------------------------------------------------------------------------- /runtimes/win-x64/native/ideviceactivation.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:775174be149419cf203e243220ae44e0e671277f32d4aaabd39bb261e05aa8f8 3 | size 27648 4 | -------------------------------------------------------------------------------- /runtimes/win-x64/native/ideviceactivation.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x64/native/ideviceactivation.exe -------------------------------------------------------------------------------- /runtimes/win-x64/native/idevicebackup.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x64/native/idevicebackup.exe -------------------------------------------------------------------------------- /runtimes/win-x64/native/idevicebackup2.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x64/native/idevicebackup2.exe -------------------------------------------------------------------------------- /runtimes/win-x64/native/idevicecrashreport.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x64/native/idevicecrashreport.exe -------------------------------------------------------------------------------- /runtimes/win-x64/native/idevicedate.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x64/native/idevicedate.exe -------------------------------------------------------------------------------- /runtimes/win-x64/native/idevicedebug.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x64/native/idevicedebug.exe -------------------------------------------------------------------------------- /runtimes/win-x64/native/idevicedebugserverproxy.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x64/native/idevicedebugserverproxy.exe -------------------------------------------------------------------------------- /runtimes/win-x64/native/idevicediagnostics.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x64/native/idevicediagnostics.exe -------------------------------------------------------------------------------- /runtimes/win-x64/native/ideviceenterrecovery.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x64/native/ideviceenterrecovery.exe -------------------------------------------------------------------------------- /runtimes/win-x64/native/ideviceimagemounter.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x64/native/ideviceimagemounter.exe -------------------------------------------------------------------------------- /runtimes/win-x64/native/ideviceinfo.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x64/native/ideviceinfo.exe -------------------------------------------------------------------------------- /runtimes/win-x64/native/ideviceinstaller.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x64/native/ideviceinstaller.exe -------------------------------------------------------------------------------- /runtimes/win-x64/native/idevicename.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x64/native/idevicename.exe -------------------------------------------------------------------------------- /runtimes/win-x64/native/idevicenotificationproxy.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x64/native/idevicenotificationproxy.exe -------------------------------------------------------------------------------- /runtimes/win-x64/native/idevicepair.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x64/native/idevicepair.exe -------------------------------------------------------------------------------- /runtimes/win-x64/native/ideviceprovision.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x64/native/ideviceprovision.exe -------------------------------------------------------------------------------- /runtimes/win-x64/native/idevicerestore.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x64/native/idevicerestore.exe -------------------------------------------------------------------------------- /runtimes/win-x64/native/idevicescreenshot.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x64/native/idevicescreenshot.exe -------------------------------------------------------------------------------- /runtimes/win-x64/native/idevicesyslog.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x64/native/idevicesyslog.exe -------------------------------------------------------------------------------- /runtimes/win-x64/native/imobiledevice-net-lighthouse.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4a9bce0575c2fc46cf12dc01e3e1eb0cb27dd09e7785b5fdb7572f368c964e83 3 | size 10752 4 | -------------------------------------------------------------------------------- /runtimes/win-x64/native/imobiledevice.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7e4a42c84bc1f8fb5cf23a72090baa5e467d89981226ff6877218aff71200b19 3 | size 184320 4 | -------------------------------------------------------------------------------- /runtimes/win-x64/native/ios_webkit_debug_proxy.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x64/native/ios_webkit_debug_proxy.exe -------------------------------------------------------------------------------- /runtimes/win-x64/native/iproxy.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x64/native/iproxy.exe -------------------------------------------------------------------------------- /runtimes/win-x64/native/irecovery.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:279ad12a64f0add484df98723bfac3e5261fc748f23079ba2fc3753b2af97306 3 | size 47104 4 | -------------------------------------------------------------------------------- /runtimes/win-x64/native/irecovery.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x64/native/irecovery.exe -------------------------------------------------------------------------------- /runtimes/win-x64/native/libcrypto-1_1-x64.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3f1bb0435a1765a98547553f0111c7f0f8fc26ce3e88ec517c0532952a320970 3 | size 3470336 4 | -------------------------------------------------------------------------------- /runtimes/win-x64/native/libcurl.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f20cc3046966f0bae39a1af164f1d8fed1801a31a583450b1adefe3014deeefa 3 | size 488448 4 | -------------------------------------------------------------------------------- /runtimes/win-x64/native/libssl-1_1-x64.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:47933a7710438c748c1d4996952f2da91a2188d5280c6057b760e9be12ad0f0b 3 | size 686592 4 | -------------------------------------------------------------------------------- /runtimes/win-x64/native/libusb-1.0.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:71934c68d8b9f7cee6db0cfe0c5f23e08571b9127dc51dfb07e3ca74200f6ea4 3 | size 166912 4 | -------------------------------------------------------------------------------- /runtimes/win-x64/native/libusb0.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:35dc5f39c7db74e8f769fc75aece2a842ba20962be853a35b40d05a283202fb6 3 | size 85504 4 | -------------------------------------------------------------------------------- /runtimes/win-x64/native/libxml2.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d33968eab7035ab6b4d44306b631958419c2f3fc1db97ae768e5c25b95ba7602 3 | size 1445376 4 | -------------------------------------------------------------------------------- /runtimes/win-x64/native/lzma.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d809f75f16c8ceeb343ccc9398f9da74c02bdab270867f747f2372f048b13c25 3 | size 154624 4 | -------------------------------------------------------------------------------- /runtimes/win-x64/native/pcre.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:39c87232f7512e76feb6e42376db00626e237628d5c88a492d088613478a8e12 3 | size 395264 4 | -------------------------------------------------------------------------------- /runtimes/win-x64/native/pcreposix.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:299ac749bda81aa93985141203f603ac880d3fc9f0d8a84e5597a020c24f5353 3 | size 12800 4 | -------------------------------------------------------------------------------- /runtimes/win-x64/native/plist.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f4921856d858124e6ebddb9c71aaf03182009690d8140c0eb1b54087e4109010 3 | size 64512 4 | -------------------------------------------------------------------------------- /runtimes/win-x64/native/plist_cmp.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x64/native/plist_cmp.exe -------------------------------------------------------------------------------- /runtimes/win-x64/native/plist_test.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x64/native/plist_test.exe -------------------------------------------------------------------------------- /runtimes/win-x64/native/plistutil.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x64/native/plistutil.exe -------------------------------------------------------------------------------- /runtimes/win-x64/native/pthreadVC3.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d3e4e6ca4bd83ca057e874b2c15947b21a90e11600290e61908ef0c73c236712 3 | size 103424 4 | -------------------------------------------------------------------------------- /runtimes/win-x64/native/readline.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8c3fff60ab4ee2458bcc2ed9638985f6af1a99c061cb60daca3e9a781b7b35ad 3 | size 174080 4 | -------------------------------------------------------------------------------- /runtimes/win-x64/native/usbmuxd.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:349a3d0c855aa6592a581d3161ada03a67527738a38e6c5805f5492bec81ff75 3 | size 40448 4 | -------------------------------------------------------------------------------- /runtimes/win-x64/native/usbmuxd.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x64/native/usbmuxd.exe -------------------------------------------------------------------------------- /runtimes/win-x64/native/vcruntime140.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b989172491bcf631322d87d7b812fb5598b8fcdd1e2a30c119f5265080cd13b8 3 | size 87736 4 | -------------------------------------------------------------------------------- /runtimes/win-x64/native/zip.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5d9cf87eb136e5699fef3df425607153b13efa24b726ea982a1a8f80eb124091 3 | size 103424 4 | -------------------------------------------------------------------------------- /runtimes/win-x64/native/zlib1.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b45be7fa62570a92bdc0ab5b965b7e2b703b2551b0ab082b753281b9860dc31f 3 | size 86528 4 | -------------------------------------------------------------------------------- /runtimes/win-x86/native/bz2.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7fefea69d84d28eca58b0e44e5af9a15efcc9aee6e5ce3d312d1619289c5d9fe 3 | size 56320 4 | -------------------------------------------------------------------------------- /runtimes/win-x86/native/getopt.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a15ab72e2502820c9644f96bd682adc934ed6ade45cf1436374bf68f093c1a26 3 | size 17920 4 | -------------------------------------------------------------------------------- /runtimes/win-x86/native/iconv-2.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0c1189cf62499d735e5e18b5fddf266c1db96e33f6049dee1730bcb6ced89fd4 3 | size 999936 4 | -------------------------------------------------------------------------------- /runtimes/win-x86/native/idevice_id.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x86/native/idevice_id.exe -------------------------------------------------------------------------------- /runtimes/win-x86/native/ideviceactivation.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:341c77ca3affcbb388554ba7ff121e3b116558a1cfda57421689cd250e9267e0 3 | size 22528 4 | -------------------------------------------------------------------------------- /runtimes/win-x86/native/idevicebackup.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x86/native/idevicebackup.exe -------------------------------------------------------------------------------- /runtimes/win-x86/native/idevicebackup2.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x86/native/idevicebackup2.exe -------------------------------------------------------------------------------- /runtimes/win-x86/native/idevicecrashreport.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x86/native/idevicecrashreport.exe -------------------------------------------------------------------------------- /runtimes/win-x86/native/idevicedate.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x86/native/idevicedate.exe -------------------------------------------------------------------------------- /runtimes/win-x86/native/idevicedebug.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x86/native/idevicedebug.exe -------------------------------------------------------------------------------- /runtimes/win-x86/native/idevicedebugserverproxy.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x86/native/idevicedebugserverproxy.exe -------------------------------------------------------------------------------- /runtimes/win-x86/native/idevicediagnostics.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x86/native/idevicediagnostics.exe -------------------------------------------------------------------------------- /runtimes/win-x86/native/ideviceenterrecovery.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x86/native/ideviceenterrecovery.exe -------------------------------------------------------------------------------- /runtimes/win-x86/native/ideviceimagemounter.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x86/native/ideviceimagemounter.exe -------------------------------------------------------------------------------- /runtimes/win-x86/native/ideviceinfo.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x86/native/ideviceinfo.exe -------------------------------------------------------------------------------- /runtimes/win-x86/native/ideviceinstaller.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x86/native/ideviceinstaller.exe -------------------------------------------------------------------------------- /runtimes/win-x86/native/idevicename.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x86/native/idevicename.exe -------------------------------------------------------------------------------- /runtimes/win-x86/native/idevicenotificationproxy.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x86/native/idevicenotificationproxy.exe -------------------------------------------------------------------------------- /runtimes/win-x86/native/idevicepair.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x86/native/idevicepair.exe -------------------------------------------------------------------------------- /runtimes/win-x86/native/ideviceprovision.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x86/native/ideviceprovision.exe -------------------------------------------------------------------------------- /runtimes/win-x86/native/idevicerestore.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x86/native/idevicerestore.exe -------------------------------------------------------------------------------- /runtimes/win-x86/native/idevicescreenshot.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x86/native/idevicescreenshot.exe -------------------------------------------------------------------------------- /runtimes/win-x86/native/idevicesyslog.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x86/native/idevicesyslog.exe -------------------------------------------------------------------------------- /runtimes/win-x86/native/imobiledevice-net-lighthouse.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:52c513b1180372cb94b9b23390494e296d7e6719f527918b0bc06332ff1c48c9 3 | size 9216 4 | -------------------------------------------------------------------------------- /runtimes/win-x86/native/imobiledevice.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8bba1bd689b6e20cf11abcfa66ba37d5ffb5a328ed03c54da7055800611184c3 3 | size 152576 4 | -------------------------------------------------------------------------------- /runtimes/win-x86/native/ios_webkit_debug_proxy.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x86/native/ios_webkit_debug_proxy.exe -------------------------------------------------------------------------------- /runtimes/win-x86/native/iproxy.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x86/native/iproxy.exe -------------------------------------------------------------------------------- /runtimes/win-x86/native/irecovery.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:2abcadd4b08b563e0f4f1bf274784a60c8a456aec1275ccd5807adaa4bf5d405 3 | size 40448 4 | -------------------------------------------------------------------------------- /runtimes/win-x86/native/irecovery.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x86/native/irecovery.exe -------------------------------------------------------------------------------- /runtimes/win-x86/native/libcrypto-1_1.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a76227f3430e6cd1d610e8ef394521afef74aa4f0a387bdd3a5e906f4b3ac312 3 | size 2577920 4 | -------------------------------------------------------------------------------- /runtimes/win-x86/native/libcurl.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:9bf35f98a33eebd65ed6b58847274d900c5bdcb8f18feac915e993bb937e0fdb 3 | size 432640 4 | -------------------------------------------------------------------------------- /runtimes/win-x86/native/libssl-1_1.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f75f60fbe4e21d34b117605968d8c56c35e2c0829bca18c3cab5e4333cd803ae 3 | size 535040 4 | -------------------------------------------------------------------------------- /runtimes/win-x86/native/libusb-1.0.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:11af37a3b4dbe19344a5b7ddb9d8761a7d78690a9ac2984f84570155efd67410 3 | size 135680 4 | -------------------------------------------------------------------------------- /runtimes/win-x86/native/libusb0.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:80a7085fbe9d3bf89d2f71595a518dacf867464af4a09fbd93e3dff27b682cd1 3 | size 64000 4 | -------------------------------------------------------------------------------- /runtimes/win-x86/native/libxml2.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:abc689ee3107e8c80a698e0a1b2040356f457a42302c2d69dc53a1561db549b5 3 | size 1118720 4 | -------------------------------------------------------------------------------- /runtimes/win-x86/native/lzma.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7a9869d2b30db918096e35755f55c50830e172f6f29ed70f45d1b4aaeb0f070b 3 | size 132096 4 | -------------------------------------------------------------------------------- /runtimes/win-x86/native/pcre.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:28e2f36749b8103660fa876f7a0257263332f573cd65e1505e83de16f3a547ef 3 | size 350208 4 | -------------------------------------------------------------------------------- /runtimes/win-x86/native/pcreposix.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:20a9acfba79f9d3cd81fb99d017e5da8bad9be7801cebf414f5a4ad47044253c 3 | size 10752 4 | -------------------------------------------------------------------------------- /runtimes/win-x86/native/plist.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4c77947052d01b0bfef833cc229c9a7d471051b57bf7e6057ff0b399e3bc8569 3 | size 56832 4 | -------------------------------------------------------------------------------- /runtimes/win-x86/native/plist_cmp.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x86/native/plist_cmp.exe -------------------------------------------------------------------------------- /runtimes/win-x86/native/plist_test.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x86/native/plist_test.exe -------------------------------------------------------------------------------- /runtimes/win-x86/native/plistutil.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x86/native/plistutil.exe -------------------------------------------------------------------------------- /runtimes/win-x86/native/pthreadVC3.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:54f5f2729670242243696987501f3009d636cdb5b60860da73eec6a14763aaa7 3 | size 67584 4 | -------------------------------------------------------------------------------- /runtimes/win-x86/native/readline.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:9a93da2a63de104f322fd38e01c2ebb5f54e2041a1010d284da4ed70da278981 3 | size 140288 4 | -------------------------------------------------------------------------------- /runtimes/win-x86/native/usbmuxd.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1497e23c43a41812f8527932ae4aca03f1c51ebe5e2f7f3927ac1c3bc2b0fe5a 3 | size 32768 4 | -------------------------------------------------------------------------------- /runtimes/win-x86/native/usbmuxd.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mveril/MobileDeviceSharp/1addd550a6468d783f88c17a7c07958f05dfc954/runtimes/win-x86/native/usbmuxd.exe -------------------------------------------------------------------------------- /runtimes/win-x86/native/vcruntime140.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:13b557ef624cb534d6ac084f2501b7d5cdeefdf6fedf74b92e6b4eba52176843 3 | size 84304 4 | -------------------------------------------------------------------------------- /runtimes/win-x86/native/zip.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b17688c1ca9ee770b55f70a971fbfd0c99100703291de062762c1b69cbd83975 3 | size 90624 4 | -------------------------------------------------------------------------------- /runtimes/win-x86/native/zlib1.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:66c7ef7b1afd4ad2c8851f03679eec732ba203cd9dfafd51155e87729f1427fd 3 | size 74752 4 | -------------------------------------------------------------------------------- /samples/SampleConsole/SampleConsole.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp2.0;netcoreapp2.1;netcoreapp3.0;netcoreapp3.1;net5.0;net6.0 6 | win-x64 7 | true 8 | 9 9 | 10 | 11 | 12 | 13 | Always 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 4 | enable 5 | enable 6 | true 7 | 8 | 9 | 10 | $(NoWarn);nullable 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.AFC/AFC2Session.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace MobileDeviceSharp.AFC 6 | { 7 | /// 8 | /// Represent an Apple File Conduit 2 session used to get access to the whole filesystem of a jailbroken apple device. 9 | /// 10 | public sealed class AFC2Session : AFCSessionBase 11 | { 12 | private const string AFC2_SERVICE_ID = "com.apple.afc2"; 13 | 14 | /// 15 | /// Create an 16 | /// 17 | /// 18 | public AFC2Session(IDevice device) : base(device, AFC2_SERVICE_ID) { } 19 | 20 | /// 21 | public override string RootPath => "/"; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.AFC/AFCDriveInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using static MobileDeviceSharp.AFC.Native.AFC; 5 | 6 | namespace MobileDeviceSharp.AFC 7 | { 8 | /// 9 | /// Represent information for the device drive accessible from the Apple File Conduit API. 10 | /// 11 | public class AFCDriveInfo 12 | { 13 | /// 14 | /// Initialize a new instance of a from the specified . 15 | /// 16 | /// 17 | internal AFCDriveInfo(AFCSessionBase session) 18 | { 19 | Session = session; 20 | } 21 | 22 | private string GetInfo(string key) 23 | { 24 | afc_get_device_info_key(Session.Handle, key, out var value); 25 | return value; 26 | } 27 | 28 | /// 29 | /// Get the session used to create this . 30 | /// 31 | public AFCSessionBase Session { get; } 32 | 33 | /// 34 | /// Get the amont of free space on the device. 35 | /// 36 | public long FreeSpace => long.Parse(GetInfo("FSFreeBytes")); 37 | 38 | /// 39 | /// Get the total space of the drive. 40 | /// 41 | public long TotalSpace => long.Parse(GetInfo("FSTotalBytes")); 42 | 43 | /// 44 | /// Get the block size of the drive. 45 | /// 46 | public int BlockSize => int.Parse(GetInfo("FSBlockSize")); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.AFC/AFCException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Text; 5 | using MobileDeviceSharp.AFC.Native; 6 | 7 | namespace MobileDeviceSharp.AFC 8 | { 9 | public partial class AFCException 10 | { 11 | public Exception ToStandardException(AFCItem item) 12 | { 13 | return ToStandardException(item.ItemType, item.Path); 14 | } 15 | 16 | public Exception ToStandardException(AFCItemType itemType) 17 | { 18 | return ToStandardException(itemType, null); 19 | } 20 | 21 | public Exception ToStandardException(AFCItemType itemType, string? path) 22 | { 23 | var pathString = string.IsNullOrEmpty(path) ? "" : $" : {path}"; 24 | return (AFCError)ErrorCode switch 25 | { 26 | AFCError.ObjectNotFound => new UnauthorizedAccessException($"{itemType.Name} not found{pathString}.", this), 27 | AFCError.ObjectIsDir => new UnauthorizedAccessException($"Object is directory{pathString}.", this), 28 | AFCError.PermDenied => new UnauthorizedAccessException($"Permission denied{pathString}.", this), 29 | AFCError.ObjectExists => new IOException($"{itemType.Name} already exist{pathString}.", this), 30 | AFCError.IoError or AFCError.WriteError or AFCError.ReadError or AFCError.DirNotEmpty or AFCError.NoMem or AFCError.NoResources or AFCError.NoSpaceLeft or AFCError.ObjectExists => new IOException($"IO error{pathString}.", this), 31 | _ => this, 32 | }; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.AFC/AFCItemType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MobileDeviceSharp.AFC 4 | { 5 | /// 6 | /// Represent the type of an AFC item. 7 | /// 8 | public readonly struct AFCItemType : IEquatable 9 | { 10 | /// 11 | /// Represent a regular file. 12 | /// 13 | public static AFCItemType File { get; } = new AFCItemType("S_IFREG"); 14 | 15 | /// 16 | /// Represent a directory. 17 | /// 18 | public static AFCItemType Directory { get; } = new AFCItemType("S_IFDIR"); 19 | 20 | /// 21 | /// Represent a symbolic link. 22 | /// 23 | public static AFCItemType SymbolicLink { get; } = new AFCItemType("S_IFLNK"); 24 | 25 | internal string Name { get; } 26 | 27 | private AFCItemType(string AFCitemType) 28 | { 29 | if (AFCitemType == null) throw new ArgumentNullException(nameof(AFCitemType)); 30 | if (AFCitemType.Length == 0) throw new ArgumentException(nameof(AFCitemType)); 31 | 32 | Name = AFCitemType; 33 | } 34 | 35 | /// 36 | /// Creates a new AFCItemType instance. 37 | /// 38 | /// If you plan to call this method frequently, please consider caching its result. 39 | public static AFCItemType Create(string AFCitemType) 40 | { 41 | return new AFCItemType(AFCitemType); 42 | } 43 | 44 | public bool Equals(AFCItemType other) 45 | { 46 | return Equals(other.Name); 47 | } 48 | 49 | internal bool Equals(string? other) 50 | { 51 | return string.Equals(Name, other, StringComparison.OrdinalIgnoreCase); 52 | } 53 | 54 | public override bool Equals(object? obj) 55 | { 56 | return obj is AFCItemType AFCitemType && Equals(AFCitemType); 57 | } 58 | 59 | public override int GetHashCode() 60 | { 61 | return Name == null ? 0 : Name.GetHashCode(); 62 | } 63 | 64 | public override string ToString() 65 | { 66 | return Name ?? string.Empty; 67 | } 68 | 69 | public static bool operator ==(AFCItemType left, AFCItemType right) 70 | { 71 | return left.Equals(right); 72 | } 73 | 74 | public static bool operator !=(AFCItemType left, AFCItemType right) 75 | { 76 | return !(left == right); 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.AFC/AFCSession.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace MobileDeviceSharp.AFC 6 | { 7 | /// 8 | /// Represent a standard Apple file conduit session used to have access to the Media directory 9 | /// 10 | public sealed partial class AFCSession 11 | { 12 | /// 13 | public override string RootPath => "/private/var/mobile/Media"; 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.AFC/AFCSymbolicLink.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace MobileDeviceSharp.AFC 6 | { 7 | /// 8 | /// Represents a symbolic link in the AFC file system. 9 | /// 10 | public sealed class AFCSymbolicLink : AFCItem 11 | { 12 | 13 | internal AFCSymbolicLink(AFCSessionBase session, string path) : base(session, path) 14 | { 15 | 16 | } 17 | 18 | /// 19 | /// Determines if the specified AFC item type is supported by this class. 20 | /// 21 | /// The AFC item type to check. 22 | /// True if the item type is supported, otherwise false. 23 | protected override bool IsItemTypeSupported(AFCItemType itemType) 24 | { 25 | return itemType == AFCItemType.SymbolicLink; 26 | } 27 | 28 | /// 29 | /// Reads the target path of the symbolic link. 30 | /// 31 | /// Specifies whether to recursively resolve symbolic links. 32 | /// The target path of the symbolic link. 33 | public string ReadLink(bool recursive) 34 | { 35 | var TargetPath = GetFileInfo()["LinkTarget"]; 36 | if (recursive) 37 | { 38 | var target = new AFCSymbolicLink(Session, TargetPath); 39 | if (target.Exists) 40 | { 41 | return target.ReadLink(true); 42 | } 43 | } 44 | return TargetPath; 45 | } 46 | 47 | /// 48 | /// Reads the target path of the symbolic link. 49 | /// 50 | /// The target path of the symbolic link. 51 | public string ReadLink() 52 | { 53 | return ReadLink(false); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.AFC/MobileDeviceSharp.AFC.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard20;netstandard21;netcoreapp2.0;netcoreapp2.1;netcoreapp3.0;netcoreapp3.1;net5.0;net6.0 5 | win-x64;win-x86;osx-x64;linux-x64 6 | true 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | true 21 | $(BaseIntermediateOutputPath)\GeneratedFiles 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.AFC/Native/AFCDictionaryMarshaler.cs: -------------------------------------------------------------------------------- 1 | using MobileDeviceSharp.Native; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Runtime.InteropServices; 5 | using System.Text; 6 | 7 | namespace MobileDeviceSharp.AFC.Native 8 | { 9 | class AFCDictionaryMarshaler : DictionaryMarshaler 10 | { 11 | 12 | private static readonly Lazy s_static_instance = new(); 13 | 14 | public override void CleanUpNativeData(IntPtr pNativeData) 15 | { 16 | AFC.afc_dictionary_free(pNativeData); 17 | } 18 | 19 | public static new ICustomMarshaler GetInstance(string cookie) 20 | { 21 | return s_static_instance.Value; 22 | } 23 | 24 | public static new AFCDictionaryMarshaler GetInstance() 25 | { 26 | return s_static_instance.Value; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.AFC/Native/AFCError.cs: -------------------------------------------------------------------------------- 1 | namespace MobileDeviceSharp.AFC.Native 2 | { 3 | /// 4 | /// Error Codes 5 | /// 6 | [Exception(typeof(AFCException))] 7 | public enum AFCError : int 8 | { 9 | 10 | Success = 0, 11 | 12 | UnknownError = 1, 13 | 14 | OpHeaderInvalid = 2, 15 | 16 | NoResources = 3, 17 | 18 | ReadError = 4, 19 | 20 | WriteError = 5, 21 | 22 | UnknownPacketType = 6, 23 | 24 | InvalidArg = 7, 25 | 26 | ObjectNotFound = 8, 27 | 28 | ObjectIsDir = 9, 29 | 30 | PermDenied = 10, 31 | 32 | ServiceNotConnected = 11, 33 | 34 | OpTimeout = 12, 35 | 36 | TooMuchData = 13, 37 | 38 | EndOfData = 14, 39 | 40 | OpNotSupported = 15, 41 | 42 | ObjectExists = 16, 43 | 44 | ObjectBusy = 17, 45 | 46 | NoSpaceLeft = 18, 47 | 48 | OpWouldBlock = 19, 49 | 50 | IoError = 20, 51 | 52 | OpInterrupted = 21, 53 | 54 | OpInProgress = 22, 55 | 56 | InternalError = 23, 57 | 58 | MuxError = 30, 59 | 60 | NoMem = 31, 61 | 62 | NotEnoughData = 32, 63 | 64 | DirNotEmpty = 33, 65 | 66 | ServiceClientFailed = 34, 67 | 68 | EmptyResponse = 35, 69 | 70 | IncompleteHeader = 36, 71 | 72 | ForceSignedType = -1, 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.AFC/Native/AFCLinkType.cs: -------------------------------------------------------------------------------- 1 | namespace MobileDeviceSharp.AFC.Native 2 | { 3 | public enum AFCLinkType : int 4 | { 5 | 6 | Hardlink = 1, 7 | 8 | Symlink = 2, 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.AFC/Native/AFCLockOp.cs: -------------------------------------------------------------------------------- 1 | namespace MobileDeviceSharp.AFC.Native 2 | { 3 | public enum AFCLockOp : int 4 | { 5 | 6 | LockSh = 5, 7 | 8 | LockEx = 6, 9 | 10 | /// 11 | /// unlock 12 | /// 13 | LockUn = 12, 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.AFC/Native/AfcFileMode.cs: -------------------------------------------------------------------------------- 1 | namespace MobileDeviceSharp.AFC.Native 2 | { 3 | /// 4 | /// Flags for afc_file_open 5 | /// 6 | internal enum AFCFileMode : int 7 | { 8 | /// 9 | /// Read only. 10 | /// O_RDONLY. (r) 11 | /// 12 | FopenRdonly = 1, 13 | 14 | /// 15 | /// Read and write. 16 | /// O_RDWR | O_CREAT. (r+) 17 | /// 18 | FopenRw = 2, 19 | 20 | /// 21 | /// Write only, file is created or truncated. 22 | /// O_WRONLY | O_CREAT | O_TRUNC. (w) 23 | /// 24 | FopenWronly = 3, 25 | 26 | /// 27 | /// Read and write, file is created or truncated. 28 | /// O_RDWR | O_CREAT | O_TRUNC. (w+) 29 | /// 30 | FopenWr = 4, 31 | 32 | /// 33 | /// Write only, file is created or opened in append mode. 34 | /// O_WRONLY | O_APPEND | O_CREAT. (a) 35 | /// 36 | FopenAppend = 5, 37 | 38 | /// 39 | /// Read and write, file is created or opened in append mode. 40 | /// O_RDWR | O_APPEND | O_CREAT. (a+) 41 | /// 42 | FopenRdappend = 6, 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.AFC/Native/SeekWhence.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace MobileDeviceSharp.AFC.Native 6 | { 7 | internal enum SeekWhence 8 | { 9 | SEEK_SET = 0, 10 | SEEK_CUR = 1, 11 | SEEK_END = 2 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.CompilerServices/GenerateHandleAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MobileDeviceSharp.CompilerServices 4 | { 5 | /// 6 | /// Allow to generate an Handle for libimobiledevice. 7 | /// 8 | [AttributeUsage(AttributeTargets.Method)] 9 | public sealed class GenerateHandleAttribute : Attribute 10 | { 11 | /// 12 | /// The name of the handle 13 | /// 14 | public string HandleName { get; } 15 | 16 | /// 17 | /// Initialize a new instance of the 18 | /// 19 | public GenerateHandleAttribute() : base() 20 | { 21 | 22 | } 23 | 24 | /// 25 | /// /// Initialize a new instance of the with the specified . 26 | /// 27 | /// The name of the handle. 28 | public GenerateHandleAttribute(string handleName) : base() 29 | { 30 | HandleName = handleName; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.CompilerServices/MobileDeviceSharp.CompilerServices.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.CompilerServices/NotificationProxyEventName.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace MobileDeviceSharp.CompilerServices 6 | { 7 | /// 8 | /// This attribute allow to associate a .NET event to a notificationProxy event. 9 | /// 10 | [AttributeUsage(AttributeTargets.Event)] 11 | public sealed class NotificationProxyEventNameAttribute : Attribute 12 | { 13 | /// 14 | /// Initialize a new instance of the with the specified event . 15 | /// 16 | /// 17 | public NotificationProxyEventNameAttribute(string name) 18 | { 19 | Name = name; 20 | } 21 | 22 | /// 23 | /// The name of the event. 24 | /// 25 | public string Name { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.HouseArrest/AFCHouseArrestSession.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using MobileDeviceSharp.AFC; 5 | using MobileDeviceSharp.AFC.Native; 6 | using MobileDeviceSharp.InstallationProxy; 7 | using Mono.Unix; 8 | using static MobileDeviceSharp.HouseArrest.Native.HouseArrest; 9 | 10 | namespace MobileDeviceSharp.HouseArrest 11 | { 12 | /// 13 | /// Represent an Apple File Conduit session created by an and target an container.. 14 | /// 15 | public class AFCHouseArrestSession : AFCSessionBase 16 | { 17 | 18 | internal AFCHouseArrestSession(HouseArrestSession parent) : base(parent.Device, GetHandle(parent)) 19 | { 20 | Parent = parent; 21 | } 22 | 23 | /// 24 | /// Get directly an by implicitly creating the . 25 | /// 26 | /// The targeted . 27 | /// The which be autorized. 28 | /// The Apple File Conduit session. 29 | public static AFCHouseArrestSession CreateNew(Application application, HouseArrestLocation location) 30 | { 31 | var houseArrest = new HouseArrestSession(application, location); 32 | return houseArrest.AFCSession; 33 | } 34 | 35 | /// 36 | /// Get the parent which create this . 37 | /// 38 | public HouseArrestSession Parent { get; } 39 | 40 | static AFCClientHandle GetHandle(HouseArrestSession houseArrestSession) 41 | { 42 | var hresult = afc_client_new_from_house_arrest_client(houseArrestSession.Handle, out var afcHandle); 43 | if(hresult.IsError()) 44 | throw hresult.GetException(); 45 | return afcHandle; 46 | } 47 | 48 | /// 49 | /// Get the root path (this path corespond to the of the chosen application. 50 | /// 51 | public override string RootPath 52 | { 53 | get 54 | { 55 | return Parent.Applicaton.ContainerPath; 56 | } 57 | } 58 | 59 | /// 60 | /// Get the document folder (accessible whatether you chose or . 61 | /// 62 | public AFCDirectory Documents => this.GetAFCDirectory("/Documents"); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.HouseArrest/HouseArrestLocations.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace MobileDeviceSharp.HouseArrest 6 | { 7 | /// 8 | /// Represent the autorized location foran (the whole or only the . 9 | /// 10 | /// See the About the iOS File System section on Apple Developper. 11 | /// 12 | /// 13 | public enum HouseArrestLocation 14 | { 15 | /// 16 | /// Represent access to the whole container. 17 | /// 18 | Container, 19 | /// 20 | /// Represent access the /Document folder. 21 | /// 22 | Documents, 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.HouseArrest/HouseArrestSession.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using MobileDeviceSharp; 5 | using MobileDeviceSharp.HouseArrest.Native; 6 | using MobileDeviceSharp.Native; 7 | using MobileDeviceSharp.PropertyList; 8 | using MobileDeviceSharp.AFC.Native; 9 | using static MobileDeviceSharp.HouseArrest.Native.HouseArrest; 10 | using MobileDeviceSharp.InstallationProxy; 11 | 12 | namespace MobileDeviceSharp.HouseArrest 13 | { 14 | /// 15 | /// Represente a session of the HouseArrests service. 16 | /// 17 | public class HouseArrestSession : ServiceSessionBase 18 | { 19 | private static StartServiceCallback s_startServiceCallback = house_arrest_client_start_service; 20 | 21 | /// 22 | /// Initialize a new afc session for the target at the specific the Device 23 | /// 24 | /// The targeted . 25 | /// The which be autorized. 26 | public HouseArrestSession(Application application, HouseArrestLocation location) : base(application.Device, s_startServiceCallback) 27 | { 28 | Applicaton = application; 29 | Location = location; 30 | _aFCHouseArrestSession = new(InitializeAFCSession, true); 31 | } 32 | 33 | private AFCHouseArrestSession InitializeAFCSession() 34 | { 35 | var hresult = house_arrest_send_command(Handle, "Vend" + Enum.GetName(typeof(HouseArrestLocation), Location), Applicaton.BundleID); 36 | if (hresult.IsError()) 37 | throw hresult.GetException(); 38 | hresult = house_arrest_get_result(Handle, out var plistHandle); 39 | if (hresult.IsError()) 40 | throw hresult.GetException(); 41 | using var resultDic = (PlistDictionary)PlistNode.From(plistHandle)!; 42 | if (resultDic.TryGetValue("Error", out var errorPlist)) 43 | { 44 | throw new NotSupportedException(((PlistString)errorPlist).Value); 45 | } 46 | return new AFCHouseArrestSession(this); 47 | } 48 | 49 | private Lazy _aFCHouseArrestSession; 50 | 51 | /// 52 | /// Get the Apple file Conduit session created by this . 53 | /// 54 | public AFCHouseArrestSession AFCSession => _aFCHouseArrestSession.Value; 55 | 56 | /// 57 | /// Get the target application. 58 | /// 59 | public Application Applicaton { get; } 60 | 61 | /// 62 | /// Get the application location targeted by this session. 63 | /// 64 | public HouseArrestLocation Location { get; } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.HouseArrest/MobileDeviceSharp.HouseArrest.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard20;netstandard21;netcoreapp2.0;netcoreapp2.1;netcoreapp3.0;netcoreapp3.1;net5.0;net6.0 5 | win-x64;win-x86;osx-x64;linux-x64 6 | true 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | true 19 | $(BaseIntermediateOutputPath)\GeneratedFiles 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.HouseArrest/Native/HouseArrestError.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace MobileDeviceSharp.HouseArrest.Native 6 | { 7 | [Exception(typeof(HouseArrestException))] 8 | public enum HouseArrestError : int 9 | { 10 | 11 | Success = 0, 12 | 13 | InvalidArg = -1, 14 | 15 | PlistError = -2, 16 | 17 | ConnFailed = -3, 18 | 19 | InvalidMode = -4, 20 | 21 | UnknownError = -256, 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.InstallationProxy/ApplicationType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace MobileDeviceSharp.InstallationProxy 6 | { 7 | /// 8 | /// Represent the type of an 9 | /// 10 | [Flags] 11 | public enum ApplicationType 12 | { 13 | /// 14 | /// Hidden app. 15 | /// 16 | Hidden = 1, 17 | 18 | /// 19 | /// System app. 20 | /// 21 | System = 2, 22 | 23 | /// 24 | /// Represent a user app (an app downloaded from the App Store). 25 | /// 26 | User = 4, 27 | 28 | /// 29 | /// Any kind of app. 30 | /// 31 | Any = Hidden | User | System, 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.InstallationProxy/ArchiveType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace MobileDeviceSharp.InstallationProxy 6 | { 7 | /// 8 | /// Represent the type of archiving. 9 | /// 10 | [Flags] 11 | public enum ArchiveType 12 | { 13 | /// 14 | /// Achive only the application. 15 | /// 16 | Application, 17 | 18 | /// 19 | /// Achive only document. 20 | /// 21 | Documents, 22 | 23 | /// 24 | /// Archive all. 25 | /// 26 | All = Application | Documents 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.InstallationProxy/CapabilityMatcher.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | 3 | namespace MobileDeviceSharp.InstallationProxy 4 | { 5 | 6 | #pragma warning disable CS0419 // La référence de l'attribut cref est ambiguë 7 | /// 8 | /// Represent the result of a operation. 9 | /// 10 | public class CapabilityMatcher 11 | #pragma warning restore CS0419 // La référence de l'attribut cref est ambiguë 12 | { 13 | #if NET5_0_OR_GREATER 14 | internal CapabilityMatcher(bool match, IReadOnlySet capabilities, IReadOnlySet mismatchCapabilities) 15 | { 16 | Match = match; 17 | _MatchedCapabilities = new HashSet(capabilities); 18 | _MismatchCapabilities = mismatchCapabilities.ToHashSet(); 19 | _MatchedCapabilities.ExceptWith(mismatchCapabilities); 20 | } 21 | #else 22 | internal CapabilityMatcher(bool match, IEnumerable requestedCapabilities, IEnumerable mismatchCapabilities) 23 | { 24 | Match = match; 25 | #if NETSTANDARD2_1_OR_GREATER 26 | _MismatchCapabilities = mismatchCapabilities.ToHashSet(); 27 | _MatchedCapabilities = requestedCapabilities.ToHashSet(); 28 | RequestedCapabilities = requestedCapabilities.ToHashSet(); 29 | #else 30 | _MismatchCapabilities = new HashSet(mismatchCapabilities); 31 | _MatchedCapabilities = new HashSet(requestedCapabilities); 32 | RequestedCapabilities = new HashSet(requestedCapabilities); 33 | #endif 34 | _MatchedCapabilities.ExceptWith(mismatchCapabilities); 35 | } 36 | #endif 37 | 38 | /// 39 | /// Get a value indicating if the requested capabilities match. 40 | /// 41 | public bool Match { get; } 42 | 43 | 44 | private HashSet _MatchedCapabilities; 45 | 46 | /// 47 | /// Get the set of requested capabilities. 48 | /// 49 | #if NET5_0_OR_GREATER 50 | public IReadOnlySet RequestedCapabilities { get; } 51 | #else 52 | public IReadOnlyCollection RequestedCapabilities { get; } 53 | #endif 54 | /// 55 | /// Get the set of matched capabilities. 56 | /// 57 | #if NET5_0_OR_GREATER 58 | public IReadOnlySet MatchedCapabilities => _MatchedCapabilities; 59 | #else 60 | public IReadOnlyCollection MatchedCapabilities => _MatchedCapabilities; 61 | #endif 62 | private HashSet _MismatchCapabilities; 63 | 64 | /// 65 | /// Get the set of capabilites mismatched. 66 | /// 67 | #if NET5_0_OR_GREATER 68 | public IReadOnlySet MismatchCapabilities => _MismatchCapabilities; 69 | #else 70 | public IReadOnlyCollection MismatchCapabilities => _MismatchCapabilities; 71 | #endif 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.InstallationProxy/EnumerateOperationStatusContext.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Threading.Channels; 5 | using MobileDeviceSharp.PropertyList; 6 | using MobileDeviceSharp.PropertyList.Native; 7 | using static MobileDeviceSharp.InstallationProxy.Native.InstallationProxy; 8 | 9 | namespace MobileDeviceSharp.InstallationProxy 10 | { 11 | internal class EnumerateOperationStatusContext : OperationStatusContext 12 | { 13 | public EnumerateOperationStatusContext(ChannelWriter writer) 14 | { 15 | Writer = writer; 16 | } 17 | 18 | public ChannelWriter Writer { get; } 19 | 20 | protected override void OnCompleted(PlistHandle command, PlistHandle status) => Writer.Complete(); 21 | protected override void OnException(InstallationProxyOperationException exception) => Writer.Complete(exception); 22 | protected override void OnUpdateProgress(PlistHandle command, PlistHandle status) 23 | { 24 | instproxy_status_get_current_list(status, out _, out _, out _, out var arrayHandle); 25 | if (!arrayHandle.IsInvalid) 26 | { 27 | using var array = (PlistArray)PlistNode.From(arrayHandle)!; 28 | foreach (var item in array) 29 | { 30 | Writer.TryWrite(item.Clone()); 31 | } 32 | } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.InstallationProxy/InstallationProxyArchiveOptions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using MobileDeviceSharp.PropertyList; 5 | 6 | namespace MobileDeviceSharp.InstallationProxy 7 | { 8 | /// 9 | /// Represent options for the operation. 10 | /// 11 | public class InstallationProxyArchiveOptions : InstallationProxyOperationOptions 12 | { 13 | /// 14 | /// Get or set a value which indicate if the archiving operation should skip the uninstallation process. 15 | /// 16 | public bool SkipUninstall { get; set; } = false; 17 | 18 | /// 19 | /// Get or set which element should be archived. 20 | /// 21 | public ArchiveType ArchiveType { get; set; } = ArchiveType.All; 22 | 23 | /// 24 | public override PlistDictionary? ToDictionary() 25 | { 26 | PlistDictionary? dic = null; 27 | if (ArchiveType != ArchiveType.All) 28 | { 29 | dic ??= new PlistDictionary(); 30 | dic.Add("ArchiveType", new PlistString($"{ArchiveType}Only")); 31 | } 32 | if (SkipUninstall) 33 | { 34 | dic ??= new PlistDictionary(); 35 | dic.Add("SkipUninstall", new PlistBoolean(SkipUninstall)); 36 | } 37 | return dic; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.InstallationProxy/InstallationProxyInstallOptions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using MobileDeviceSharp.PropertyList; 5 | 6 | namespace MobileDeviceSharp.InstallationProxy 7 | { 8 | /// 9 | /// Represente options that can be pased to an insstalltion proxy operation. 10 | /// 11 | public sealed class InstallationProxyInstallOptions : InstallationProxyOperationOptions 12 | { 13 | /// 14 | /// Provide by Application Sinf 15 | /// 16 | public byte[]? ApplicationSinf { get; set; } 17 | 18 | /// 19 | /// Provide by iTunes Metadata. 20 | /// 21 | public PlistDictionary TunesMetadata { get; } 22 | 23 | /// 24 | /// If PackageType -> Developer is specified, then the provided path need to point to 25 | /// an.app directory instead of an install package. 26 | /// 27 | public bool IsDevelopperPackage { get; } 28 | 29 | /// 30 | public override PlistDictionary? ToDictionary() 31 | { 32 | PlistDictionary? dict = null; 33 | if (ApplicationSinf is not null) 34 | { 35 | dict ??= new PlistDictionary(); 36 | dict.Add("ApplicationSinf", new PlistData(ApplicationSinf)); 37 | } 38 | 39 | if (TunesMetadata is not null) 40 | { 41 | dict ??= new PlistDictionary(); 42 | dict.Add("iTunesMetadata", TunesMetadata); 43 | } 44 | 45 | if (ApplicationSinf is not null) 46 | { 47 | dict ??= new PlistDictionary(); 48 | dict.Add("ApplicationSinf", new PlistData(ApplicationSinf)); 49 | } 50 | 51 | if (IsDevelopperPackage) 52 | { 53 | dict ??= new PlistDictionary(); 54 | dict.Add("PackageType", new PlistString("Developer")); 55 | } 56 | return dict; 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.InstallationProxy/InstallationProxyOperationException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using static MobileDeviceSharp.InstallationProxy.Native.InstallationProxy; 5 | using MobileDeviceSharp.PropertyList.Native; 6 | 7 | namespace MobileDeviceSharp.InstallationProxy 8 | { 9 | /// 10 | /// Represent an exception occuring during an installation proxy operation. 11 | /// 12 | public class InstallationProxyOperationException : Exception 13 | { 14 | public InstallationProxyOperationException(string errorName, string errorDesc, ulong errorCode) : base(errorDesc) 15 | { 16 | Name = errorName; 17 | Code = errorCode; 18 | } 19 | 20 | static internal bool TryFromStatusPlist(PlistHandle statusPlist, out InstallationProxyOperationException? exception) 21 | { 22 | instproxy_status_get_error(statusPlist, out var errorName, out var errorDesc, out var errorCode); 23 | var result = errorCode != 0; 24 | exception = (result ? null : new InstallationProxyOperationException(errorName, errorDesc, errorCode)); 25 | return result; 26 | } 27 | 28 | /// 29 | /// Get the error name. 30 | /// 31 | public string Name { get; } 32 | 33 | /// 34 | /// Get the error code. 35 | /// 36 | public ulong Code { get; } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.InstallationProxy/InstallationProxyOperationOptions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using MobileDeviceSharp.PropertyList; 5 | 6 | namespace MobileDeviceSharp.InstallationProxy 7 | { 8 | /// 9 | /// Represent options for an installation proxy operation. 10 | /// 11 | public abstract class InstallationProxyOperationOptions 12 | { 13 | /// 14 | /// Get a representing the current instance. 15 | /// 16 | /// 17 | public abstract PlistDictionary? ToDictionary(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.InstallationProxy/InstallationProxyStatusCallBack.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using MobileDeviceSharp.PropertyList.Native; 4 | 5 | namespace MobileDeviceSharp.InstallationProxy.Native 6 | { 7 | public delegate void InstallationProxyStatusCallBack([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(PlistHandleNotOwnedMarshaler))] PlistHandle command, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(PlistHandleNotOwnedMarshaler))] PlistHandle status, IntPtr userData); 8 | } 9 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.InstallationProxy/InstalltionProxyLookupOptions.cs: -------------------------------------------------------------------------------- 1 | using MobileDeviceSharp.PropertyList; 2 | 3 | namespace MobileDeviceSharp.InstallationProxy 4 | { 5 | /// 6 | /// Represent options for the process of looking applications installed on the device. 7 | /// 8 | public class InstalltionProxyLookupOptions : InstallationProxyOperationOptions 9 | { 10 | /// 11 | /// Create a new instance of . 12 | /// 13 | public InstalltionProxyLookupOptions() 14 | { 15 | ApplicationType = ApplicationType.Any; 16 | } 17 | 18 | /// 19 | /// Get application type to look up. 20 | /// 21 | public ApplicationType ApplicationType { get; set; } 22 | 23 | /// 24 | public override PlistDictionary? ToDictionary() 25 | { 26 | PlistDictionary? dict = null; 27 | if (ApplicationType != ApplicationType.Any) 28 | { 29 | dict ??= new PlistDictionary(); 30 | dict.Add("ApplicationType", new PlistString(Enum.GetName(ApplicationType.GetType(), ApplicationType))); 31 | } 32 | return dict; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.InstallationProxy/MobileDeviceSharp.InstallationProxy.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard20;netstandard21;netcoreapp2.0;netcoreapp2.1;netcoreapp3.0;netcoreapp3.1;net5.0;net6.0 5 | win-x64;win-x86;osx-x64;linux-x64 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | true 21 | $(BaseIntermediateOutputPath)\GeneratedFiles 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.InstallationProxy/Native/InstallationProxyError.cs: -------------------------------------------------------------------------------- 1 | namespace MobileDeviceSharp.InstallationProxy 2 | { 3 | /// 4 | /// Error Codes 5 | /// 6 | [Exception(typeof(InstallationProxyException))] 7 | public enum InstallationProxyError : int 8 | { 9 | 10 | Success = 0, 11 | 12 | InvalidArg = -1, 13 | 14 | PlistError = -2, 15 | 16 | ConnFailed = -3, 17 | 18 | OpInProgress = -4, 19 | 20 | OpFailed = -5, 21 | 22 | ReceiveTimeout = -6, 23 | 24 | AlreadyArchived = -7, 25 | 26 | ApiInternalError = -8, 27 | 28 | ApplicationAlreadyInstalled = -9, 29 | 30 | ApplicationMoveFailed = -10, 31 | 32 | ApplicationSinfCaptureFailed = -11, 33 | 34 | ApplicationSandboxFailed = -12, 35 | 36 | ApplicationVerificationFailed = -13, 37 | 38 | ArchiveDestructionFailed = -14, 39 | 40 | BundleVerificationFailed = -15, 41 | 42 | CarrierBundleCopyFailed = -16, 43 | 44 | CarrierBundleDirectoryCreationFailed = -17, 45 | 46 | CarrierBundleMissingSupportedSims = -18, 47 | 48 | CommCenterNotificationFailed = -19, 49 | 50 | ContainerCreationFailed = -20, 51 | 52 | ContainerP0wnFailed = -21, 53 | 54 | ContainerRemovalFailed = -22, 55 | 56 | EmbeddedProfileInstallFailed = -23, 57 | 58 | ExecutableTwiddleFailed = -24, 59 | 60 | ExistenceCheckFailed = -25, 61 | 62 | InstallMapUpdateFailed = -26, 63 | 64 | ManifestCaptureFailed = -27, 65 | 66 | MapGenerationFailed = -28, 67 | 68 | MissingBundleExecutable = -29, 69 | 70 | MissingBundleIdentifier = -30, 71 | 72 | MissingBundlePath = -31, 73 | 74 | MissingContainer = -32, 75 | 76 | NotificationFailed = -33, 77 | 78 | PackageExtractionFailed = -34, 79 | 80 | PackageInspectionFailed = -35, 81 | 82 | PackageMoveFailed = -36, 83 | 84 | PathConversionFailed = -37, 85 | 86 | RestoreContainerFailed = -38, 87 | 88 | SeatbeltProfileRemovalFailed = -39, 89 | 90 | StageCreationFailed = -40, 91 | 92 | SymlinkFailed = -41, 93 | 94 | UnknownCommand = -42, 95 | 96 | ItunesArtworkCaptureFailed = -43, 97 | 98 | ItunesMetadataCaptureFailed = -44, 99 | 100 | DeviceOsVersionTooLow = -45, 101 | 102 | DeviceFamilyNotSupported = -46, 103 | 104 | PackagePatchFailed = -47, 105 | 106 | IncorrectArchitecture = -48, 107 | 108 | PluginCopyFailed = -49, 109 | 110 | BreadcrumbFailed = -50, 111 | 112 | BreadcrumbUnlockFailed = -51, 113 | 114 | GeojsonCaptureFailed = -52, 115 | 116 | NewsstandArtworkCaptureFailed = -53, 117 | 118 | MissingCommand = -54, 119 | 120 | NotEntitled = -55, 121 | 122 | MissingPackagePath = -56, 123 | 124 | MissingContainerPath = -57, 125 | 126 | MissingApplicationIdentifier = -58, 127 | 128 | MissingAttributeValue = -59, 129 | 130 | LookupFailed = -60, 131 | 132 | DictCreationFailed = -61, 133 | 134 | InstallProhibited = -62, 135 | 136 | UninstallProhibited = -63, 137 | 138 | MissingBundleVersion = -64, 139 | 140 | UnknownError = -256, 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.InstallationProxy/OperationStatusContext.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | using MobileDeviceSharp.PropertyList.Native; 3 | using static MobileDeviceSharp.InstallationProxy.Native.InstallationProxy; 4 | 5 | namespace MobileDeviceSharp.InstallationProxy 6 | { 7 | internal abstract class OperationStatusContext 8 | { 9 | protected abstract void OnUpdateProgress(PlistHandle command, PlistHandle status); 10 | 11 | internal void ReportProgress(PlistHandle command, PlistHandle status) 12 | { 13 | 14 | if (TryGetError(status, out var errorName, out var errorDescription, out var errorCode)) 15 | { 16 | OnExceptionCore(command, errorName, errorDescription, errorCode); 17 | } 18 | OnUpdateProgress(command, status); 19 | if (IsComplete(status)) 20 | { 21 | OnCompleted(command, status); 22 | } 23 | } 24 | 25 | private static bool TryGetError(PlistHandle status, out string errorName, out string errorDescription, out ulong errorCode) 26 | { 27 | instproxy_status_get_error(status, out errorName, out errorDescription, out errorCode); 28 | return errorName is not null; 29 | } 30 | 31 | protected virtual void OnExceptionCore(PlistHandle command, string errorName, string errorDescription, ulong errorCode) 32 | { 33 | OnException(new InstallationProxyOperationException(errorName, errorDescription, errorCode)); 34 | } 35 | 36 | protected abstract void OnException(InstallationProxyOperationException exception); 37 | 38 | protected abstract void OnCompleted(PlistHandle command, PlistHandle status); 39 | 40 | internal static bool IsComplete(PlistHandle status) 41 | { 42 | instproxy_status_get_name(status, out string statusName); 43 | return statusName is not null && statusName.Equals("Complete", StringComparison.InvariantCultureIgnoreCase); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.InstallationProxy/TaskWithProgressOperationStatusContext.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Threading.Tasks; 5 | using MobileDeviceSharp.PropertyList.Native; 6 | using static MobileDeviceSharp.InstallationProxy.Native.InstallationProxy; 7 | 8 | namespace MobileDeviceSharp.InstallationProxy 9 | { 10 | internal class TaskWithProgressOperationStatusContext : OperationStatusContext 11 | { 12 | #if NET5_0_OR_GREATER 13 | public TaskCompletionSource Tcs { get; } 14 | #else 15 | public TaskCompletionSource Tcs { get; } 16 | #endif 17 | public IProgress? Progress { get; } 18 | #if NET5_0_OR_GREATER 19 | public TaskWithProgressOperationStatusContext(TaskCompletionSource taskCompletionSource, IProgress? progress) 20 | #else 21 | public TaskWithProgressOperationStatusContext(TaskCompletionSource taskCompletionSource, IProgress? progress) 22 | #endif 23 | { 24 | Tcs = taskCompletionSource; 25 | Progress = progress; 26 | } 27 | 28 | #if NET5_0_OR_GREATER 29 | public TaskWithProgressOperationStatusContext(TaskCompletionSource taskCompletionSource) 30 | #else 31 | public TaskWithProgressOperationStatusContext(TaskCompletionSource taskCompletionSource) 32 | #endif 33 | : this(taskCompletionSource, null) 34 | { 35 | } 36 | 37 | protected override void OnException(InstallationProxyOperationException exception) => Tcs.SetException(exception); 38 | protected override void OnUpdateProgress(PlistHandle command, PlistHandle status) 39 | { 40 | if (Progress is not null) 41 | { 42 | instproxy_status_get_percent_complete(status, out int percent); 43 | Progress.Report(percent); 44 | } 45 | 46 | } 47 | protected override void OnCompleted(PlistHandle command, PlistHandle status) 48 | #if NET5_0_OR_GREATER 49 | => Tcs.SetResult(); 50 | #else 51 | => Tcs.SetResult(null); 52 | #endif 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.SourceGenerator/MobileDeviceSharp.SourceGenerator.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | true 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | all 22 | runtime; build; native; contentfiles; analyzers; buildtransitive 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.SourceGenerator/PartialFactory.cs: -------------------------------------------------------------------------------- 1 | using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; 2 | 3 | namespace MobileDeviceSharp.SourceGenerator 4 | { 5 | internal static class PartialFactory 6 | { 7 | private static IEnumerable ParentNodes(MemberDeclarationSyntax memberDeclaration) 8 | { 9 | for (SyntaxNode? node = memberDeclaration; node is not null && typeof(MemberDeclarationSyntax).IsAssignableFrom(node.GetType()); node = node.Parent) 10 | { 11 | yield return (MemberDeclarationSyntax)node; 12 | } 13 | } 14 | 15 | public static MemberDeclarationSyntax CreatePartial(MethodDeclarationSyntax methodDeclaration, Func builder) 16 | { 17 | if (methodDeclaration.Parent is TypeDeclarationSyntax type) 18 | { 19 | 20 | } 21 | else 22 | { 23 | throw new NotSupportedException(); 24 | } 25 | var childs = List(new[] { builder(methodDeclaration) }); 26 | return CreatePartial(type, (type) => type.WithMembers(childs)); 27 | } 28 | 29 | public static MemberDeclarationSyntax CreatePartial(T typeDeclaration, Func builder) where T : TypeDeclarationSyntax 30 | { 31 | var nodes = ParentNodes(typeDeclaration); 32 | MemberDeclarationSyntax? child = null; 33 | SyntaxList childs; 34 | foreach (var node in nodes) 35 | { 36 | if (child==null) 37 | { 38 | childs = List(); 39 | } 40 | else 41 | { 42 | if (child is TypeDeclarationSyntax typeDeclarationSyntax && typeDeclarationSyntax.Identifier.ToString()== typeDeclaration.Identifier.ToString()) 43 | { 44 | child = builder(typeDeclaration); 45 | } 46 | childs = List(new MemberDeclarationSyntax[] {child}); 47 | } 48 | if(node is TypeDeclarationSyntax typeNode) 49 | { 50 | child = typeNode.Clean().WithMembers(childs); 51 | } 52 | else if (node is NamespaceDeclarationSyntax namespaceNode) 53 | { 54 | child = namespaceNode.WithMembers(childs); 55 | } 56 | } 57 | return child!; 58 | 59 | } 60 | private static TypeDeclarationSyntax Clean(this TypeDeclarationSyntax type) 61 | { 62 | var result = type.WithAttributeLists(List()) 63 | .WithBaseList(null); 64 | if (!result.Modifiers.Any(m=>m.IsKind(SyntaxKind.PartialKeyword))) 65 | { 66 | result = result.AddModifiers(Token(SyntaxKind.PartialKeyword)); 67 | } 68 | return result; 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.SourceGenerator/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Generator MobileDeviceSharp": { 4 | "commandName": "DebugRoslynComponent", 5 | "targetProject": "..\\MobileDeviceSharp\\MobileDeviceSharp.csproj" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.SourceGenerator/npEventSyntaxBuilder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; 5 | 6 | namespace MobileDeviceSharp.SourceGenerator 7 | { 8 | internal class NpEventSyntaxPartsBuilder 9 | { 10 | private readonly Lazy _onMethod; 11 | 12 | public MethodDeclarationSyntax OnMethod => _onMethod.Value; 13 | 14 | private readonly Lazy _switchSection; 15 | 16 | public SwitchSectionSyntax SwitchSection => _switchSection.Value; 17 | 18 | private readonly Lazy _observeArgument; 19 | 20 | public ArgumentSyntax ObserveArgument => _observeArgument.Value; 21 | 22 | private readonly Lazy _onMethodIdentifier; 23 | public string EventName { get; } 24 | public string EventID { get; } 25 | 26 | public NpEventSyntaxPartsBuilder(string eventID, string eventName) 27 | { 28 | 29 | EventID = eventID; 30 | EventName = eventName; 31 | _onMethod = new Lazy(OnMethodFactory); 32 | _switchSection = new Lazy(SwitchSectionFactory); 33 | _observeArgument = new Lazy(ObserveArgumentFactory); 34 | _onMethodIdentifier = new Lazy(()=>Identifier($"On{EventName}")); 35 | } 36 | 37 | private MethodDeclarationSyntax OnMethodFactory() 38 | { 39 | return MethodDeclaration(PredefinedType(Token(SyntaxKind.VoidKeyword)), _onMethodIdentifier.Value) 40 | .AddModifiers(Token(SyntaxKind.PrivateKeyword)) 41 | .AddBodyStatements(ExpressionStatement(ParseExpression($"{EventName}?.Invoke(this, EventArgs.Empty)"))); 42 | } 43 | private SwitchSectionSyntax SwitchSectionFactory() 44 | { 45 | return SwitchSection() 46 | .AddLabels( 47 | CaseSwitchLabel(LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(EventID)))) 48 | .AddStatements( 49 | ExpressionStatement(InvocationExpression(IdentifierName(_onMethodIdentifier.Value))), 50 | BreakStatement()); 51 | } 52 | private ArgumentSyntax ObserveArgumentFactory() 53 | { 54 | return Argument(LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(EventID))); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.SpringBoardServices/ApplicationExtension.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using Microsoft.Maui.Graphics; 5 | using MobileDeviceSharp.InstallationProxy; 6 | using MobileDeviceSharp.SpringBoardServices; 7 | 8 | namespace MobileDeviceSharp.SpringBoardServices 9 | { 10 | /// 11 | /// Defines a static class containing extention methods for the class that avoid direct usage of for SpringBoard related properties like icon. 12 | /// 13 | public static class ApplicationExtension 14 | { 15 | /// 16 | /// Retrieves the icon for the specified using a . 17 | /// 18 | /// The instance for which to retrieve the icon. 19 | /// An representing the application icon. 20 | public static IImage GetIcon(this Application application) 21 | { 22 | using var sbservice = new SpringBoardServicesSession(application.Device); 23 | return sbservice.GetIcon(application); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.SpringBoardServices/MobileDeviceSharp.SpringBoardServices.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard20;netstandard21;netcoreapp2.0;netcoreapp2.1;netcoreapp3.0;netcoreapp3.1;net5.0;net6.0 5 | win-x64;win-x86;osx-x64;linux-x64 6 | true 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.SpringBoardServices/Native/SpringBoardServicesError.cs: -------------------------------------------------------------------------------- 1 | namespace MobileDeviceSharp.SpringBoardServices.Native 2 | { 3 | /// 4 | /// Error Codes 5 | /// 6 | [Exception(typeof(SpringBoardServicesException))] 7 | public enum SpringBoardServicesError : int 8 | { 9 | 10 | Success = 0, 11 | 12 | InvalidArg = -1, 13 | 14 | InvalidConf = -2, 15 | 16 | PlistError = -3, 17 | 18 | PairingFailed = -4, 19 | 20 | SslError = -5, 21 | 22 | DictError = -6, 23 | 24 | ReceiveTimeout = -7, 25 | 26 | MuxError = -8, 27 | 28 | NoRunningSession = -9, 29 | 30 | InvalidResponse = -10, 31 | 32 | MissingKey = -11, 33 | 34 | MissingValue = -12, 35 | 36 | GetProhibited = -13, 37 | 38 | SetProhibited = -14, 39 | 40 | RemoveProhibited = -15, 41 | 42 | ImmutableValue = -16, 43 | 44 | PasswordProtected = -17, 45 | 46 | UserDeniedPairing = -18, 47 | 48 | PairingDialogResponsePending = -19, 49 | 50 | MissingHostId = -20, 51 | 52 | InvalidHostId = -21, 53 | 54 | SessionActive = -22, 55 | 56 | SessionInactive = -23, 57 | 58 | MissingSessionId = -24, 59 | 60 | InvalidSessionId = -25, 61 | 62 | MissingService = -26, 63 | 64 | InvalidService = -27, 65 | 66 | ServiceLimit = -28, 67 | 68 | MissingPairRecord = -29, 69 | 70 | SavePairRecordFailed = -30, 71 | 72 | InvalidPairRecord = -31, 73 | 74 | InvalidActivationRecord = -32, 75 | 76 | MissingActivationRecord = -33, 77 | 78 | ServiceProhibited = -34, 79 | 80 | EscrowLocked = -35, 81 | 82 | PairingProhibitedOverThisConnection = -36, 83 | 84 | FmipProtected = -37, 85 | 86 | McProtected = -38, 87 | 88 | McChallengeRequired = -39, 89 | 90 | UnknownError = -256, 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.SpringBoardServices/SpringBoardDissposition.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using MobileDeviceSharp.PropertyList; 5 | 6 | namespace MobileDeviceSharp.SpringBoardServices 7 | { 8 | /// 9 | /// Represents a SpringBoard disposition object and its associated version. 10 | /// 11 | public sealed class SpringBoardDissposition : IDisposable 12 | { 13 | /// 14 | /// Initializes a new instance of the class with the specified and . 15 | /// 16 | /// The object that represents the SpringBoard disposition. 17 | /// The version of the SpringBoard disposition object. 18 | internal SpringBoardDissposition(PlistArray disposition, string version) 19 | { 20 | Disposition = disposition; 21 | Version = version; 22 | } 23 | 24 | /// 25 | /// Gets the object that represents the SpringBoard disposition. 26 | /// 27 | public PlistArray Disposition { get; } 28 | 29 | /// 30 | /// Gets the version of the SpringBoard disposition object. 31 | /// 32 | public string Version { get; } 33 | 34 | /// 35 | public void Dispose() => Disposition.Dispose(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp.SpringBoardServices/UIInterfaceOrientation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace MobileDeviceSharp.SpringBoardServices 6 | { 7 | /// 8 | /// Represent the interface orientations same as UIKit UIInterfaceOrientation. 9 | /// 10 | public enum UIInterfaceOrientation 11 | { 12 | /// 13 | /// The interface orientation is unknown. 14 | /// 15 | Unknown =0, 16 | 17 | /// 18 | /// The portrait orientation, where the device is in an upright position with the home button at the bottom. 19 | /// 20 | Portrait = 1, 21 | 22 | /// 23 | /// The portrait orientation, where the device is in an upright position with the home button at the top. 24 | /// 25 | PortraitUpsideDown = 2, 26 | 27 | /// 28 | /// The landscape orientation, where the device is in a horizontal position with the home button on the left side. 29 | /// 30 | LandscapeLeft =3, 31 | 32 | /// 33 | /// The landscape orientation, where the device is in a horizontal position with the home button on the right side. 34 | /// 35 | LandscapeRight = 4, 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/Battery.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using MobileDeviceSharp; 4 | using MobileDeviceSharp.Native; 5 | using MobileDeviceSharp.PropertyList; 6 | 7 | namespace MobileDeviceSharp 8 | { 9 | /// 10 | /// Represent the battery information of the device. 11 | /// 12 | public sealed class Battery 13 | { 14 | private readonly IDevice _device; 15 | 16 | private const string BATTERY_LOCKDOWN_DOMAIN = "com.apple.mobile.battery"; 17 | internal Battery(IDevice iDevice) 18 | { 19 | _device = iDevice; 20 | } 21 | 22 | /// 23 | /// Get the device battery state. 24 | /// 25 | public UIDeviceBatteryState BatteryState 26 | { 27 | get 28 | { 29 | PlistDictionary dict; 30 | using (var lockdown =new LockdownSession(_device)) 31 | { 32 | if(lockdown.TryGetDomain(BATTERY_LOCKDOWN_DOMAIN, out var domain)) 33 | { 34 | dict = (PlistDictionary)domain; 35 | } 36 | else 37 | { 38 | return UIDeviceBatteryState.Unknown; 39 | } 40 | } 41 | IReadOnlyDictionary> statesDic 42 | = new Dictionary> 43 | { 44 | { "FullyCharged", (true,UIDeviceBatteryState.Full) }, 45 | { "BatteryIsCharging", (true,UIDeviceBatteryState.Charging) }, 46 | { "ExternalConnected", (false,UIDeviceBatteryState.Unplugged) } 47 | }; 48 | foreach (var keyValue in statesDic) 49 | { 50 | var key = keyValue.Key; 51 | var (val, state) = keyValue.Value; 52 | if (dict.TryGetValue(key, out var pValue)) 53 | { 54 | var pbool = ((PlistBoolean)pValue).Value; 55 | if (pbool == val) 56 | { 57 | return state; 58 | } 59 | } 60 | else 61 | { 62 | return UIDeviceBatteryState.Unknown; 63 | } 64 | } 65 | return UIDeviceBatteryState.Unknown; 66 | } 67 | } 68 | 69 | /// 70 | /// Get the device battery level. 71 | /// 72 | public float BatteryLevel 73 | { 74 | get 75 | { 76 | using var lockdown = new LockdownSession(_device); 77 | using var pValue = (PlistInteger)lockdown.GetDomain(BATTERY_LOCKDOWN_DOMAIN)["BatteryCurrentCapacity"]; 78 | return pValue.Value/100; 79 | } 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/DeviceClass.cs: -------------------------------------------------------------------------------- 1 | namespace MobileDeviceSharp 2 | { 3 | /// 4 | /// Represent the type of device IPhone, iPad... 5 | /// 6 | public enum DeviceClass : int 7 | { 8 | /// 9 | /// The device type is unknow 10 | /// 11 | Unknow = -1, 12 | /// 13 | /// Represent an iPhone 14 | /// 15 | iPhone, 16 | /// 17 | /// Represent an iPad 18 | /// 19 | iPad, 20 | /// 21 | /// Represent an iPod 22 | /// 23 | iPod, 24 | /// 25 | /// Represent an Apple Watch 26 | /// 27 | Watch, 28 | /// 29 | /// Represent an AppleTV 30 | /// 31 | AppleTV 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/DeviceEventArgs.cs: -------------------------------------------------------------------------------- 1 | using MobileDeviceSharp.Usbmuxd.Native; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace MobileDeviceSharp 7 | { 8 | /// 9 | /// Represent an event associated to a connection, deconnection, or pairing of a Deivce. 10 | /// 11 | public sealed class DeviceEventArgs : EventArgs 12 | { 13 | /// 14 | /// Initialize a new instance of from 15 | /// 16 | /// 17 | public DeviceEventArgs(UsbmuxdDeviceInfo deviceInfo) 18 | { 19 | Udid = deviceInfo.udid; 20 | ProductID = deviceInfo.product_id; 21 | ConnectionType = deviceInfo.conn_type; 22 | } 23 | 24 | /// 25 | /// Try get the device who rase this event. 26 | /// 27 | /// The resulted device (this value is null if result is 28 | /// on succes else 29 | public bool TryGetDevice(out IDevice device) 30 | { 31 | return IDevice.TryGetDevice(Udid, ConnectionType, out device); 32 | } 33 | 34 | /// 35 | /// The device udid. 36 | /// 37 | public string Udid { get; } 38 | 39 | /// 40 | /// The device Product id. 41 | /// 42 | public uint ProductID { get; } 43 | /// 44 | /// The device connection type. 45 | /// 46 | public IDeviceLookupOptions ConnectionType { get; } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/DiagnosticsRelay/IDeviceExtention.cs: -------------------------------------------------------------------------------- 1 | using MobileDeviceSharp.DiagnosticsRelay.Native; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace MobileDeviceSharp.DiagnosticsRelay 7 | { 8 | /// 9 | /// Extension methods for the interface. 10 | /// 11 | public static class IDeviceExtention 12 | { 13 | /// 14 | /// Shuts down the specified device. 15 | /// 16 | /// The device to shut down. 17 | public static void Shutdown(this IDevice device) 18 | { 19 | using (var relay = new DiagnosticsRelaySession(device)) 20 | { 21 | relay.Shutdown(DiagnosticsRelayAction.ActionFlagDisplayFail); 22 | } 23 | } 24 | 25 | /// 26 | /// Reboots the specified device. 27 | /// 28 | /// The device to reboot. 29 | public static void Reboot(this IDevice device) 30 | { 31 | using (var relay = new DiagnosticsRelaySession(device)) 32 | { 33 | relay.Reboot(DiagnosticsRelayAction.ActionFlagDisplayFail); 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/DiagnosticsRelay/Native/DiagnosticsRelayAction.cs: -------------------------------------------------------------------------------- 1 | namespace MobileDeviceSharp.DiagnosticsRelay.Native 2 | { 3 | public enum DiagnosticsRelayAction : int 4 | { 5 | /// 6 | /// Wait until diagnostics disconnects before execution. 7 | /// 8 | ActionFlagWaitForDisconnect = 2, 9 | /// 10 | /// show a "FAIL" dialog. 11 | /// 12 | ActionFlagDisplayPass = 4, 13 | /// 14 | /// Show an "OK" dialog. 15 | /// 16 | ActionFlagDisplayFail = 8, 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/DiagnosticsRelay/Native/DiagnosticsRelayError.cs: -------------------------------------------------------------------------------- 1 | namespace MobileDeviceSharp.DiagnosticsRelay.Native 2 | { 3 | /// 4 | /// Error Codes 5 | /// 6 | [Exception(typeof(DiagnosticsRelayException))] 7 | public enum DiagnosticsRelayError : int 8 | { 9 | 10 | Success = 0, 11 | 12 | InvalidArg = -1, 13 | 14 | PlistError = -2, 15 | 16 | MuxError = -3, 17 | 18 | UnknownRequest = -4, 19 | 20 | UnknownError = -256, 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/ExceptionAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace MobileDeviceSharp 6 | { 7 | /// 8 | /// Attribute used to generate exception from the hresult enum 9 | /// 10 | [AttributeUsage(AttributeTargets.Enum)] 11 | public sealed class ExceptionAttribute : Attribute 12 | { 13 | #pragma warning disable CS8618 // Un champ non-nullable doit contenir une valeur non-null lors de la fermeture du constructeur. Envisagez de déclarer le champ comme nullable. 14 | public ExceptionAttribute(Type exceptionType) 15 | #pragma warning restore CS8618 // Un champ non-nullable doit contenir une valeur non-null lors de la fermeture du constructeur. Envisagez de déclarer le champ comme nullable. 16 | { 17 | ExceptionType = exceptionType; 18 | } 19 | Type _exceptionType; 20 | public Type ExceptionType 21 | { 22 | get 23 | { 24 | return _exceptionType; 25 | } 26 | set 27 | { 28 | if (typeof(MobileDeviceException).IsAssignableFrom(value)) 29 | { 30 | _exceptionType = value; 31 | } 32 | } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/ExceptionMessageAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | 4 | namespace MobileDeviceSharp 5 | { 6 | /// 7 | /// Used to generate exception message for an hresult enum field. 8 | /// 9 | [AttributeUsage(AttributeTargets.Field)] 10 | public class ExceptionMessageAttribute : Attribute 11 | { 12 | /// 13 | /// Define an exception message for the field with the specifed message. 14 | /// 15 | /// The message 16 | public ExceptionMessageAttribute(string message) 17 | { 18 | Message = message; 19 | } 20 | 21 | public string Message { get; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/ExceptionUtils.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using System.Text; 6 | 7 | namespace MobileDeviceSharp 8 | { 9 | /// 10 | /// Utilities to get . 11 | /// 12 | public static class ExceptionUtils 13 | { 14 | /// 15 | /// Get from enum value of type . 16 | /// 17 | /// The type of enum error. 18 | /// The enum value of type . 19 | /// 20 | /// Raised when the typ not correspond to MobileDevice Error. 21 | public static MobileDeviceException? GetException(T value) where T : Enum 22 | { 23 | var attributes = typeof(T).GetCustomAttribute(true); 24 | 25 | if (attributes is not null) 26 | { 27 | if ((int)(object)value == 0) 28 | { 29 | return null; 30 | } 31 | else 32 | { 33 | return (MobileDeviceException)Activator.CreateInstance(attributes.ExceptionType, value); 34 | } 35 | } 36 | else 37 | { 38 | throw new NotSupportedException(); 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/GenerateHandle.txt: -------------------------------------------------------------------------------- 1 | MobileDeviceSharp.Native.LockdownPairRecord 2 | MobileDeviceSharp.PropertyList.PlistArrayIter 3 | MobileDeviceSharp.PropertyList.PlistDictIter 4 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/MobileDeviceException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | using System.Text; 7 | 8 | namespace MobileDeviceSharp 9 | { 10 | /// 11 | /// An exception thrown by the imobiledevice library. 12 | /// 13 | public abstract class MobileDeviceException : ExternalException 14 | { 15 | /// 16 | /// Initialize a new instace of the . 17 | /// 18 | public MobileDeviceException() : base() { } 19 | 20 | /// 21 | /// Initialize a new instace of the with the specified and . 22 | /// 23 | /// 24 | /// 25 | public MobileDeviceException(string message, int errorCode) : base(message,errorCode) { } 26 | 27 | protected static string GetMessageForHResult(T value) where T : Enum 28 | { 29 | var enumType = typeof(T); 30 | var memberData = enumType.GetMember(value.ToString()).First(); 31 | var Description = memberData.GetCustomAttributes(false).FirstOrDefault()?.Message; 32 | if (Description==null) 33 | { 34 | return value.ToString(); 35 | } 36 | return Description; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/MobileDeviceSharp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard20;netstandard21;netcoreapp2.0;netcoreapp2.1;netcoreapp3.0;netcoreapp3.1;net5.0;net6.0 5 | win-x64;win-x86;osx-x64;linux-x64 6 | true 7 | 8 | 9 | 10 | true 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | all 44 | runtime; build; native; contentfiles; analyzers 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | true 55 | $(BaseIntermediateOutputPath)\GeneratedFiles 56 | 57 | 58 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/Native/ClientNewCallback.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace MobileDeviceSharp.Native 6 | { 7 | public delegate TError ClientNewCallback(IDeviceHandle device, LockdownServiceDescriptorHandle lockdownServiceDescriptor, out THandle client) where TError : Enum where THandle : IOSHandle; 8 | } 9 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/Native/ClientNewFromParentServiceCallBack.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MobileDeviceSharp.Native 4 | { 5 | public delegate TChildError ClientNewFromParentServiceCallback(TParentHandle client, out TChildHandle childClient) where TChildError : Enum where TParentHandle : IOSHandle where TChildHandle : IOSHandle; 6 | } 7 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/Native/CustomMashaler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Runtime.InteropServices; 5 | 6 | namespace MobileDeviceSharp.Native 7 | { 8 | /// 9 | /// A strong typed base type which implement ICustomMarshaler. 10 | /// 11 | /// Type of the object to ashal 12 | public abstract class CustomMashaler : ICustomMarshaler 13 | { 14 | void ICustomMarshaler.CleanUpManagedData(object ManagedObj) 15 | { 16 | CleanUpManagedData((T)ManagedObj); 17 | } 18 | 19 | /// 20 | /// Performs necessary cleanup of the managed data when it is no longer needed. 21 | /// 22 | /// The managed object to be destroyed. 23 | public abstract void CleanUpManagedData(T managedObj); 24 | 25 | /// 26 | public abstract void CleanUpNativeData(IntPtr pNativeData); 27 | 28 | /// 29 | public abstract int GetNativeDataSize(); 30 | 31 | IntPtr ICustomMarshaler.MarshalManagedToNative(object ManagedObj) 32 | { 33 | return MarshalManagedToNative((T)ManagedObj); 34 | } 35 | 36 | /// 37 | /// Converts the managed data to unmanaged data. 38 | /// 39 | /// The managed object to be converted. 40 | /// A pointer to the COM view of the managed object. 41 | public abstract IntPtr MarshalManagedToNative(T managedObj); 42 | 43 | object ICustomMarshaler.MarshalNativeToManaged(IntPtr pNativeData) 44 | { 45 | return MarshalNativeToManaged(pNativeData); 46 | } 47 | 48 | /// 49 | /// Converts the unmanaged data to managed data. 50 | /// 51 | /// A pointer to the unmanaged data to be wrapped. 52 | /// An object that represents the managed view of the COM data. 53 | public abstract T MarshalNativeToManaged(IntPtr pNativeData); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/Native/DeviceActivation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace MobileDeviceSharp.Native 6 | { 7 | class DeviceActivation 8 | { 9 | public const string LibraryName = "ideviceactivation"; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/Native/HandleWrapperBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace MobileDeviceSharp.Native 6 | { 7 | /// 8 | /// Represent a base class to create a object oriented wrapper arond features 9 | /// 10 | /// IOSHanlde type 11 | public abstract class IOSHandleWrapperBase : IDisposable where T : IOSHandle, new() 12 | { 13 | 14 | /// 15 | /// Base constructor to wrap already existing Handle 16 | /// 17 | /// The handle to wrap 18 | protected IOSHandleWrapperBase(T handle) 19 | { 20 | Handle = handle; 21 | } 22 | /// 23 | /// Base constructor with without already created handle 24 | /// 25 | protected IOSHandleWrapperBase() 26 | { 27 | Handle = new T(); 28 | } 29 | /// 30 | /// The wrapped handle 31 | /// 32 | public T Handle { get; protected set; } 33 | 34 | /// 35 | /// Virtual method runed on close 36 | /// 37 | protected virtual void OnClose() { } 38 | 39 | /// 40 | /// Close the wrapper 41 | /// 42 | public void Close() 43 | { 44 | OnClose(); 45 | Dispose(); 46 | } 47 | 48 | /// 49 | /// Return true if the is closed 50 | /// 51 | public bool IsClosed => Handle.IsClosed; 52 | 53 | private bool _disposedValue; 54 | 55 | /// 56 | /// Dispose method for releasing managed and unmanaged resources. 57 | /// 58 | /// Indicates if the method is being called from the Dispose method or from the finalizer 59 | protected virtual void Dispose(bool disposing) 60 | { 61 | if (!_disposedValue) 62 | { 63 | if (disposing) 64 | { 65 | Handle.Dispose(); 66 | } 67 | _disposedValue = true; 68 | } 69 | } 70 | 71 | /// 72 | /// Finalizer for releasing unmanaged resources. 73 | /// 74 | ~IOSHandleWrapperBase() 75 | { 76 | Dispose(disposing: false); 77 | } 78 | 79 | /// 80 | public void Dispose() 81 | { 82 | Dispose(disposing: true); 83 | GC.SuppressFinalize(this); 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/Native/IDeviceConnectionType.cs: -------------------------------------------------------------------------------- 1 | namespace MobileDeviceSharp.Native 2 | { 3 | /// 4 | /// Type of connection a device is available on 5 | /// 6 | public enum IDeviceConnectionType : int 7 | { 8 | 9 | /// 10 | /// Represent an USB connection. 11 | /// 12 | Usbmuxd = 1, 13 | 14 | /// 15 | /// Represent a network connection. 16 | /// 17 | Network = 2, 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/Native/IDeviceDebugCallBack.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Runtime.InteropServices; 4 | using System.Text; 5 | 6 | namespace MobileDeviceSharp.Native 7 | { 8 | 9 | [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] 10 | public delegate void IDeviceDebugCallBack(IntPtr message); 11 | } 12 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/Native/IDeviceError.cs: -------------------------------------------------------------------------------- 1 | using MobileDeviceSharp; 2 | 3 | namespace MobileDeviceSharp.Native 4 | { 5 | /// 6 | /// Error Codes 7 | /// 8 | [Exception(typeof(IDeviceException))] 9 | public enum IDeviceError : int 10 | { 11 | 12 | Success = 0, 13 | 14 | InvalidArg = -1, 15 | 16 | UnknownError = -2, 17 | 18 | NoDevice = -3, 19 | 20 | NotEnoughData = -4, 21 | 22 | SslError = -6, 23 | 24 | Timeout = -7, 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/Native/IDeviceEventCallBack.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Runtime.InteropServices; 4 | using System.Text; 5 | 6 | namespace MobileDeviceSharp.Native 7 | { 8 | [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] 9 | public delegate void IDeviceEventCallBack(ref IDeviceEvent @event, System.IntPtr userData); 10 | 11 | [StructLayoutAttribute(LayoutKind.Sequential)] 12 | public struct IDeviceEvent 13 | { 14 | 15 | public IDeviceEventType @event; 16 | 17 | [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] 18 | public string udid; 19 | 20 | public IDeviceConnectionType conn_type; 21 | 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/Native/IDeviceEventType.cs: -------------------------------------------------------------------------------- 1 | namespace MobileDeviceSharp.Native 2 | { 3 | /// 4 | /// The event type for device add or removal 5 | /// 6 | public enum IDeviceEventType : int 7 | { 8 | /// 9 | /// A device is added. 10 | /// 11 | DeviceAdd = 1, 12 | 13 | /// 14 | /// A device is removed. 15 | /// 16 | DeviceRemove = 2, 17 | 18 | /// 19 | /// A device is paired. 20 | /// 21 | DevicePaired = 3, 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/Native/IDeviceListExtendedMarshaler.cs: -------------------------------------------------------------------------------- 1 | using MobileDeviceSharp.Native; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Runtime.InteropServices; 5 | using System.Text; 6 | 7 | namespace MobileDeviceSharp.Native 8 | { 9 | class IDeviceListExtendedMarshaler : IDeviceListMarshaler 10 | { 11 | private static readonly Lazy s_static_instance = new(); 12 | 13 | public override void CleanUpNativeData(IntPtr pNativeData) 14 | { 15 | IDevice.idevice_device_list_extended_free(pNativeData); 16 | } 17 | 18 | public static new IDeviceListExtendedMarshaler GetInstance() 19 | { 20 | return s_static_instance.Value; 21 | } 22 | 23 | public static new ICustomMarshaler GetInstance(string cookie) 24 | { 25 | return s_static_instance.Value; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/Native/IDeviceListMarshaler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Runtime.InteropServices; 4 | using System.Text; 5 | 6 | namespace MobileDeviceSharp.Native 7 | { 8 | 9 | /// 10 | /// A marshaller for the 11 | /// 12 | public class IDeviceListMarshaler : ArrayMarshaller 13 | { 14 | 15 | private static readonly Lazy s_static_instance = new(); 16 | 17 | public override void CleanUpNativeData(IntPtr pNativeData) 18 | { 19 | IDevice.idevice_device_list_free(pNativeData); 20 | } 21 | 22 | public static new IDeviceListMarshaler GetInstance() 23 | { 24 | return s_static_instance.Value; 25 | } 26 | 27 | public static new ICustomMarshaler GetInstance(string cookie) 28 | { 29 | return s_static_instance.Value; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/Native/IOSSafeHandle.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using Microsoft.Win32.SafeHandles; 5 | 6 | namespace MobileDeviceSharp.Native 7 | { 8 | public abstract class IOSHandle : SafeHandleZeroOrMinusOneIsInvalid 9 | { 10 | protected IOSHandle() : this(IntPtr.Zero) 11 | { 12 | 13 | } 14 | 15 | 16 | protected IOSHandle(IntPtr handle) : this(handle, true) 17 | { 18 | 19 | } 20 | 21 | protected IOSHandle(IntPtr handle, bool ownsHandle) : base(ownsHandle) 22 | { 23 | SetHandle(handle); 24 | } 25 | 26 | protected IOSHandle(bool ownsHandle) : this(IntPtr.Zero, ownsHandle) 27 | { 28 | 29 | } 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/Native/LockdownError.cs: -------------------------------------------------------------------------------- 1 | namespace MobileDeviceSharp.Native 2 | { 3 | /// 4 | /// Error Codes 5 | /// 6 | [Exception(typeof(LockdownException))] 7 | public enum LockdownError : int 8 | { 9 | 10 | Success = 0, 11 | 12 | InvalidArg = -1, 13 | 14 | InvalidConf = -2, 15 | 16 | PlistError = -3, 17 | 18 | PairingFailed = -4, 19 | 20 | SslError = -5, 21 | 22 | DictError = -6, 23 | 24 | ReceiveTimeout = -7, 25 | 26 | MuxError = -8, 27 | 28 | NoRunningSession = -9, 29 | 30 | InvalidResponse = -10, 31 | 32 | MissingKey = -11, 33 | 34 | MissingValue = -12, 35 | 36 | GetProhibited = -13, 37 | 38 | SetProhibited = -14, 39 | 40 | RemoveProhibited = -15, 41 | 42 | ImmutableValue = -16, 43 | 44 | PasswordProtected = -17, 45 | 46 | UserDeniedPairing = -18, 47 | 48 | PairingDialogResponsePending = -19, 49 | 50 | MissingHostId = -20, 51 | 52 | InvalidHostId = -21, 53 | 54 | SessionActive = -22, 55 | 56 | SessionInactive = -23, 57 | 58 | MissingSessionId = -24, 59 | 60 | InvalidSessionId = -25, 61 | 62 | MissingService = -26, 63 | 64 | InvalidService = -27, 65 | 66 | ServiceLimit = -28, 67 | 68 | MissingPairRecord = -29, 69 | 70 | SavePairRecordFailed = -30, 71 | 72 | InvalidPairRecord = -31, 73 | 74 | InvalidActivationRecord = -32, 75 | 76 | MissingActivationRecord = -33, 77 | 78 | ServiceProhibited = -34, 79 | 80 | EscrowLocked = -35, 81 | 82 | PairingProhibitedOverThisConnection = -36, 83 | 84 | FmipProtected = -37, 85 | 86 | McProtected = -38, 87 | 88 | McChallengeRequired = -39, 89 | 90 | UnknownError = -256, 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/Native/StartServiceCallback.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace MobileDeviceSharp.Native 6 | { 7 | public delegate TError StartServiceCallback(IDeviceHandle device, out THandle client, string? label) where TError : Enum where THandle : IOSHandle; 8 | } 9 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/Native/UTF8DecomposedMarshaler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Runtime.InteropServices; 4 | using System.Text; 5 | 6 | namespace MobileDeviceSharp.Native 7 | { 8 | /// 9 | /// Rperesent a special with a extra operation to normalize the string from unamanaged to managed and reverse. 10 | /// 11 | public class UTF8DecomposedMarshaler : CustomMashaler 12 | { 13 | private static readonly Lazy s_static_instance = new(); 14 | 15 | private readonly UTF8Marshaler _utf8Marshaler; 16 | 17 | 18 | public UTF8DecomposedMarshaler(UTF8Marshaler utf8Marshaler) 19 | { 20 | _utf8Marshaler = utf8Marshaler; 21 | } 22 | 23 | public UTF8DecomposedMarshaler() 24 | { 25 | _utf8Marshaler = UTF8Marshaler.GetInstance(); 26 | } 27 | 28 | /// . 29 | public override unsafe IntPtr MarshalManagedToNative(string managedObj) 30 | { 31 | var normalized = managedObj.Normalize(NormalizationForm.FormD); 32 | return _utf8Marshaler.MarshalManagedToNative(normalized); 33 | } 34 | 35 | /// . 36 | public override string MarshalNativeToManaged(IntPtr pNativeData) 37 | { 38 | var managedObj = _utf8Marshaler.MarshalNativeToManaged(pNativeData); 39 | var normalized = managedObj.Normalize(NormalizationForm.FormC); 40 | return normalized; 41 | } 42 | 43 | /// . 44 | public override void CleanUpNativeData(IntPtr pNativeData) 45 | { 46 | _utf8Marshaler.CleanUpNativeData(pNativeData); 47 | } 48 | 49 | /// . 50 | public override void CleanUpManagedData(string managedObj) 51 | { 52 | _utf8Marshaler.CleanUpManagedData(managedObj); 53 | } 54 | 55 | /// . 56 | public override int GetNativeDataSize() 57 | { 58 | return _utf8Marshaler.GetNativeDataSize(); 59 | } 60 | 61 | public static UTF8DecomposedMarshaler GetInstance() 62 | { 63 | return s_static_instance.Value; 64 | } 65 | 66 | public static ICustomMarshaler GetInstance(string cookie) 67 | { 68 | return s_static_instance.Value; 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/Native/UTF8Marshaler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Buffers.Text; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | using System.Runtime.InteropServices; 6 | using System.Text; 7 | 8 | namespace MobileDeviceSharp.Native 9 | { 10 | /// 11 | /// A marshaller for UTF8 string. 12 | /// 13 | public class UTF8Marshaler : CustomMashaler 14 | { 15 | private static readonly Lazy s_static_instance = new(); 16 | 17 | /// 18 | public override unsafe IntPtr MarshalManagedToNative(string managedObj) 19 | { 20 | // managedObj is not null terminated 21 | int nb = Encoding.UTF8.GetMaxByteCount(managedObj.Length); 22 | 23 | IntPtr ptr = Marshal.AllocHGlobal(nb + 1); 24 | 25 | int nbWritten; 26 | byte* pbMem = (byte*)ptr; 27 | 28 | fixed (char* firstChar = managedObj) 29 | { 30 | nbWritten = Encoding.UTF8.GetBytes(firstChar, managedObj.Length, pbMem, nb); 31 | } 32 | 33 | pbMem[nbWritten] = 0; 34 | 35 | return ptr; 36 | } 37 | 38 | /// 39 | public override string MarshalNativeToManaged(IntPtr pNativeData) 40 | { 41 | #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP1_1_OR_GREATER 42 | return Marshal.PtrToStringUTF8(pNativeData)!; 43 | #else 44 | unsafe 45 | { 46 | byte* walk = (byte*)pNativeData; 47 | 48 | // find the end of the string 49 | while (*walk != 0) 50 | { 51 | walk++; 52 | } 53 | int length = (int)(walk - (byte*)pNativeData); 54 | 55 | // should not be null terminated 56 | // skip the trailing null 57 | string data = Encoding.UTF8.GetString((byte*)pNativeData, length); 58 | return data; 59 | } 60 | #endif 61 | } 62 | 63 | /// 64 | public override void CleanUpNativeData(IntPtr pNativeData) 65 | { 66 | Marshal.FreeHGlobal(pNativeData); 67 | } 68 | 69 | /// 70 | public override void CleanUpManagedData(string managedObj) 71 | { 72 | } 73 | 74 | /// 75 | public override int GetNativeDataSize() 76 | { 77 | return -1; 78 | } 79 | 80 | public static UTF8Marshaler GetInstance() 81 | { 82 | return s_static_instance.Value; 83 | } 84 | 85 | public static ICustomMarshaler GetInstance(string cookie) 86 | { 87 | return s_static_instance.Value; 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/Native/lockdownd_client_private.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Runtime.InteropServices; 4 | using System.Text; 5 | 6 | namespace MobileDeviceSharp.Native 7 | { 8 | #pragma warning disable IDE1006 // Naming styles (because this struct is used for PInvoke) 9 | [StructLayout(LayoutKind.Sequential)] 10 | internal struct lockdownd_client_private 11 | { 12 | internal IntPtr parent; 13 | 14 | internal int ssl_enabled; 15 | internal IntPtr session_id; 16 | internal IntPtr udid; 17 | internal IntPtr label; 18 | internal uint mux_id; 19 | } 20 | #pragma warning restore IDE1006 // Naming styles (because this struct is used for PInvoke) 21 | } 22 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/NotificationProxy/InsecureNotificationProxySession.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace MobileDeviceSharp.NotificationProxy 6 | { 7 | /// 8 | /// An insecure version of the to use when the device is not pared 9 | /// 10 | public sealed class InsecureNotificationProxySession : NotificationProxySessionBase 11 | { 12 | const string ServiceID = "com.apple.mobile.insecure_notification_proxy"; 13 | 14 | /// 15 | public InsecureNotificationProxySession(IDevice device) : base(device, ServiceID, false) { } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/NotificationProxy/Native/NotificationProxyError.cs: -------------------------------------------------------------------------------- 1 | namespace MobileDeviceSharp.NotificationProxy.Native 2 | { 3 | /// 4 | /// Error Codes 5 | /// 6 | [Exception(typeof(NotificationProxyException))] 7 | public enum NotificationProxyError : int 8 | { 9 | 10 | Success = 0, 11 | 12 | InvalidArg = -1, 13 | 14 | PlistError = -2, 15 | 16 | ConnFailed = -3, 17 | 18 | UnknownError = -256, 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/NotificationProxy/Native/NotificationProxyEvents.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using MobileDeviceSharp.NotificationProxy; 5 | 6 | namespace MobileDeviceSharp.NotificationProxy.Native 7 | { 8 | /// 9 | /// Represent a struct containing a list of NotificationProxy events. 10 | /// 11 | public struct NotificationProxyEvents 12 | { 13 | 14 | /// 15 | /// Event that can be send with 16 | /// 17 | public struct Sendable 18 | { 19 | public const string NP_SYNC_WILL_START = "com.apple.itunes-mobdev.syncWillStart"; 20 | public const string NP_SYNC_DID_START = "com.apple.itunes-mobdev.syncDidStart"; 21 | public const string NP_SYNC_DID_FINISH = "com.apple.itunes-mobdev.syncDidFinish"; 22 | public const string NP_SYNC_LOCK_REQUEST = "com.apple.itunes-mobdev.syncLockRequest"; 23 | } 24 | /// 25 | /// Event that can be receved by with or . 26 | /// 27 | public struct Recevable 28 | { 29 | /// Event Can be receved 30 | public const string NP_SYNC_CANCEL_REQUEST = "com.apple.itunes-client.syncCancelRequest"; 31 | public const string NP_SYNC_SUSPEND_REQUEST = "com.apple.itunes-client.syncSuspendRequest"; 32 | public const string NP_SYNC_RESUME_REQUEST = "com.apple.itunes-client.syncResumeRequest"; 33 | public const string NP_PHONE_NUMBER_CHANGED = "com.apple.mobile.lockdown.phone_number_changed"; 34 | public const string NP_DEVICE_NAME_CHANGED = "com.apple.mobile.lockdown.device_name_changed"; 35 | public const string NP_TIMEZONE_CHANGED = "com.apple.mobile.lockdown.timezone_changed"; 36 | public const string NP_TRUSTED_HOST_ATTACHED = "com.apple.mobile.lockdown.trusted_host_attached"; 37 | public const string NP_HOST_DETACHED = "com.apple.mobile.lockdown.host_detache"; 38 | public const string NP_HOST_ATTACHED = "com.apple.mobile.lockdown.host_attached"; 39 | public const string NP_REGISTRATION_FAILED = "com.apple.mobile.lockdown.registration_failed"; 40 | public const string NP_ACTIVATION_STATE = "com.apple.mobile.lockdown.activation_state"; 41 | public const string NP_BRICK_STATE = "com.apple.mobile.lockdown.brick_state"; 42 | public const string NP_DISK_USAGE_CHANGED = "com.apple.mobile.lockdown.disk_usage_changed"; 43 | public const string NP_DS_DOMAIN_CHANGED = "com.apple.mobile.data_sync.domain_changed"; 44 | public const string NP_APP_INSTALLED = "com.apple.mobile.application_installed"; 45 | public const string NP_APP_UNINSTALLED = "com.apple.mobile.application_uninstalled"; 46 | public const string NP_DEV_IMAGE_MOUNTED = "com.apple.mobile.developer_image_mounted"; 47 | public const string NP_ATTEMPTACTIVATION = "com.apple.springboard.attemptactivation"; 48 | public const string NP_ITDBPREP_DID_END = "com.apple.itdbprep.notification.didEnd"; 49 | public const string NP_LANGUAGE_CHANGED = "com.apple.language.changed"; 50 | public const string NP_ADDRESS_BOOK_PREF_CHANGED = "com.apple.AddressBook.PreferenceChanged"; 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/NotificationProxy/Native/NotificationProxyNotifyCallBack.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace MobileDeviceSharp.NotificationProxy.Native 4 | { 5 | [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] 6 | public delegate void NotificationProxyNotifyCallBack([MarshalAsAttribute(UnmanagedType.LPStr)] string notification, System.IntPtr userData); 7 | } 8 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/NotificationProxy/NotificationProxyEvent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace MobileDeviceSharp.NotificationProxy 6 | { 7 | /// 8 | /// Represent the handler for NotificationProxy events 9 | /// 10 | /// The sender, Normaly an object that herits from . 11 | /// The event args. 12 | public delegate void NotificationProxyEventHandler(object sender, NotificationProxyEventArgs e); 13 | } 14 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/NotificationProxy/NotificationProxyEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace MobileDeviceSharp.NotificationProxy 6 | { 7 | /// 8 | /// Class that contains event argument for events 9 | /// 10 | public sealed class NotificationProxyEventArgs : EventArgs 11 | { 12 | /// 13 | /// The name of the notificationproxy event. Lot of constants are available . 14 | /// 15 | public string EventName { get; } 16 | 17 | /// 18 | /// Create the event args. 19 | /// 20 | /// The event name 21 | public NotificationProxyEventArgs(string name) : base() 22 | { 23 | EventName = name; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/NotificationProxy/NotificationProxySessionBase.Events.cs: -------------------------------------------------------------------------------- 1 | using MobileDeviceSharp.Native; 2 | using MobileDeviceSharp.NotificationProxy.Native; 3 | using static MobileDeviceSharp.NotificationProxy.Native.NotificationProxy; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | 8 | namespace MobileDeviceSharp.NotificationProxy 9 | { 10 | public abstract partial class NotificationProxySessionBase 11 | { 12 | private ConcurrentCollections.ConcurrentHashSet _eventIDS = new(); 13 | 14 | /// 15 | /// Define the notification we want to observe. A lot of constants are available on 16 | /// 17 | /// 18 | public void ObserveNotification(params string[] notifications) 19 | { 20 | var result = np_observe_notifications(Handle, notifications); 21 | if (result.IsError()) 22 | { 23 | throw result.GetException(); 24 | } 25 | else 26 | { 27 | foreach (var notification in notifications) 28 | { 29 | _eventIDS.Add(notification); 30 | } 31 | } 32 | } 33 | 34 | /// 35 | /// Define the notification we want to observe. A lot of constants are available on 36 | /// 37 | /// 38 | public void ObserveNotification(string notification) 39 | { 40 | var result = np_observe_notification(Handle, notification); 41 | if (result.IsError()) 42 | { 43 | throw result.GetException(); 44 | } 45 | else 46 | { 47 | _eventIDS.Add(notification); 48 | } 49 | } 50 | 51 | private void EventCallback(string notification) 52 | { 53 | _context.Post(_ => DeviceRaiseEvent(new NotificationProxyEventArgs(notification)), null); 54 | } 55 | 56 | private void DeviceRaiseEvent(NotificationProxyEventArgs e) 57 | { 58 | NotificationProxyEvent?.Invoke(this, e); 59 | } 60 | 61 | /// 62 | /// Raise event to the device 63 | /// 64 | /// The event args 65 | public void RaiseEvent(NotificationProxyEventArgs e) 66 | { 67 | RaiseEvent(e.EventName); 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/PairingState.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using MobileDeviceSharp.Native; 5 | 6 | namespace MobileDeviceSharp 7 | { 8 | /// 9 | /// Represent the different possible state for the pairing status. 10 | /// 11 | public enum PairingState 12 | { 13 | /// 14 | /// The device is paired. 15 | /// 16 | Success = LockdownError.Success, 17 | 18 | /// 19 | /// The device is password protected. 20 | /// 21 | PasswordProtected = LockdownError.PasswordProtected, 22 | 23 | /// 24 | /// The user denied the pairing process. 25 | /// 26 | UserDeniedPairing = LockdownError.UserDeniedPairing, 27 | 28 | /// 29 | /// Waiting for user to accept the pairing dialog. 30 | /// 31 | PairingDialogResponsePending = LockdownError.PairingDialogResponsePending, 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/PropertyList/Native/PlistHandle.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace MobileDeviceSharp.PropertyList.Native 6 | { 7 | public partial class PlistHandle 8 | { 9 | internal PlistHandle(IntPtr handle, bool ownsHandle) : base(handle, ownsHandle) 10 | { 11 | 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/PropertyList/Native/PlistHandleNotOwnedMarshaller.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Runtime.InteropServices; 4 | using System.Text; 5 | using MobileDeviceSharp.Native; 6 | 7 | namespace MobileDeviceSharp.PropertyList.Native 8 | { 9 | public class PlistHandleNotOwnedMarshaler : CustomMashaler 10 | { 11 | private static readonly Lazy s_static_instance = new(); 12 | 13 | public override void CleanUpManagedData(PlistHandle managedObj) 14 | { 15 | 16 | } 17 | public override void CleanUpNativeData(IntPtr pNativeData) 18 | { 19 | 20 | } 21 | public override int GetNativeDataSize() 22 | { 23 | return -1; 24 | } 25 | public override IntPtr MarshalManagedToNative(PlistHandle managedObj) 26 | { 27 | return managedObj.DangerousGetHandle(); 28 | } 29 | public override PlistHandle MarshalNativeToManaged(IntPtr pNativeData) 30 | { 31 | return new PlistHandle(pNativeData, false); 32 | } 33 | 34 | public static new ICustomMarshaler GetInstance(string cookie) 35 | { 36 | return s_static_instance.Value; 37 | } 38 | 39 | public static new PlistHandleNotOwnedMarshaler GetInstance() 40 | { 41 | return s_static_instance.Value; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/PropertyList/Native/PlistType.cs: -------------------------------------------------------------------------------- 1 | namespace MobileDeviceSharp.PropertyList.Native 2 | { 3 | /// 4 | /// Represents the enumeration of possible types of a node in a Property List (plist) file. 5 | /// 6 | public enum PlistType : int 7 | { 8 | /// 9 | /// A boolean value (true or false). 10 | /// 11 | Boolean = 0, 12 | 13 | /// 14 | /// An unsigned integer value. 15 | /// 16 | Uint = 1, 17 | 18 | /// 19 | /// A floating-point value. 20 | /// 21 | Real = 2, 22 | 23 | /// 24 | /// A string value. 25 | /// 26 | String = 3, 27 | 28 | /// 29 | /// An array of nodes. 30 | /// 31 | Array = 4, 32 | 33 | /// 34 | /// A dictionary of nodes, where each node has a unique key. 35 | /// 36 | Dict = 5, 37 | 38 | /// 39 | /// A date/time value. 40 | /// 41 | Date = 6, 42 | 43 | /// 44 | /// Binary data. 45 | /// 46 | Data = 7, 47 | 48 | /// 49 | /// A key value in a dictionary node. 50 | /// 51 | Key = 8, 52 | 53 | /// 54 | /// An unsigned integer value used as a unique identifier. 55 | /// 56 | Uid = 9, 57 | 58 | /// 59 | /// Indicates that no type has been assigned to the node. 60 | /// 61 | None = 10, 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/PropertyList/PlistArrayEnumerator.cs: -------------------------------------------------------------------------------- 1 | using MobileDeviceSharp.PropertyList.Native; 2 | using System; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | using static MobileDeviceSharp.PropertyList.Native.Plist; 7 | 8 | namespace MobileDeviceSharp.PropertyList 9 | { 10 | public partial class PlistArray 11 | { 12 | /// 13 | private sealed class Enumerator : IEnumerator 14 | { 15 | private readonly PlistArray _root; 16 | private PlistArrayIterHandle _iterHandle; 17 | 18 | /// 19 | public Enumerator(PlistArray root) 20 | { 21 | _root = root; 22 | plist_array_new_iter(_root.Handle, out _iterHandle); 23 | } 24 | 25 | #pragma warning disable IDE0032 // Use auto-property (auto readonly property not working because we set the _current in MoveNext) 26 | private PlistNode _current; 27 | #pragma warning restore IDE0032 // Use auto-property (auto readonly property not working because we set the _current in MoveNext) 28 | 29 | /// 30 | public PlistNode Current => _current; 31 | 32 | object IEnumerator.Current => _current; 33 | 34 | /// 35 | public void Dispose() 36 | { 37 | _iterHandle.Dispose(); 38 | } 39 | 40 | /// 41 | public bool MoveNext() 42 | { 43 | plist_array_next_item(_root.Handle, _iterHandle, out var currentHandle); 44 | var success = !currentHandle.IsInvalid; 45 | if (success) 46 | { 47 | _current = From(currentHandle)!; 48 | } 49 | return success; 50 | } 51 | 52 | /// 53 | public void Reset() 54 | { 55 | _iterHandle.Dispose(); 56 | plist_array_new_iter(_root.Handle, out _iterHandle); 57 | } 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/PropertyList/PlistBoolean.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using MobileDeviceSharp.PropertyList.Native; 5 | using static MobileDeviceSharp.PropertyList.Native.Plist; 6 | 7 | namespace MobileDeviceSharp.PropertyList 8 | { 9 | /// 10 | /// Represent a plist node that contain . 11 | /// 12 | public sealed class PlistBoolean : PlistValueNode 13 | { 14 | /// 15 | /// Create plist node from an existing handle. 16 | /// 17 | /// The of type to wrap. 18 | public PlistBoolean(PlistHandle handle) : base(handle) 19 | { 20 | 21 | } 22 | 23 | /// 24 | /// Create plist node. 25 | /// 26 | public PlistBoolean() : this(default(bool)) 27 | { 28 | 29 | } 30 | 31 | /// 32 | /// Create plist node from a value. 33 | /// 34 | /// the value. 35 | public PlistBoolean(bool value) : base(plist_new_bool(value)) 36 | { 37 | 38 | } 39 | 40 | /// 41 | public override bool Value 42 | { 43 | get 44 | { 45 | plist_get_bool_val(Handle, out var val); 46 | return val; 47 | } 48 | set => plist_set_bool_val(Handle, value); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/PropertyList/PlistContainer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | using System.Runtime.InteropServices; 6 | using System.Text; 7 | using MobileDeviceSharp.PropertyList.Native; 8 | using static MobileDeviceSharp.PropertyList.Native.Plist; 9 | 10 | namespace MobileDeviceSharp.PropertyList 11 | { 12 | /// 13 | /// Represent a container of . 14 | /// 15 | public abstract class PlistContainer : PlistNode, 16 | ICollection, 17 | IEnumerable 18 | { 19 | 20 | /// 21 | public abstract int Count { get; } 22 | bool ICollection.IsSynchronized => false; 23 | private object _syncRoot = new(); 24 | object ICollection.SyncRoot => _syncRoot; 25 | 26 | /// 27 | /// Get plist container from handle. 28 | /// 29 | /// 30 | public PlistContainer(PlistHandle handle) : base(handle) 31 | { 32 | 33 | } 34 | 35 | void ICollection.CopyTo(Array array, int index) 36 | { 37 | var i = index; 38 | foreach (var item in this) 39 | { 40 | array.SetValue(CloneItem(item), i); 41 | i++; 42 | } 43 | } 44 | 45 | /// 46 | /// Clone an item in the container. 47 | /// 48 | /// The item. 49 | /// 50 | protected abstract object CloneItem(object item); 51 | 52 | IEnumerator IEnumerable.GetEnumerator() => CoreGetEnumerator(); 53 | 54 | /// 55 | /// Get the for the container. 56 | /// 57 | /// An new instance of the enumerator 58 | protected abstract IEnumerator CoreGetEnumerator(); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/PropertyList/PlistData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using MobileDeviceSharp.PropertyList.Native; 5 | using static MobileDeviceSharp.PropertyList.Native.Plist; 6 | 7 | namespace MobileDeviceSharp.PropertyList 8 | { 9 | /// 10 | /// Represent a plist node that contain bytes data. 11 | /// 12 | public sealed class PlistData : PlistValueNode 13 | { 14 | /// 15 | /// Create data plist node from an existing handle. 16 | /// 17 | /// The of type to wrap. 18 | public PlistData(PlistHandle handle) : base(handle) 19 | { 20 | 21 | } 22 | 23 | /// 24 | /// Initialize new from a byte array. 25 | /// 26 | /// The data. 27 | public PlistData(byte[] value) : base(Create(value)) 28 | { 29 | 30 | } 31 | 32 | private static PlistHandle Create(byte[] value) 33 | { 34 | return plist_new_data(value, (uint)value.Length); 35 | } 36 | /// 37 | /// Initialize new from a . 38 | /// 39 | /// The data. 40 | public PlistData(ReadOnlySpan value) : base(Create(value)) 41 | { 42 | 43 | } 44 | 45 | private static unsafe PlistHandle Create(ReadOnlySpan value) 46 | { 47 | fixed(byte* ptr = value) 48 | { 49 | return plist_new_data(ptr, (uint)value.Length); 50 | } 51 | } 52 | 53 | /// 54 | public override byte[] Value 55 | { 56 | get 57 | { 58 | plist_get_data_val(Handle, out var val, out _); 59 | return val; 60 | } 61 | set => plist_set_data_val(Handle,value, (ulong)value.Length); 62 | } 63 | 64 | /// 65 | /// Get a to have a readonly access to the data without copying them. 66 | /// 67 | /// A pointing to the underlying data. 68 | public ReadOnlySpan AsReadOnlySpan() 69 | { 70 | unsafe 71 | { 72 | var ptr = (byte*)plist_get_data_ptr(Handle, out var length); 73 | return new ReadOnlySpan(ptr, (int)length); 74 | } 75 | } 76 | 77 | public static implicit operator ReadOnlySpan(PlistData plist) 78 | { 79 | return plist.AsReadOnlySpan(); 80 | } 81 | } 82 | } 83 | 84 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/PropertyList/PlistDate.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using MobileDeviceSharp.PropertyList.Native; 5 | using static MobileDeviceSharp.PropertyList.Native.Plist; 6 | 7 | namespace MobileDeviceSharp.PropertyList 8 | { 9 | /// 10 | /// Represent a plist node that contain value. 11 | /// 12 | public sealed partial class PlistDate : PlistValueNode 13 | { 14 | 15 | /// 16 | /// Create plist node from an existing handle. 17 | /// 18 | /// The of type to wrap. 19 | public PlistDate(PlistHandle handle) : base(handle) 20 | { 21 | 22 | } 23 | 24 | /// 25 | /// Initialize a new Plist node with the default . 26 | /// 27 | public PlistDate() : this(new DateValue()) 28 | { 29 | 30 | } 31 | 32 | /// 33 | /// Initialize a new Plist docs with the specified . 34 | /// 35 | /// The value. 36 | public PlistDate(DateTime date) : this((DateValue)date) 37 | { 38 | 39 | } 40 | 41 | private PlistDate(DateValue date) : base(plist_new_date(date.sec, date.usec)) 42 | { 43 | 44 | } 45 | 46 | 47 | private static readonly DateTime s_baseDateTime = new(2001, 1, 1, 0, 0, 0, DateTimeKind.Utc); 48 | 49 | /// 50 | public override DateTime Value 51 | { 52 | get 53 | { 54 | plist_get_date_val(Handle, out var sec, out var microsec); 55 | return new DateValue(sec, microsec); 56 | } 57 | set 58 | { 59 | (int sec, int microsec) = (DateValue)value; 60 | plist_set_date_val(Handle, sec, microsec); 61 | } 62 | } 63 | } 64 | } 65 | 66 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/PropertyList/PlistDateValue.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace MobileDeviceSharp.PropertyList 6 | { 7 | 8 | public sealed partial class PlistDate 9 | { 10 | private record struct DateValue(int sec, int usec) 11 | { 12 | 13 | public static implicit operator DateTime(DateValue d) 14 | { 15 | (int sec, int microsec) = d; 16 | var milisec = microsec * 1e-3; 17 | return s_baseDateTime.AddSeconds(sec).AddMilliseconds(milisec); 18 | } 19 | public static explicit operator DateValue(DateTime dt) 20 | { 21 | var timespan = dt - s_baseDateTime; 22 | int sec = (int)timespan.TotalSeconds; 23 | timespan = timespan.Subtract(TimeSpan.FromSeconds(sec)); 24 | int microsec = (int)(timespan.Ticks / (TimeSpan.TicksPerMillisecond * 1e-3)); 25 | return new DateValue(sec, microsec); 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/PropertyList/PlistDictionaryEnumerator.cs: -------------------------------------------------------------------------------- 1 | using MobileDeviceSharp.Native; 2 | using MobileDeviceSharp.PropertyList.Native; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Runtime.InteropServices; 7 | using System.Text; 8 | using static MobileDeviceSharp.PropertyList.Native.Plist; 9 | 10 | namespace MobileDeviceSharp.PropertyList 11 | { 12 | public partial class PlistDictionary 13 | { 14 | 15 | private class Enumerator : IEnumerator> 16 | { 17 | private readonly PlistDictionary _root; 18 | private PlistDictIterHandle _iterHandle; 19 | 20 | public Enumerator(PlistDictionary root) 21 | { 22 | _root = root; 23 | plist_dict_new_iter(_root.Handle, out _iterHandle); 24 | } 25 | 26 | private KeyValuePair _current; 27 | public KeyValuePair Current => _current; 28 | 29 | object IEnumerator.Current => _current; 30 | 31 | public void Dispose() 32 | { 33 | _iterHandle.Dispose(); 34 | } 35 | 36 | public bool MoveNext() 37 | { 38 | plist_dict_next_item(_root.Handle, _iterHandle, out var key, out var currentHandle); 39 | if (key == IntPtr.Zero) 40 | { 41 | return false; 42 | } 43 | string dicKey = UTF8Marshaler.GetInstance().MarshalNativeToManaged(key); 44 | if (dicKey == null) 45 | { 46 | throw new NullReferenceException(); 47 | } 48 | _current = new KeyValuePair(dicKey, From(currentHandle)); 49 | UTF8Marshaler.GetInstance().CleanUpNativeData(key); 50 | return true; 51 | } 52 | 53 | public void Reset() 54 | { 55 | _iterHandle.Dispose(); 56 | plist_dict_new_iter(_root.Handle, out _iterHandle); 57 | } 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/PropertyList/PlistDictionaryKeysCollection.cs: -------------------------------------------------------------------------------- 1 |  using System.Collections; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace MobileDeviceSharp.PropertyList 6 | { 7 | public partial class PlistDictionary 8 | { 9 | private class KeysCollection : 10 | ICollection, 11 | IEnumerable, 12 | IReadOnlyCollection 13 | { 14 | private readonly PlistDictionary _dict; 15 | 16 | public KeysCollection(PlistDictionary plistDictionary) 17 | { 18 | _dict = plistDictionary; 19 | } 20 | 21 | public int Count => _dict.Count; 22 | 23 | public bool IsReadOnly => true; 24 | 25 | void ICollection.Add(string item) 26 | { 27 | throw new System.NotSupportedException(); 28 | } 29 | 30 | void ICollection.Clear() 31 | { 32 | throw new System.NotSupportedException(); 33 | } 34 | 35 | public bool Contains(string item) 36 | { 37 | return _dict.ContainsKey(item); 38 | } 39 | 40 | public void CopyTo(string[] array, int arrayIndex) 41 | { 42 | var i = arrayIndex; 43 | foreach (var item in this) 44 | { 45 | array[i] = item; 46 | i++; 47 | } 48 | } 49 | 50 | public IEnumerator GetEnumerator() 51 | { 52 | return _dict.Select(i => i.Key).GetEnumerator(); 53 | } 54 | 55 | bool ICollection.Remove(string item) 56 | { 57 | throw new System.NotSupportedException(); 58 | } 59 | 60 | IEnumerator IEnumerable.GetEnumerator() 61 | { 62 | return GetEnumerator(); 63 | } 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/PropertyList/PlistDictionaryValuesCollection.cs: -------------------------------------------------------------------------------- 1 | using static MobileDeviceSharp.PropertyList.Native.Plist; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | 6 | namespace MobileDeviceSharp.PropertyList 7 | { 8 | public partial class PlistDictionary 9 | { 10 | private class ValuesCollection : 11 | ICollection, 12 | IEnumerable, 13 | IReadOnlyCollection 14 | { 15 | private readonly PlistDictionary _dict; 16 | 17 | public ValuesCollection(PlistDictionary plistDictionary) 18 | { 19 | _dict = plistDictionary; 20 | } 21 | 22 | public int Count => _dict.Count; 23 | 24 | public bool IsReadOnly => true; 25 | 26 | void ICollection.Add(PlistNode item) 27 | { 28 | throw new System.NotSupportedException(); 29 | } 30 | 31 | void ICollection.Clear() 32 | { 33 | throw new System.NotSupportedException(); 34 | } 35 | 36 | public bool Contains(PlistNode item) 37 | { 38 | return item.Parent.Equals(_dict); 39 | } 40 | 41 | public void CopyTo(PlistNode[] array, int arrayIndex) 42 | { 43 | var i = arrayIndex; 44 | foreach (var item in this) 45 | { 46 | array[i] = item.Clone(); 47 | i++; 48 | } 49 | } 50 | 51 | public IEnumerator GetEnumerator() 52 | { 53 | return _dict.Select(i => i.Value).GetEnumerator(); 54 | } 55 | 56 | bool ICollection.Remove(PlistNode item) 57 | { 58 | throw new System.NotSupportedException(); 59 | } 60 | 61 | IEnumerator IEnumerable.GetEnumerator() 62 | { 63 | return GetEnumerator(); 64 | } 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/PropertyList/PlistDocumentFormats.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace MobileDeviceSharp.PropertyList 6 | { 7 | /// 8 | /// Represent the format of a . 9 | /// 10 | public enum PlistDocumentFormats 11 | { 12 | /// 13 | /// The binary plist format. 14 | /// 15 | Binary, 16 | 17 | /// 18 | /// The XML plist format. 19 | /// 20 | XML 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/PropertyList/PlistInteger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using MobileDeviceSharp.PropertyList.Native; 5 | using static MobileDeviceSharp.PropertyList.Native.Plist; 6 | 7 | namespace MobileDeviceSharp.PropertyList 8 | { 9 | /// 10 | /// Represent a plist node that contain an integer value. 11 | /// 12 | public sealed class PlistInteger : PlistValueNode 13 | { 14 | /// 15 | /// Create plist node from an existing handle. 16 | /// 17 | /// The of type to wrap. 18 | public PlistInteger(PlistHandle handle) : base(handle) 19 | { 20 | 21 | } 22 | 23 | /// 24 | /// Create plist node. 25 | /// 26 | public PlistInteger(): this(default(int)) 27 | { 28 | 29 | } 30 | 31 | /// 32 | /// Create plist node from a value. 33 | /// 34 | /// the value. 35 | public PlistInteger(long Value) : base(plist_new_uint(Value)) 36 | { 37 | 38 | } 39 | 40 | /// . 41 | public override long Value 42 | { 43 | get 44 | { 45 | plist_get_uint_val(Handle, out long value); 46 | return value; 47 | } 48 | set => plist_set_uint_val(Handle, value); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/PropertyList/PlistKey.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using MobileDeviceSharp.PropertyList.Native; 5 | using static MobileDeviceSharp.PropertyList.Native.Plist; 6 | 7 | namespace MobileDeviceSharp.PropertyList 8 | { 9 | /// 10 | /// Represent a key to a plistNode 11 | /// 12 | public sealed class PlistKey : PlistValueNode 13 | { 14 | /// 15 | /// Create plist key node from an existing handle. 16 | /// 17 | /// The of type to wrap. 18 | public PlistKey(PlistHandle handle) : base(handle) 19 | { 20 | 21 | } 22 | 23 | /// 24 | public override string Value 25 | { 26 | get 27 | { 28 | plist_get_key_val(Handle, out string val); 29 | return val; 30 | } 31 | set => plist_set_key_val(Handle, value); 32 | } 33 | } 34 | } 35 | 36 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/PropertyList/PlistReal.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using MobileDeviceSharp.PropertyList.Native; 5 | using static MobileDeviceSharp.PropertyList.Native.Plist; 6 | 7 | namespace MobileDeviceSharp.PropertyList 8 | { 9 | /// 10 | /// Represent a Plist node that contain a real () value. 11 | /// 12 | public sealed class PlistReal : PlistValueNode 13 | { 14 | /// 15 | /// Create plist node from an existing handle. 16 | /// 17 | /// The of type to wrap. 18 | public PlistReal(PlistHandle handle) : base(handle) 19 | { 20 | 21 | } 22 | 23 | /// 24 | /// Create plist node. 25 | /// 26 | public PlistReal() : this(default(double)) 27 | { 28 | 29 | } 30 | 31 | /// 32 | /// Create plist node from a value. 33 | /// 34 | /// the value. 35 | public PlistReal(double value) : base(plist_new_real(value)) 36 | { 37 | 38 | } 39 | 40 | /// 41 | public override double Value 42 | { 43 | get 44 | { 45 | plist_get_real_val(Handle, out var val); 46 | return val; 47 | } 48 | set => plist_set_real_val(Handle, value); 49 | } 50 | } 51 | } 52 | 53 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/PropertyList/PlistString.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Text; 5 | using MobileDeviceSharp.PropertyList.Native; 6 | using static MobileDeviceSharp.PropertyList.Native.Plist; 7 | 8 | namespace MobileDeviceSharp.PropertyList 9 | { 10 | /// 11 | /// Represent a plist node which contain a value. 12 | /// 13 | public sealed class PlistString : PlistValueNode 14 | { 15 | /// 16 | /// Create plist node from an existing handle. 17 | /// 18 | /// The of type to wrap. 19 | public PlistString(PlistHandle handle) : base(handle) 20 | { 21 | 22 | } 23 | 24 | /// 25 | /// Create plist node from a value. 26 | /// 27 | /// The value. 28 | public PlistString(string value) : base(plist_new_string(value)) 29 | { 30 | 31 | } 32 | 33 | /// 34 | /// Create plist node from a . 35 | /// 36 | /// The value as . 37 | public PlistString(ReadOnlySpan value) : base(plist_new_string(new string(value.ToArray()))) 38 | { 39 | 40 | } 41 | 42 | public override string Value 43 | { 44 | get 45 | { 46 | plist_get_string_val(Handle, out string val); 47 | return val; 48 | } 49 | set => plist_set_string_val(Handle, value); 50 | } 51 | 52 | /// 53 | /// Get a in order to have access to the underlying string without copying it. 54 | /// 55 | /// A that wrap the string containing in this 56 | public TextReader GetReader() 57 | { 58 | unsafe 59 | { 60 | var ptr = (byte*)plist_get_string_ptr(Handle, out var length); 61 | var stream = new UnmanagedMemoryStream(ptr, (long)length,(long)length,FileAccess.Read); 62 | return new StreamReader(stream, Encoding.UTF8); 63 | } 64 | } 65 | } 66 | } 67 | 68 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/PropertyList/PlistUID.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using MobileDeviceSharp.PropertyList.Native; 5 | using static MobileDeviceSharp.PropertyList.Native.Plist; 6 | 7 | namespace MobileDeviceSharp.PropertyList 8 | { 9 | /// 10 | /// Represent a plist node that contain . 11 | /// 12 | public sealed class PlistUid : PlistValueNode 13 | { 14 | /// 15 | /// Create plist node from an existing handle. 16 | /// 17 | /// The of type to wrap. 18 | public PlistUid(PlistHandle handle) : base(handle) 19 | { 20 | 21 | } 22 | 23 | /// 24 | /// Create plist node. 25 | /// 26 | public PlistUid() : this(default(long)) 27 | { 28 | 29 | } 30 | 31 | /// 32 | /// Create plist node from a value. 33 | /// 34 | /// the value. 35 | public PlistUid(long value) : base(plist_new_uid(value)) 36 | { 37 | 38 | } 39 | 40 | /// 41 | public override long Value 42 | { 43 | get 44 | { 45 | plist_get_uid_val(Handle, out long val); 46 | return val; 47 | } 48 | set => plist_set_uid_val(Handle, value); 49 | } 50 | } 51 | } 52 | 53 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/PropertyList/PlistValueNode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using MobileDeviceSharp.PropertyList.Native; 5 | 6 | namespace MobileDeviceSharp.PropertyList 7 | { 8 | /// 9 | /// Represent an abstract class for Plist node wich contain value. 10 | /// 11 | /// The value type 12 | public abstract class PlistValueNode : PlistNode where T : notnull 13 | { 14 | /// 15 | /// Represent a containing a . 16 | /// 17 | /// 18 | protected PlistValueNode(PlistHandle handle) : base(handle) 19 | { 20 | 21 | } 22 | 23 | /// 24 | /// Get or set the value. 25 | /// 26 | public abstract T Value { get; set; } 27 | 28 | public static explicit operator T(PlistValueNode node) => node.Value; 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/ServiceSessionBase.cs: -------------------------------------------------------------------------------- 1 | using MobileDeviceSharp.Native; 2 | using Microsoft.Win32.SafeHandles; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace MobileDeviceSharp 8 | { 9 | /// 10 | /// Represent a base class for a libmobiledevice service. 11 | /// 12 | /// The type of . 13 | /// The type of the enum representing the hresult of the service methods. 14 | public abstract class ServiceSessionBase : IOSHandleWrapperBase where THandle : IOSHandle,new() where TError : Enum 15 | { 16 | /// 17 | /// Initialize a service session. 18 | /// 19 | /// The targeted device. 20 | /// The service identifier. 21 | /// An escrow bag 22 | /// The used to create the service. 23 | protected ServiceSessionBase(IDevice device ,string serviceID, bool withEscrowBag, ClientNewCallback ClientNew) : base() 24 | { 25 | var init = ClientNew; 26 | Device = device; 27 | using var ld = new LockdownSession(device); 28 | var descriptor = ld.StartService(serviceID, withEscrowBag); 29 | var error = init(device.Handle, descriptor, out THandle handle); 30 | var ex = ExceptionUtils.GetException(error); 31 | if (ex is not null) 32 | { 33 | throw ex; 34 | } 35 | Handle = handle; 36 | } 37 | 38 | /// 39 | /// Initialize a service session. 40 | /// 41 | /// The targeted device. 42 | /// The used to create the service. 43 | protected ServiceSessionBase(IDevice device, StartServiceCallback startService) : base() 44 | { 45 | var init = startService; 46 | Device = device; 47 | var error = init(device.Handle, out THandle handle, null); 48 | var ex = ExceptionUtils.GetException(error); 49 | if (ex is not null) 50 | { 51 | throw ex; 52 | } 53 | Handle = handle; 54 | } 55 | 56 | protected ServiceSessionBase(IDevice device, THandle handle) : base(handle) 57 | { 58 | Device = device; 59 | } 60 | 61 | /// 62 | /// Get the undeling device. 63 | /// 64 | public IDevice Device { get; } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/UIDeviceBatteryState.cs: -------------------------------------------------------------------------------- 1 | namespace MobileDeviceSharp 2 | { 3 | /// 4 | /// Represent the state of the device battery (see the UIDeviceBatteryState from the XAMARIN docs). 5 | /// 6 | public enum UIDeviceBatteryState 7 | { 8 | /// 9 | /// Can not determine the state of the battery. 10 | /// 11 | Unknown, 12 | /// 13 | /// The device is unplugged. 14 | /// 15 | Unplugged, 16 | 17 | /// 18 | /// The device's battery is currently charging. 19 | /// 20 | Charging, 21 | 22 | /// 23 | /// The device's battery is at full capacity. 24 | /// 25 | Full, 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/Usbmuxd/Native/UsbmuxdDeviceInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace MobileDeviceSharp.Usbmuxd.Native 4 | { 5 | [StructLayoutAttribute(LayoutKind.Sequential)] 6 | public struct UsbmuxdDeviceInfo 7 | { 8 | 9 | public uint handle; 10 | 11 | public uint product_id; 12 | 13 | [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 44)] 14 | public string udid; 15 | 16 | public IDeviceLookupOptions conn_type; 17 | 18 | [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 200)] 19 | public string conn_data; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/Usbmuxd/Native/UsbmuxdEvent.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace MobileDeviceSharp.Usbmuxd.Native 4 | { 5 | [StructLayoutAttribute(LayoutKind.Sequential)] 6 | internal struct UsbmuxdEvent 7 | { 8 | 9 | public UsbmuxdEventType @event; 10 | 11 | public UsbmuxdDeviceInfo device; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/Usbmuxd/Native/UsbmuxdEventCallBack.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace MobileDeviceSharp.Usbmuxd.Native 4 | { 5 | [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] 6 | internal delegate void UsbmuxdEventCallBack(ref UsbmuxdEvent @event, System.IntPtr userData); 7 | } 8 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/Usbmuxd/Native/UsbmuxdEventType.cs: -------------------------------------------------------------------------------- 1 | namespace MobileDeviceSharp.Usbmuxd.Native 2 | { 3 | /// 4 | /// Event types for event callback function 5 | /// 6 | public enum UsbmuxdEventType : int 7 | { 8 | 9 | DeviceAdd = 1, 10 | 11 | DeviceRemove = 2, 12 | 13 | DevicePaired = 3, 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/Usbmuxd/Native/UsbmuxdSocketType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace MobileDeviceSharp.Usbmuxd.Native 6 | { 7 | public enum UsbmuxdSocketType 8 | { 9 | /// 10 | /// Use UNIX sockets. The default on Linux and macOS. 11 | /// 12 | UNIX = 1, 13 | 14 | /// 15 | /// Use TCP sockets. The default and only option on Windows. 16 | /// 17 | TCP = 2 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/MobileDeviceSharp/Usbmuxd/Native/iDeviceLookupOptions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MobileDeviceSharp.Usbmuxd.Native 4 | { 5 | /// 6 | /// Type of connection a device is available on 7 | /// 8 | [Flags] 9 | public enum IDeviceLookupOptions : int 10 | { 11 | /// 12 | /// Lookup USB devices. 13 | /// 14 | Usb = 1, 15 | 16 | /// 17 | /// Lookup network devices. 18 | /// 19 | Network = 2, 20 | 21 | /// 22 | /// Lookup all devices ( and ). 23 | /// 24 | All = Usb | Network, 25 | 26 | PreferNetwork, 27 | 28 | /// 29 | /// Lookup all devices ( and ) but prefer network devices. 30 | /// 31 | All_PreferNetwork = All | PreferNetwork, 32 | 33 | } 34 | } 35 | --------------------------------------------------------------------------------