#plist #apple #decoder

ns-keyed-archive

A library to encode/decode NSKeyedArchive binary plists

5 releases

Uses new Rust 2024

0.1.4 Oct 17, 2025
0.1.3 Mar 15, 2025
0.1.2 Mar 11, 2025
0.1.1 Mar 11, 2025
0.1.0 Mar 10, 2025

#1151 in Encoding

Download history 40/week @ 2025-07-09 13/week @ 2025-07-16 39/week @ 2025-07-23 48/week @ 2025-07-30 34/week @ 2025-08-06 47/week @ 2025-08-13 60/week @ 2025-08-20 22/week @ 2025-08-27 39/week @ 2025-09-03 50/week @ 2025-09-10 32/week @ 2025-09-17 51/week @ 2025-09-24 31/week @ 2025-10-01 5/week @ 2025-10-08 186/week @ 2025-10-15 45/week @ 2025-10-22

273 downloads per month
Used in idevice

MIT/Apache

14KB
224 lines

ns_keyed_archive

A library to encode/decode NSKeyedArchive-formatted binary plists Based off the work from NSKeyedArchiver Converter

Usage

Add this library and plist to your Cargo.toml

[dependencies]
plist = "1.7"
ns_keyed_archive = "*"
use plist;

// Create a new plist and insert values
let mut d = plist::Dictionary::new();
let a = plist::Value::Array(vec!["a".into(), 1.into()]);
d.insert("reeeeee".to_string(), a);
d.insert("asdf".into(), "qwer".into());

let mut d_d = plist::Dictionary::new();
d_d.insert("fortnite".into(), plist::Value::Boolean(false));
d.insert("good games".into(), d_d.into());

// Encode the binary in an archived binary plist
let b = encode::encode_to_bytes(d.clone().into()).unwrap();

// Decode it again
let d1 = decode::from_bytes(&b).unwrap();
assert_eq!(plist::Value::Dictionary(d), d1);

// Another example
let s = plist::Value::String("asdf".into());
let b = encode::encode_to_bytes(s.clone()).unwrap();
let s1 = decode::from_bytes(&b).unwrap();
assert_eq!(s, s1);

Dependencies

~4.5MB
~86K SLoC