[cleanup]: remove unused code and renamed AltStore to SideStore in sources section

This commit is contained in:
Magesh K
2024-12-13 13:59:18 +05:30
parent 7f60048b0c
commit 7ac485def0
3 changed files with 16 additions and 63 deletions

View File

@@ -81,7 +81,7 @@ struct SourceError: ALTLocalizedError
var errorFailureReason: String {
switch self.code
{
case .unsupported: return String(format: NSLocalizedString("The source “%@” is not supported by this version of AltStore.", comment: ""), self.$source.name)
case .unsupported: return String(format: NSLocalizedString("The source “%@” is not supported by this version of SideStore.", comment: ""), self.$source.name)
case .duplicateBundleID:
let bundleIDFragment = self.bundleID.map { String(format: NSLocalizedString("the bundle identifier %@", comment: ""), $0) } ?? NSLocalizedString("the same bundle identifier", comment: "")
let failureReason = String(format: NSLocalizedString("The source “%@” contains multiple apps with %@.", comment: ""), self.$source.name, bundleIDFragment)
@@ -108,7 +108,7 @@ struct SourceError: ALTLocalizedError
return failureReason
case .blocked:
let failureReason = String(format: NSLocalizedString("The source “%@” has been blocked by AltStore for security reasons.", comment: ""), self.$source.name)
let failureReason = String(format: NSLocalizedString("The source “%@” has been blocked by SideStore for security reasons.", comment: ""), self.$source.name)
return failureReason
case .changedID:
@@ -141,11 +141,11 @@ struct SourceError: ALTLocalizedError
return failureReason
case .marketplaceNotSupported:
let failureReason = String(format: NSLocalizedString("The source “%@” contains notarized apps, which are not supported by this version of AltStore.", comment: ""), self.$source.name)
let failureReason = String(format: NSLocalizedString("The source “%@” contains notarized apps, which are not supported by this version of SideStore.", comment: ""), self.$source.name)
return failureReason
case .marketplaceRequired:
let failureReason = String(format: NSLocalizedString("One or more apps in source “%@” are missing a marketplaceID. This most likely means they are not notarized, which is not supported by this version of AltStore.", comment: ""), self.$source.name)
let failureReason = String(format: NSLocalizedString("One or more apps in source “%@” are missing a marketplaceID. This most likely means they are not notarized, which is not supported by this version of SideStore.", comment: ""), self.$source.name)
return failureReason
}
}
@@ -186,7 +186,7 @@ struct SourceError: ALTLocalizedError
return recoverySuggestion
case .marketplaceRequired:
let failureReason = String(format: NSLocalizedString("AltStore can only install marketplace apps that have been notarized by Apple.", comment: ""), self.$source.name)
let failureReason = String(format: NSLocalizedString("SideStore can only install marketplace apps that have been notarized by Apple.", comment: ""), self.$source.name)
return failureReason
default: return nil

View File

@@ -74,6 +74,10 @@ class UpdateKnownSourcesOperation: ResultOperation<([KnownSource], [KnownSource]
UserDefaults.shared.recommendedSources = sources.trusted
UserDefaults.shared.blockedSources = sources.blocked
// Cache trusted source IDs.
UserDefaults.shared.trustedSourceIDs = sources.trusted.map { $0.identifier }
self.finish(.success(sources))
}
catch