mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
Compare commits
5 Commits
0.6.2
...
naturecode
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a8c5167c6 | ||
|
|
96f0d41986 | ||
|
|
f2b555beae | ||
|
|
d853791ad2 | ||
|
|
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
|
||||||
|
|||||||
@@ -103,6 +103,7 @@
|
|||||||
<attribute name="externalURL" optional="YES" attributeType="URI"/>
|
<attribute name="externalURL" optional="YES" attributeType="URI"/>
|
||||||
<attribute name="identifier" attributeType="String"/>
|
<attribute name="identifier" attributeType="String"/>
|
||||||
<attribute name="imageURL" optional="YES" attributeType="URI"/>
|
<attribute name="imageURL" optional="YES" attributeType="URI"/>
|
||||||
|
<attribute name="isDuplicate" optional="YES" attributeType="Boolean" usesScalarValueType="YES"/>
|
||||||
<attribute name="isSilent" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES"/>
|
<attribute name="isSilent" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES"/>
|
||||||
<attribute name="sortIndex" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES"/>
|
<attribute name="sortIndex" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES"/>
|
||||||
<attribute name="sourceIdentifier" optional="YES" attributeType="String"/>
|
<attribute name="sourceIdentifier" optional="YES" attributeType="String"/>
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -32,6 +32,15 @@ public class NewsItem: NSManagedObject, Decodable, Fetchable
|
|||||||
@NSManaged public var storeApp: StoreApp?
|
@NSManaged public var storeApp: StoreApp?
|
||||||
@NSManaged public var source: Source?
|
@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
|
private enum CodingKeys: String, CodingKey
|
||||||
{
|
{
|
||||||
case identifier
|
case identifier
|
||||||
@@ -86,6 +95,9 @@ public extension NewsItem
|
|||||||
{
|
{
|
||||||
@nonobjc class func fetchRequest() -> NSFetchRequest<NewsItem>
|
@nonobjc class func fetchRequest() -> NSFetchRequest<NewsItem>
|
||||||
{
|
{
|
||||||
return NSFetchRequest<NewsItem>(entityName: "NewsItem")
|
let fetchRequest = NSFetchRequest<NewsItem>(entityName: "NewsItem")
|
||||||
|
fetchRequest.predicate = NSPredicate(format: "%K == NO",
|
||||||
|
#keyPath(NewsItem.isDuplicate))
|
||||||
|
return fetchRequest
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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://apps.sidestore.io/"
|
||||||
|
|
||||||
#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 {
|
||||||
|
|||||||
@@ -343,16 +343,28 @@ public extension StoreApp
|
|||||||
{
|
{
|
||||||
let app = StoreApp(context: context)
|
let app = StoreApp(context: context)
|
||||||
app.name = "SideStore"
|
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.bundleIdentifier = StoreApp.altstoreAppID
|
||||||
app.developerName = "Side Team"
|
app.developerName = "SideStore Team"
|
||||||
app.localizedDescription = "SideStore is an alternative App Store."
|
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://user-images.githubusercontent.com/705880/63392210-540c5980-c37b-11e9-968c-8742fc68ab2e.png")!
|
app.iconURL = URL(string: "https://sidestore.io/assets/icon.png")!
|
||||||
app.screenshotURLs = []
|
app.screenshotURLs = []
|
||||||
app.sourceIdentifier = Source.altStoreIdentifier
|
app.sourceIdentifier = Source.altStoreIdentifier
|
||||||
|
|
||||||
let appVersion = AppVersion.makeAppVersion(version: "0.3.0",
|
let appVersion = AppVersion.makeAppVersion(version: "0.0.0", // this is set to the current app version later
|
||||||
date: Date(),
|
date: Date(),
|
||||||
downloadURL: URL(string: "http://rileytestut.com")!,
|
downloadURL: URL(string: "https://sidestore.io")!,
|
||||||
size: 0,
|
size: 0,
|
||||||
appBundleID: app.bundleIdentifier,
|
appBundleID: app.bundleIdentifier,
|
||||||
sourceID: Source.altStoreIdentifier,
|
sourceID: Source.altStoreIdentifier,
|
||||||
@@ -361,10 +373,6 @@ public extension StoreApp
|
|||||||
|
|
||||||
print("makeAltStoreApp StoreApp: \(String(describing: app))")
|
print("makeAltStoreApp StoreApp: \(String(describing: app))")
|
||||||
|
|
||||||
#if BETA
|
|
||||||
app.isBeta = true
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return app
|
return app
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,14 @@
|
|||||||
{
|
{
|
||||||
"identifier": "io.sidestore.example"
|
"identifier": "io.sidestore.example"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"identifier": "com.SideStore.SideStore",
|
||||||
|
"sourceURL": "https://apps.sidestore.io/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"identifier": "com.SideStore.SideStore.Beta",
|
||||||
|
"sourceURL": "https://apps.sidestore.io/beta"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"identifier": "com.sidestoreapps.community",
|
"identifier": "com.sidestoreapps.community",
|
||||||
"sourceURL": "https://community-apps.sidestore.io/sidecommunity.json"
|
"sourceURL": "https://community-apps.sidestore.io/sidecommunity.json"
|
||||||
|
|||||||
Reference in New Issue
Block a user