libimobiledevice / libplist

A library to handle Apple Property List format in binary or XML
https://libimobiledevice.org
GNU Lesser General Public License v2.1
528 stars 304 forks source link

How to store negative integer #217

Closed mveril closed 1 year ago

mveril commented 1 year ago

Hello I currently work on MobileDeviceSharp a C# object oriented wrapper around libimobiledevice and there is something I don't understand. Normally integer value in Property list can be signed but you represent Integer plist node as uint64_t that is unsigned. This beaviour is reported in my C# implementation of the PlistInteger node. So what is the correct way to store signed integer property list value using this library.

nikias commented 1 year ago

Take a look at https://github.com/libimobiledevice/libplist/commit/d886885b0ec2506fa2caf0986a3d0e496fea91c2 .

mveril commented 1 year ago

Ok thank you for the reference From my point of view, it's going in the right direction because it's more consistent with the plist file format itself and I am happy about that but I don"t know when the libimobiledevice project will be updated to use this version. On my side I solve my issue using UnmanagedType.U8 to specify that on the C side the value is of type uint64_t even if on my side I use long value (int64) and it's work perfectly mveril/MobileDeviceSharp@234fe5f30cfc0a36385268afd274fbc247879577. Thank you.

nikias commented 1 year ago

The project always suggests to use the latest libplist. It's about the package maintainers that need to update to the latest versions. I am due with a few releases so hopefully they will pick up new versions soon.