Files
SideStore/Sources/SideStoreCore/Protocols/AppProtocol.swift

47 lines
881 B
Swift
Raw Normal View History

//
// AppProtocol.swift
// AltStore
//
// Created by Riley Testut on 7/26/19.
// Copyright © 2019 Riley Testut. All rights reserved.
//
import AltSign
2023-03-01 00:48:36 -05:00
import Foundation
2023-03-01 00:48:36 -05:00
public protocol AppProtocol {
var name: String { get }
var bundleIdentifier: String { get }
var url: URL? { get }
}
2023-03-01 00:48:36 -05:00
public struct AnyApp: AppProtocol {
public var name: String
public var bundleIdentifier: String
public var url: URL?
2023-03-01 00:48:36 -05:00
public init(name: String, bundleIdentifier: String, url: URL?) {
self.name = name
self.bundleIdentifier = bundleIdentifier
self.url = url
}
}
2023-03-01 00:48:36 -05:00
extension ALTApplication: AppProtocol {
public var url: URL? {
2023-03-01 00:48:36 -05:00
fileURL
}
}
2023-03-01 00:48:36 -05:00
extension StoreApp: AppProtocol {
public var url: URL? {
2023-03-01 00:48:36 -05:00
downloadURL
}
}
2023-03-01 00:48:36 -05:00
extension InstalledApp: AppProtocol {
public var url: URL? {
2023-03-01 00:48:36 -05:00
fileURL
}
}