tagatac / bagoup

Mac OS Messages export
GNU Affero General Public License v3.0
69 stars 4 forks source link

Compile typedstream-decode on linux #67

Closed tagatac closed 3 days ago

tagatac commented 2 weeks ago

At the moment compilation succeeds on Debian using

clang `gnustep-config --objc-flags` -o typedstream-decode typedstream-decode.m -lobjc -lgnustep-base

However, decoding fails with

❯❯❯ cat ~/Desktop/attributedbody.bin | ./typedstream-decode
./typedstream-decode: Uncaught exception NSInternalInconsistencyException, reason: Archive has wrong prefix
tagatac commented 3 days ago

It seems like this may be a dead end as gnustep does not seem to support NSArchiver format: https://mail.gnu.org/archive/html/discuss-gnustep/2005-09/msg00013.html

On 2005-09-07 04:13:57 +0100 Lloyd Dupont lloyd@nova-mind.com wrote:

I'm trying to port a MacOSX application to Windows. So far it has worked mostly well. However I'm trying to read one of our data file.

Which is an old format plist with some NSColor wich was stored as an NSData (on MacOSX) with [NSArchiver archivedDataWithRootObject: myColor];

Now I tryed to read it on Windows/GNUstep with myColor = (NSColor *) [NSUnarchiver unarchiveObjectWithData: aNSData];

and this fails and pops up a little GNUstep exception message box saying: Critical NSInternalInconsistencyException: Archive has wrong prefix

Now I wonder:

  1. is it that GNUstep's NSUnarchiver deosn't support MacOSX NSArchiver format?

Yes ... it's an undocumented proprietory binary format.

We aim to have binary compatility for keyed archives though (reverse engineering that was more practicable).

The relevant code is https://github.com/gnustep/libs-base/blob/1c5f581a46ed3e80aab1dbc7c8e33237da0ff4e9/Source/NSUnarchiver.m#L1807-L1816