Mist/Shared/HelperToolInfoPropertyList.swift

35 lines
986 B
Swift
Raw Normal View History

2022-07-01 02:44:06 -04:00
//
// 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)
}
}