diff --git a/AltStore/Browse/BrowseViewController.swift b/AltStore/Browse/BrowseViewController.swift index fda58b29..ec1bb75d 100644 --- a/AltStore/Browse/BrowseViewController.swift +++ b/AltStore/Browse/BrowseViewController.swift @@ -77,7 +77,7 @@ private extension BrowseViewController NSSortDescriptor(keyPath: \StoreApp.name, ascending: true), NSSortDescriptor(keyPath: \StoreApp.bundleIdentifier, ascending: true)] fetchRequest.returnsObjectsAsFaults = false - fetchRequest.predicate = NSPredicate(format: "%K != %@", #keyPath(StoreApp.sourceIdentifier), Source.altStoreIdentifier) + fetchRequest.predicate = NSPredicate(format: "%K != %@", #keyPath(StoreApp.bundleIdentifier), StoreApp.altstoreAppID) let dataSource = RSTFetchedResultsCollectionViewPrefetchingDataSource(fetchRequest: fetchRequest, managedObjectContext: DatabaseManager.shared.viewContext) dataSource.cellConfigurationHandler = { (cell, app, indexPath) in diff --git a/AltStoreCore/Model/AltStore.xcdatamodeld/AltStore 11.xcdatamodel/contents b/AltStoreCore/Model/AltStore.xcdatamodeld/AltStore 11.xcdatamodel/contents index 94c3b425..cceed50f 100644 --- a/AltStoreCore/Model/AltStore.xcdatamodeld/AltStore 11.xcdatamodel/contents +++ b/AltStoreCore/Model/AltStore.xcdatamodeld/AltStore 11.xcdatamodel/contents @@ -103,7 +103,6 @@ - diff --git a/AltStoreCore/Model/DatabaseManager.swift b/AltStoreCore/Model/DatabaseManager.swift index 06891c37..b91a7e8e 100644 --- a/AltStoreCore/Model/DatabaseManager.swift +++ b/AltStoreCore/Model/DatabaseManager.swift @@ -222,7 +222,7 @@ private extension DatabaseManager let storeApp: StoreApp - if let app = StoreApp.first(satisfying: NSPredicate(format: "%K == %@ AND %K == %@", #keyPath(StoreApp.bundleIdentifier), StoreApp.altstoreAppID, #keyPath(StoreApp.sourceIdentifier), Source.altStoreIdentifier), in: context) + if let app = StoreApp.first(satisfying: NSPredicate(format: "%K == %@", #keyPath(StoreApp.bundleIdentifier), StoreApp.altstoreAppID), in: context) { storeApp = app } diff --git a/AltStoreCore/Model/InstalledApp.swift b/AltStoreCore/Model/InstalledApp.swift index 6838f354..77c49513 100644 --- a/AltStoreCore/Model/InstalledApp.swift +++ b/AltStoreCore/Model/InstalledApp.swift @@ -108,10 +108,6 @@ 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 @@ -182,7 +178,7 @@ public extension InstalledApp class func fetchAltStore(in context: NSManagedObjectContext) -> InstalledApp? { - let predicate = NSPredicate(format: "%K == %@ AND %K != nil AND %K == %@", #keyPath(InstalledApp.bundleIdentifier), StoreApp.altstoreAppID, #keyPath(InstalledApp.storeApp), #keyPath(InstalledApp.storeApp.sourceIdentifier), Source.altStoreIdentifier) + let predicate = NSPredicate(format: "%K == %@", #keyPath(InstalledApp.bundleIdentifier), StoreApp.altstoreAppID) print("Fetch 'AltStore' Predicate: \(String(describing: predicate))") let altStore = InstalledApp.first(satisfying: predicate, in: context) return altStore diff --git a/AltStoreCore/Model/NewsItem.swift b/AltStoreCore/Model/NewsItem.swift index 62fdb9db..22e86eb8 100644 --- a/AltStoreCore/Model/NewsItem.swift +++ b/AltStoreCore/Model/NewsItem.swift @@ -32,15 +32,6 @@ public class NewsItem: NSManagedObject, Decodable, Fetchable @NSManaged public var storeApp: StoreApp? @NSManaged public var source: Source? - @objc public var isDuplicate: Bool { - if self.source == nil { return false } - - // Hide news from sources that begin with the SideStore identifier, and aren't from the same source as the current SideStore source - if self.source!.identifier.starts(with: Bundle.Info.appbundleIdentifier) && self.source!.identifier != Source.altStoreIdentifier { return true } - - return false - } - private enum CodingKeys: String, CodingKey { case identifier @@ -95,9 +86,6 @@ public extension NewsItem { @nonobjc class func fetchRequest() -> NSFetchRequest { - let fetchRequest = NSFetchRequest(entityName: "NewsItem") - fetchRequest.predicate = NSPredicate(format: "%K == NO", - #keyPath(NewsItem.isDuplicate)) - return fetchRequest + return NSFetchRequest(entityName: "NewsItem") } } diff --git a/AltStoreCore/Model/Source.swift b/AltStoreCore/Model/Source.swift index 3a6c16e6..8f1a72a7 100644 --- a/AltStoreCore/Model/Source.swift +++ b/AltStoreCore/Model/Source.swift @@ -11,37 +11,29 @@ import UIKit public extension Source { - static var altStoreIdentifier: String { - let appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String - - if appVersion != nil { - if appVersion!.contains("beta") { - return Bundle.Info.appbundleIdentifier + ".Beta" - } - if appVersion!.contains("nightly") { - return Bundle.Info.appbundleIdentifier + ".Nightly" - } - } - - return Bundle.Info.appbundleIdentifier - } + #if ALPHA + static let altStoreIdentifier = Bundle.Info.appbundleIdentifier + #else + static let altStoreIdentifier = Bundle.Info.appbundleIdentifier + #endif - static let altStoreSourceBaseURL = "https://sidestore-apps.naturecodevoid.dev/" + #if STAGING - static var altStoreSourceURL: URL { - let appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String - - if appVersion != nil { - if appVersion!.contains("beta") { - return URL(string: altStoreSourceBaseURL + "beta")! - } - if appVersion!.contains("nightly") { - return URL(string: altStoreSourceBaseURL + "nightly")! - } - } - - return URL(string: altStoreSourceBaseURL)! - } + #if ALPHA + static let altStoreSourceURL = URL(string: "https://apps.sidestore.io/")! + #else + static let altStoreSourceURL = URL(string: "https://apps.sidestore.io/")! + #endif + + #else + + #if ALPHA + static let altStoreSourceURL = URL(string: "https://apps.sidestore.io/")! + #else + static let altStoreSourceURL = URL(string: "https://apps.sidestore.io/")! + #endif + + #endif } public struct AppPermissionFeed: Codable { diff --git a/AltStoreCore/Model/StoreApp.swift b/AltStoreCore/Model/StoreApp.swift index 843db309..2e38b57d 100644 --- a/AltStoreCore/Model/StoreApp.swift +++ b/AltStoreCore/Model/StoreApp.swift @@ -343,28 +343,16 @@ public extension StoreApp { let app = StoreApp(context: context) app.name = "SideStore" - - let currentAppVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String - - if currentAppVersion != nil { - if currentAppVersion!.contains("beta") { - app.name += " (Beta)" - } - if currentAppVersion!.contains("nightly") { - app.name += " (Nightly)" - } - } - app.bundleIdentifier = StoreApp.altstoreAppID - app.developerName = "SideStore Team" - app.localizedDescription = "SideStore is an alternative app store for non-jailbroken devices.\n\nSideStore allows you to sideload other .ipa files and apps from the Files app or via the SideStore Library." - app.iconURL = URL(string: "https://sidestore.io/assets/icon.png")! + app.developerName = "Side Team" + app.localizedDescription = "SideStore is an alternative App Store." + app.iconURL = URL(string: "https://user-images.githubusercontent.com/705880/63392210-540c5980-c37b-11e9-968c-8742fc68ab2e.png")! app.screenshotURLs = [] app.sourceIdentifier = Source.altStoreIdentifier - let appVersion = AppVersion.makeAppVersion(version: "0.0.0", // this is set to the current app version later + let appVersion = AppVersion.makeAppVersion(version: "0.3.0", date: Date(), - downloadURL: URL(string: "https://sidestore.io")!, + downloadURL: URL(string: "http://rileytestut.com")!, size: 0, appBundleID: app.bundleIdentifier, sourceID: Source.altStoreIdentifier, @@ -373,6 +361,10 @@ public extension StoreApp print("makeAltStoreApp StoreApp: \(String(describing: app))") + #if BETA + app.isBeta = true + #endif + return app } } diff --git a/trustedapps.json b/trustedapps.json index 8210809b..016fadf3 100644 --- a/trustedapps.json +++ b/trustedapps.json @@ -4,14 +4,6 @@ { "identifier": "io.sidestore.example" }, - { - "identifier": "com.SideStore.SideStore", - "sourceURL": "https://sidestore-apps.naturecodevoid.dev/" - }, - { - "identifier": "com.SideStore.SideStore.Beta", - "sourceURL": "https://sidestore-apps.naturecodevoid.dev/beta" - }, { "identifier": "com.sidestoreapps.community", "sourceURL": "https://community-apps.sidestore.io/sidecommunity.json"