Mist/Shared/HelperToolInfoPropertyList.swift
2022-07-01 16:44:06 +10:00

34 lines
986 B
Swift

//
// HelperToolInfoPropertyList.swift
// Mist
//
// Created by Nindi Gill on 21/6/2022.
//
import EmbeddedPropertyList
import Foundation
struct HelperToolInfoPropertyList: Decodable, Equatable {
private enum CodingKeys: String, CodingKey {
case buildHash = "BuildHash"
case bundleIdentifier = "CFBundleIdentifier"
case version = "CFBundleVersion"
case authorizedClients = "SMAuthorizedClients"
}
let buildHash: String
let bundleIdentifier: String
let version: BundleVersion
let authorizedClients: [String]
init() throws {
let data: Data = try EmbeddedPropertyListReader.info.readInternal()
self = try PropertyListDecoder().decode(HelperToolInfoPropertyList.self, from: data)
}
init(from url: URL) throws {
let data: Data = try EmbeddedPropertyListReader.info.readExternal(from: url)
self = try PropertyListDecoder().decode(HelperToolInfoPropertyList.self, from: data)
}
}