libimobiledevice-win32 / imobiledevice-net

.NET (C#, VB.NET,...) bindings for libimobiledevice
GNU Lesser General Public License v2.1
297 stars 77 forks source link

Getting product name (OS name) on iPhone3GS crashing #161

Open pappanunny opened 4 years ago

pappanunny commented 4 years ago

I am trying to get details from iPhone and in the case of iPhone3GS, the following code leads to a crash:

lockdown.lockdownd_get_value(lockdownHandle, null, "ProductName", out node).ThrowOnError("Failed to get OS Name");//Crashes on iPhone3GS plistInstance.plist_get_string_val(node, out osType);

Details from Visual Studio on the exception: iMobileDevice.Lockdown.LockdownException HResult=0x80131500 Message=An Lockdown error occurred. Failed to get OS Name. The error code was MissingValue Source=iMobileDevice-net StackTrace: at iMobileDevice.Lockdown.LockdownErrorExtensions.ThrowOnError(LockdownError value, String message) at iDetectLib.iDetect.GetDeviceInfo() in C:\Users\user\source\repos\iDetectApp\iDetectLib\iDetect.cs:line 94 at iDetectApp.MainApp.Main(String[] args) in C:\Users\user\source\repos\iDetectApp\iDetectApp\MainApp.cs:line 17

How can this be fixed?

Thanks

qmfrederik commented 4 years ago

lockdown.lockdownd_get_value returns MissingValue for ProductName. Are you sure that ProductName is defined for the version of iOS you are running? What does ideviceinfo tell you?