kotlin-plist 0.0.2 indexed Reads and writes Apple's plist files in XML and binary formats with a type-safe, intuitive API. Offers multiplatform support and provides Kotlin extension utilities for easy conversion.
Bring this to kpkg
This library is indexed from the KMP ecosystem and already resolves through kpkg.dev's Maven Central proxy. Maintainers can verify the namespace and publish future versions to kpkg for free hosting, real download stats, and signed-provenance pages.
Publishing coming soonMetadata
Owner demoofbug
Stars 2
Used by —
Health —
License MIT License
Latest 0.0.2
Repository github.com/demoofbug/kotlin-plist
Updated 2025-08-13 Readme Changelog kotlin-plist
kotlin-plist is a Kotlin Multiplatform library for reading and writing Apple's plist (XML and binary) files.
Table of Contents
Features
Read/write Apple plist files in XML and binary formats (bplist00)
Type-safe, intuitive API for Kotlin and Java
Multiplatform: JVM, Android, iOS, macOS, Linux, Windows, Node.js
Platform Support
Kotlin/JVM (Java 17+)
Kotlin/Android (API 23+, ARM64 and x86_64)
Kotlin/JS (Node.js)
Kotlin/Native for iOS (ARM64, x64, Simulator)
Kotlin/Native for macOS (ARM64, x64)
Kotlin/Native for Windows (x64)
Kotlin/Native for Linux (ARM64, x64)
Installation
Gradle
build.gradle.kts
repositories {
mavenCentral()
}
dependencies {
implementation("com.getiox.plist:plist:0.0.2" )
}
Maven
pom.xml
<dependency >
<groupId > com.getiox.plist</groupId >
<artifactId > plist-jvm</artifactId >
<version > 0.0.2</version >
Usage Examples
Kotlin Example
Java Example
Samples
Explore example projects to see how kotlin-plist is used in real applications:
java : A Java-based sample showing how to read and write plist files in both XML and binary formats.
kotlin-multiplatform : A full-stack Kotlin Multiplatform sample covering JVM, Android, iOS, and Native platforms.
API Reference
Data Types
Encoding and Decoding
object PList {
fun encode (data : PListValue , format: PListFormat = PListFormat.XML) : ByteArray
fun decode (data : ByteArray ) : PListValue
}
enum class PListFormat {
XML,
BINARY
}
Extension Functions
Kotlin extension utilities for convenient conversion and type access:
License
This project is licensed under the MIT License . See LICENSE for full details.
</dependency >
Kotlin encode/decode
import com.getiox.plist.*
import kotlinx.datetime.Clock
val plistValue = mapOf(
"stringKey" to "stringValue" .plistValue,
"intKey" to 123. plistValue,
"boolKey" to true .plistValue,
"realKey" to 123.456 .plistValue,
"dateKey" to Clock.System.now().plistValue,
"dataKey" to byteArrayOf(1 , 2 , 3 ).plistValue,
"arrayKey" to listOf(1. plistValue, 2. plistValue, 3. plistValue).plistValue,
"dictKey" to mapOf(
"stringKey" to "stringValue" .plistValue,
"intKey" to 123. plistValue
).plistValue
).plistValue
val binaryData = PList.encode(plistValue, PListFormat.BINARY)
val xmlData = PList.encode(plistValue, PListFormat.XML)
val decoded = PList.decode(binaryData)
if (decoded.isDict) {
val dict = decoded.dict
val stringValue = dict["stringKey" ]?.string
val intValue = dict["intKey" ]?.int
println("String value: $stringValue , Int value: $intValue " )
}
Java encode/decode
import com.getiox.plist.*;
import java.util.List;
import java.util.Map;
PListValue root = new PListDict (Map.of(
"stringKey" , new PListString ("stringValue" ),
"intKey" , new PListInt (123 ),
"boolKey" , new PListBool (true ),
"realKey" , new PListReal (123.456 ),
"dateKey" , new PListDate (System.currentTimeMillis()),
"dataKey" , new PListData (new byte []{1 , 2 , 3 }),
"arrayKey" , new PListArray (List.of(
new PListInt (1 ),
new PListBool (false ),
new PListReal (3.1415926 )
)),
"dictKey" , new PListDict (Map.of(
"stringKey" , new PListString ("stringValue" ),
"intKey" , new PListInt (123 )
))
));
byte [] binaryData = PList.encode(root, PListFormat.BINARY);
byte [] xmlData = PList.encode(root, PListFormat.XML);
PListValue decoded = PList.decode(binaryData);
if (decoded instanceof
PListDict dict){
PListValue stringValue = dict.get("stringKey" );
PListValue intValue = dict.get("intKey" );
if (stringValue instanceof
PListString str &&intValue instanceof
PListInt num){
System.out.
println("String value: " +str.getValue() +", Int value: " +num.
getValue());
}
}
Plist Type Kotlin Class Description
Dictionary PListDictKey-value mapping Array PListArrayOrdered collection String PListStringText string Integer PListIntInteger number Real PListRealFloating-point value Boolean PListBoolBoolean true/false Date PListDateTimestamps Data PListDataRaw binary data Null PListNullNull value
fun PListValue.encodeToByteArray (format: PListFormat = PListFormat.XML) : ByteArray
fun ByteArray.decodeToPListValue () : PListValue
val PListValue.isDict: Boolean
val PListValue.isArray: Boolean
val PListValue.isString: Boolean
val PListValue.isInt: Boolean
val PListValue.isReal: Boolean
val PListValue.isBool: Boolean
val PListValue.isDate: Boolean
val PListValue.isData: Boolean
val PListValue.isNull: Boolean
val PListValue.dict: PListDict
val PListValue.array: PListArray
val PListValue.string: String
val PListValue.int: Long
val PListValue.real: Double
val PListValue.bool: Boolean
val PListValue.date: Instant
val PListValue.data : ByteArray
val String.plistValue: PListString
val Long .plistValue: PListInt
val Int .plistValue: PListInt
val Double .plistValue: PListReal
val Boolean .plistValue: PListBool
val ByteArray.plistValue: PListData
val Instant.plistValue: PListDate
val Map<String, PListValue>.plistValue: PListDict
val List<PListValue>.plistValue: PListArray
Related libraries Surfaced from shared tags and platforms — no rankings paid for.
snakeyaml-engine-kmp ★ 42
krzema12 Processes YAML 1.2 with fine-grained control and advanced functionality. Suitable for projects needing customization and flexibility. Integrates with various platforms and uses comprehensive YAML test suites for validation. Shared: web, serialization, native wgpu4k ★ 110
wgpu4k Creates WebGPU bindings for web, desktop, and mobile, enabling cross-platform graphics development. Offers example executions and is progressing through API implementation and refinement phases. Shared: web, native, kotlin-native kotlin-fhir ★ 63
ohs-foundation Lean, fast HL7 FHIR data-model implementation with minimal generated classes, JSON-only serialization, multi-version support, and a tiny runtime footprint for efficient healthcare data handling. Shared: web, serialization, native irgaly
Monitors file system changes across multiple directories, emitting events such as create, delete, and modify. Allows observing file events using flows, supports multiple platforms, and provides raw event access for debugging.
Shared: native, kotlin-native, file