Release channel support (#239)

* Release channel support

- Show SideStore in Browse if it's not from the current SideStore source
- Change SideStore source URL and source ID based on if beta and nightly are in the version string
- Use StoreApp name for InstalledApp name to allow for source-specified name to show up in My Apps

* My Apps: Fix incorrect app name on first launch

* News: fix duplicate news items from multiple SideStore release channel sources

* Trusted Sources: Add stable and beta
This commit is contained in:
naturecodevoid
2023-02-02 08:05:27 -08:00
committed by GitHub
parent 4d8438a6b6
commit 7d0eb8c61e
8 changed files with 75 additions and 34 deletions

View File

@@ -108,6 +108,10 @@ public class InstalledApp: NSManagedObject, InstalledAppProtocol
public func update(resignedApp: ALTApplication, certificateSerialNumber: String?)
{
self.name = resignedApp.name
if storeApp != nil {
// This might break things; maybe only do this if the bundle ID is SideStore's?
self.name = storeApp!.name // If we don't do this, the name will always be SideStore in My Apps, even when using beta/nightly
}
self.resignedBundleIdentifier = resignedApp.bundleIdentifier
self.version = resignedApp.version
@@ -178,7 +182,7 @@ public extension InstalledApp
class func fetchAltStore(in context: NSManagedObjectContext) -> InstalledApp?
{
let predicate = NSPredicate(format: "%K == %@", #keyPath(InstalledApp.bundleIdentifier), StoreApp.altstoreAppID)
let predicate = NSPredicate(format: "%K == %@ AND %K != nil AND %K == %@", #keyPath(InstalledApp.bundleIdentifier), StoreApp.altstoreAppID, #keyPath(InstalledApp.storeApp), #keyPath(InstalledApp.storeApp.sourceIdentifier), Source.altStoreIdentifier)
print("Fetch 'AltStore' Predicate: \(String(describing: predicate))")
let altStore = InstalledApp.first(satisfying: predicate, in: context)
return altStore