mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-20 04:03:26 +01:00
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
This commit is contained in:
committed by
Spidy123222
parent
9f7d4dee49
commit
8f5b56f717
@@ -78,7 +78,7 @@ private extension BrowseViewController
|
|||||||
NSSortDescriptor(keyPath: \StoreApp.name, ascending: true),
|
NSSortDescriptor(keyPath: \StoreApp.name, ascending: true),
|
||||||
NSSortDescriptor(keyPath: \StoreApp.bundleIdentifier, ascending: true)]
|
NSSortDescriptor(keyPath: \StoreApp.bundleIdentifier, ascending: true)]
|
||||||
fetchRequest.returnsObjectsAsFaults = false
|
fetchRequest.returnsObjectsAsFaults = false
|
||||||
fetchRequest.predicate = NSPredicate(format: "%K != %@", #keyPath(StoreApp.bundleIdentifier), StoreApp.altstoreAppID)
|
fetchRequest.predicate = NSPredicate(format: "%K != %@", #keyPath(StoreApp.sourceIdentifier), Source.altStoreIdentifier)
|
||||||
|
|
||||||
let dataSource = RSTFetchedResultsCollectionViewPrefetchingDataSource<StoreApp, UIImage>(fetchRequest: fetchRequest, managedObjectContext: DatabaseManager.shared.viewContext)
|
let dataSource = RSTFetchedResultsCollectionViewPrefetchingDataSource<StoreApp, UIImage>(fetchRequest: fetchRequest, managedObjectContext: DatabaseManager.shared.viewContext)
|
||||||
dataSource.cellConfigurationHandler = { (cell, app, indexPath) in
|
dataSource.cellConfigurationHandler = { (cell, app, indexPath) in
|
||||||
|
|||||||
@@ -222,7 +222,7 @@ private extension DatabaseManager
|
|||||||
|
|
||||||
let storeApp: StoreApp
|
let storeApp: StoreApp
|
||||||
|
|
||||||
if let app = StoreApp.first(satisfying: NSPredicate(format: "%K == %@", #keyPath(StoreApp.bundleIdentifier), StoreApp.altstoreAppID), in: context)
|
if let app = StoreApp.first(satisfying: NSPredicate(format: "%K == %@ AND %K == %@", #keyPath(StoreApp.bundleIdentifier), StoreApp.altstoreAppID, #keyPath(StoreApp.sourceIdentifier), Source.altStoreIdentifier), in: context)
|
||||||
{
|
{
|
||||||
storeApp = app
|
storeApp = app
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,6 +108,10 @@ public class InstalledApp: NSManagedObject, InstalledAppProtocol
|
|||||||
public func update(resignedApp: ALTApplication, certificateSerialNumber: String?)
|
public func update(resignedApp: ALTApplication, certificateSerialNumber: String?)
|
||||||
{
|
{
|
||||||
self.name = resignedApp.name
|
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.resignedBundleIdentifier = resignedApp.bundleIdentifier
|
||||||
self.version = resignedApp.version
|
self.version = resignedApp.version
|
||||||
@@ -178,7 +182,7 @@ public extension InstalledApp
|
|||||||
|
|
||||||
class func fetchAltStore(in context: NSManagedObjectContext) -> 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))")
|
print("Fetch 'AltStore' Predicate: \(String(describing: predicate))")
|
||||||
let altStore = InstalledApp.first(satisfying: predicate, in: context)
|
let altStore = InstalledApp.first(satisfying: predicate, in: context)
|
||||||
return altStore
|
return altStore
|
||||||
|
|||||||
@@ -11,29 +11,37 @@ import UIKit
|
|||||||
|
|
||||||
public extension Source
|
public extension Source
|
||||||
{
|
{
|
||||||
#if ALPHA
|
static var altStoreIdentifier: String {
|
||||||
static let altStoreIdentifier = Bundle.Info.appbundleIdentifier
|
let appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String
|
||||||
#else
|
|
||||||
static let altStoreIdentifier = Bundle.Info.appbundleIdentifier
|
if appVersion != nil {
|
||||||
#endif
|
if appVersion!.contains("beta") {
|
||||||
|
return Bundle.Info.appbundleIdentifier + ".Beta"
|
||||||
|
}
|
||||||
|
if appVersion!.contains("nightly") {
|
||||||
|
return Bundle.Info.appbundleIdentifier + ".Nightly"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Bundle.Info.appbundleIdentifier
|
||||||
|
}
|
||||||
|
|
||||||
#if STAGING
|
static let altStoreSourceBaseURL = "https://sidestore-apps.naturecodevoid.dev/"
|
||||||
|
|
||||||
#if ALPHA
|
static var altStoreSourceURL: URL {
|
||||||
static let altStoreSourceURL = URL(string: "https://apps.sidestore.io/")!
|
let appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String
|
||||||
#else
|
|
||||||
static let altStoreSourceURL = URL(string: "https://apps.sidestore.io/")!
|
if appVersion != nil {
|
||||||
#endif
|
if appVersion!.contains("beta") {
|
||||||
|
return URL(string: altStoreSourceBaseURL + "beta")!
|
||||||
#else
|
}
|
||||||
|
if appVersion!.contains("nightly") {
|
||||||
#if ALPHA
|
return URL(string: altStoreSourceBaseURL + "nightly")!
|
||||||
static let altStoreSourceURL = URL(string: "https://apps.sidestore.io/")!
|
}
|
||||||
#else
|
}
|
||||||
static let altStoreSourceURL = URL(string: "https://apps.sidestore.io/")!
|
|
||||||
#endif
|
return URL(string: altStoreSourceBaseURL)!
|
||||||
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct AppPermissionFeed: Codable {
|
public struct AppPermissionFeed: Codable {
|
||||||
|
|||||||
Reference in New Issue
Block a user