mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-14 09:13:25 +01:00
Supports adding trusted sources from SourcesViewController
Previously, only the beta version of AltStore could add sources. Now, the public version supports adding explicitly “trusted” sources, while the beta version can continue to add any source.
This commit is contained in:
@@ -312,9 +312,12 @@ extension AppManager
|
||||
|
||||
extension AppManager
|
||||
{
|
||||
func fetchSource(sourceURL: URL, completionHandler: @escaping (Result<Source, Error>) -> Void)
|
||||
func fetchSource(sourceURL: URL,
|
||||
managedObjectContext: NSManagedObjectContext = DatabaseManager.shared.persistentContainer.newBackgroundContext(),
|
||||
dependencies: [Foundation.Operation] = [],
|
||||
completionHandler: @escaping (Result<Source, Error>) -> Void)
|
||||
{
|
||||
let fetchSourceOperation = FetchSourceOperation(sourceURL: sourceURL)
|
||||
let fetchSourceOperation = FetchSourceOperation(sourceURL: sourceURL, managedObjectContext: managedObjectContext)
|
||||
fetchSourceOperation.resultHandler = { (result) in
|
||||
switch result
|
||||
{
|
||||
@@ -326,6 +329,11 @@ extension AppManager
|
||||
}
|
||||
}
|
||||
|
||||
for dependency in dependencies
|
||||
{
|
||||
fetchSourceOperation.addDependency(dependency)
|
||||
}
|
||||
|
||||
self.run([fetchSourceOperation], context: nil)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user