Supports app versions with explicit build versions

AltStore will now consider an update available if either:

* The source’s marketing version doesn’t match installed app’s version
* The source declares a build version AND it doesn’t match the install app’s build version

The installed app matches an app version if both maketing versions match, and the build versions match (if provided by the source).
This commit is contained in:
Riley Testut
2023-05-18 14:51:26 -05:00
parent 5985b4ca71
commit e97e48ba13
14 changed files with 126 additions and 42 deletions

View File

@@ -184,6 +184,7 @@ public class StoreApp: NSManagedObject, Decodable, Fetchable
let size = try container.decode(Int32.self, forKey: .size)
let appVersion = AppVersion.makeAppVersion(version: version,
buildVersion: nil,
date: versionDate,
localizedDescription: versionDescription,
downloadURL: downloadURL,
@@ -275,7 +276,7 @@ public extension StoreApp
return NSFetchRequest<StoreApp>(entityName: "StoreApp")
}
class func makeAltStoreApp(in context: NSManagedObjectContext) -> StoreApp
class func makeAltStoreApp(version: String, buildVersion: String?, in context: NSManagedObjectContext) -> StoreApp
{
let app = StoreApp(context: context)
app.name = "AltStore"
@@ -286,7 +287,8 @@ public extension StoreApp
app.screenshotURLs = []
app.sourceIdentifier = Source.altStoreIdentifier
let appVersion = AppVersion.makeAppVersion(version: "1.0",
let appVersion = AppVersion.makeAppVersion(version: version,
buildVersion: buildVersion,
date: Date(),
downloadURL: URL(string: "http://rileytestut.com")!,
size: 0,