Verifies downloaded app’s build version matches source (if provided)

This commit is contained in:
Riley Testut
2023-05-18 15:55:26 -05:00
committed by Magesh K
parent 3aa041d2ad
commit 07bc34ae7a
2 changed files with 15 additions and 1 deletions

View File

@@ -201,9 +201,14 @@ private extension VerifyAppOperation
func verifyDownloadedVersion(of app: ALTApplication, @AsyncManaged matches appVersion: AppVersion) async throws
{
let version = await $appVersion.version
let (version, buildVersion) = await $appVersion.perform { ($0.version, $0.buildVersion) }
guard version == app.version else { throw VerificationError.mismatchedVersion(app.version, expectedVersion: version, app: app) }
if let buildVersion
{
guard buildVersion == app.buildVersion else { throw VerificationError.mismatchedBuildVersion(app.buildVersion, expectedVersion: buildVersion, app: app) }
}
}
func verifyPermissions(of app: ALTApplication, @AsyncManaged match appVersion: AppVersion) async throws