diff --git a/AltStore/Operations/DownloadAppOperation.swift b/AltStore/Operations/DownloadAppOperation.swift index 99c01136..4b0bbadb 100644 --- a/AltStore/Operations/DownloadAppOperation.swift +++ b/AltStore/Operations/DownloadAppOperation.swift @@ -301,6 +301,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. diff --git a/AltStore/Operations/FetchSourceOperation.swift b/AltStore/Operations/FetchSourceOperation.swift index 36c12ef3..7c0ec04e 100644 --- a/AltStore/Operations/FetchSourceOperation.swift +++ b/AltStore/Operations/FetchSourceOperation.swift @@ -153,6 +153,11 @@ class FetchSourceOperation: ResultOperation 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) diff --git a/AltStoreCore/Extensions/UserDefaults+AltStore.swift b/AltStoreCore/Extensions/UserDefaults+AltStore.swift index 9b3551f4..507d443c 100644 --- a/AltStoreCore/Extensions/UserDefaults+AltStore.swift +++ b/AltStoreCore/Extensions/UserDefaults+AltStore.swift @@ -39,6 +39,8 @@ public extension UserDefaults @NSManaged var patronsRefreshID: String? + @NSManaged var skipPatreonDownloads: Bool + @nonobjc var activeAppsLimit: Int? { get { diff --git a/AltStoreCore/Types/ALTSourceUserInfoKey.h b/AltStoreCore/Types/ALTSourceUserInfoKey.h index f18a0365..5621334e 100644 --- a/AltStoreCore/Types/ALTSourceUserInfoKey.h +++ b/AltStoreCore/Types/ALTSourceUserInfoKey.h @@ -10,3 +10,4 @@ typedef NSString *ALTSourceUserInfoKey NS_TYPED_EXTENSIBLE_ENUM; extern ALTSourceUserInfoKey const ALTSourceUserInfoKeyPatreonAccessToken; +extern ALTSourceUserInfoKey const ALTSourceUserInfoKeySkipPatreonDownloads; diff --git a/AltStoreCore/Types/ALTSourceUserInfoKey.m b/AltStoreCore/Types/ALTSourceUserInfoKey.m index 4d715cdc..d326b71f 100644 --- a/AltStoreCore/Types/ALTSourceUserInfoKey.m +++ b/AltStoreCore/Types/ALTSourceUserInfoKey.m @@ -9,3 +9,4 @@ #import "ALTSourceUserInfoKey.h" ALTSourceUserInfoKey const ALTSourceUserInfoKeyPatreonAccessToken = @"patreonAccessToken"; +ALTSourceUserInfoKey const ALTSourceUserInfoKeySkipPatreonDownloads = @"skipPatreonDownloads";