DataStore 是 Jetpack 中 Shared Preferences 的现代替代方案,提供两种实现:Preferences DataStore 用于键值存储,Proto DataStore 用于基于 Protocol Buffers 的类型化、模式化存储。DataStore 使用 Kotlin 协程与 Flow,使其异步且比 Shared Preferences 更安全。