mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-11 07:43:28 +01:00
recreate legacy project for testing
This commit is contained in:
@@ -95,7 +95,12 @@ public class AppPermission: NSManagedObject, Decodable, Fetchable {
|
||||
usageDescription = try container.decode(String.self, forKey: .usageDescription)
|
||||
|
||||
let rawType = try container.decode(String.self, forKey: .type)
|
||||
type = ALTAppPermissionType(rawValue: rawType)
|
||||
guard let type = ALTAppPermissionType(rawValue: rawType) else {
|
||||
throw DecodingError.dataCorrupted(
|
||||
DecodingError.Context(codingPath: [CodingKeys.type],
|
||||
debugDescription: "Invalid value for `ALTAppPermissionType` \"\(rawType)\""))
|
||||
}
|
||||
self.type = type
|
||||
} catch {
|
||||
if let context = managedObjectContext {
|
||||
context.delete(self)
|
||||
|
||||
@@ -172,7 +172,7 @@ public extension DatabaseManager {
|
||||
|
||||
private extension DatabaseManager {
|
||||
func prepareDatabase(completionHandler: @escaping (Result<Void, Error>) -> Void) {
|
||||
guard !Bundle.isAppExtension else { return completionHandler(.success(())) }
|
||||
guard !Bundle.isAppExtension() else { return completionHandler(.success(())) }
|
||||
|
||||
let context = persistentContainer.newBackgroundContext()
|
||||
context.performAndWait {
|
||||
|
||||
@@ -226,7 +226,12 @@ public class Source: NSManagedObject, Fetchable, Decodable {
|
||||
identifier = try container.decode(String.self, forKey: .identifier)
|
||||
|
||||
let userInfo = try container.decodeIfPresent([String: String].self, forKey: .userInfo)
|
||||
self.userInfo = userInfo?.reduce(into: [:]) { $0[ALTSourceUserInfoKey($1.key)] = $1.value }
|
||||
self.userInfo = userInfo?.reduce(into: [:]) {
|
||||
guard let infoKey: ALTSourceUserInfoKey = ALTSourceUserInfoKey(rawValue: $1.key) else {
|
||||
return
|
||||
}
|
||||
$0[infoKey] = $1.value
|
||||
}
|
||||
|
||||
let apps = try container.decodeIfPresent([StoreApp].self, forKey: .apps) ?? []
|
||||
let appsByID = Dictionary(apps.map { ($0.bundleIdentifier, $0) }, uniquingKeysWith: { a, _ in a })
|
||||
|
||||
@@ -13,14 +13,23 @@ import AltSign
|
||||
import Roxas
|
||||
|
||||
public extension StoreApp {
|
||||
#if ALPHA
|
||||
static let altstoreAppID = Bundle.main.Info.appbundleIdentifier
|
||||
#elseif BETA
|
||||
static let altstoreAppID = Bundle.main.Info.appbundleIdentifier
|
||||
#else
|
||||
static let altstoreAppID = Bundle.main.Info.appbundleIdentifier
|
||||
#endif
|
||||
|
||||
#if SWIFT_PACKAGE
|
||||
#if ALPHA
|
||||
static let altstoreAppID = Bundle.main.Info.appbundleIdentifier
|
||||
#elseif BETA
|
||||
static let altstoreAppID = Bundle.main.Info.appbundleIdentifier
|
||||
#else
|
||||
static let altstoreAppID = Bundle.main.Info.appbundleIdentifier
|
||||
#endif
|
||||
#else
|
||||
#if ALPHA
|
||||
static let altstoreAppID = Bundle.Info.appbundleIdentifier
|
||||
#elseif BETA
|
||||
static let altstoreAppID = Bundle.Info.appbundleIdentifier
|
||||
#else
|
||||
static let altstoreAppID = Bundle.Info.appbundleIdentifier
|
||||
#endif
|
||||
#endif
|
||||
static let dolphinAppID = "me.oatmealdome.dolphinios-njb"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user