Read Contents Of A JSON in a Binary and Not Really Encrypted File

LOL. I know my title seems to be a little bit weird, but let me explain it. In Mac OS X, I have a JSON file, into a package, I want to read the content with the BaseElements plugin.

Until now, I got the directory of the package and the name of the file I want to read. This file contains all the links of the other files related into the other folders in the same root folder, with many other meta informations I need. All the plugin can get from the file is a ?. And the Be_GetLastError = 2.

In the Finder, the file I need, is not readable by human, so it's encrypted. But if I open it with TextMate, it opens it with no problems, no passwords, so no decryption at the first sight. And it is readable in JSON format. If I look for the information about the type of the encoding, it's a simple plain text, with UTF-8. I can't see any other informations.

In terminal, I tried to read it with pico, vi, less I tried: "file -i" on the file to get the file type and I just can get: regular file. I tried the xxd command, but I read all the hexadecimals without succeeding to rebuilt the text from it.

I want to full automate the process, so the reading of that file will permit to get all the informations of what file are where, the name and tags of each one. So, it's a major one for the process.

Thanks in advance.

1 Like

Hello @psurget

Do you think that there is any chance that the file in question could be a binary plist?

Is there a file name or extension for this file that you can share?

-Steve

Have you tried using the ReadDataFile script step(s) that were added in v18/19? I think they read/write to UTF-8 by default - might be able to read natively without BE?...

1 Like

You can use Shell functions to run plutil command line tool to convert file.
/usr/bin/plutil

2 Likes