mirror of
https://github.com/ninxsoft/Mist.git
synced 2025-05-09 14:01:55 -04:00
33 lines
985 B
Swift
33 lines
985 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)
|
|
}
|
|
}
|