Skip to content

A library for encoding and decoding apple NSKeyedArchiver

License

Notifications You must be signed in to change notification settings

sandin/libnskeyedarchiver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libnskeyedarchiver

A library for encoding and decoding Apple's NSKeyedArchiver.

Usage

Library

Decode a binary plist file:

KAValue obj = NSKeyedUnarchiver::UnarchiveTopLevelObjectWithData(
    buffer, (uint32_t)buffer_size);
printf("%s\n", obj->ToJson().c_str());

output:

{
    "rp": 10,
    "tc": [
        {
            "kdf2": [
                630784000,
                833617920,
                830472456
            ],
            "tk": 3,
            "uuid": "2C46B61A-CDA9-4D59-B901-22E28B08C260"
        }
    ],
    "ur": 500
}

Encode a object to binary plist format:

const KAValue& object = KAValue(true);
char* buffer = nullptr;
size_t buffer_size = 0;
NSKeyedArchiver::ArchivedData(object, &buffer, &buffer_size,
                            NSKeyedArchiver::OutputFormat::Binary);

Tools

Use command line tools to parse bplist files into json format:

$ nskeyedarchiver_tools bplist2json test.bplist

output:

{
    "hwCPU64BitCapable": 1,
    "hwCPUsubtype": 2,
    "hwCPUtype": 16777228,
    "numberOfCpus": 6,
    "numberOfPhysicalCpus": 6
}

About

A library for encoding and decoding apple NSKeyedArchiver

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published