mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-08 22:33:26 +01:00
Supports remotely disabling workaround for downloading Patreon attachments
In case our workaround for downloading Patreon post attachments breaks, we can remotely disable it and force AltStore to use its fallback instead (taking user to post directly).
This commit is contained in:
@@ -289,6 +289,11 @@ private extension DownloadAppOperation {
|
||||
|
||||
func downloadPatreonApp(from patreonURL: URL) async throws -> URL
|
||||
{
|
||||
guard !UserDefaults.shared.skipPatreonDownloads else {
|
||||
// Skip all hacks, take user straight to Patreon post.
|
||||
return try await downloadFromPatreonPost()
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
// User is pledged to this app, attempt to download.
|
||||
|
||||
@@ -153,6 +153,11 @@ final class FetchSourceOperation: ResultOperation<Source>
|
||||
|
||||
let identifier = source.identifier
|
||||
|
||||
if identifier == Source.altStoreIdentifier, let skipPatreonDownloads = source.userInfo?[.skipPatreonDownloads]
|
||||
{
|
||||
UserDefaults.shared.skipPatreonDownloads = (skipPatreonDownloads == "true")
|
||||
}
|
||||
|
||||
try self.verify(source, response: response)
|
||||
try self.verifyPledges(for: source, in: childContext)
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ public extension UserDefaults
|
||||
|
||||
@NSManaged var trustedSourceIDs: [String]?
|
||||
@NSManaged var trustedServerURL: String?
|
||||
@NSManaged var skipPatreonDownloads: Bool
|
||||
|
||||
@nonobjc
|
||||
var activeAppsLimit: Int? {
|
||||
|
||||
@@ -10,3 +10,4 @@
|
||||
|
||||
typedef NSString *ALTSourceUserInfoKey NS_TYPED_EXTENSIBLE_ENUM;
|
||||
extern ALTSourceUserInfoKey const ALTSourceUserInfoKeyPatreonAccessToken;
|
||||
extern ALTSourceUserInfoKey const ALTSourceUserInfoKeySkipPatreonDownloads;
|
||||
|
||||
@@ -9,3 +9,4 @@
|
||||
#import "ALTSourceUserInfoKey.h"
|
||||
|
||||
ALTSourceUserInfoKey const ALTSourceUserInfoKeyPatreonAccessToken = @"patreonAccessToken";
|
||||
ALTSourceUserInfoKey const ALTSourceUserInfoKeySkipPatreonDownloads = @"skipPatreonDownloads";
|
||||
|
||||
Reference in New Issue
Block a user