diff --git a/AltStore/Operations/DownloadAppOperation.swift b/AltStore/Operations/DownloadAppOperation.swift index 38aa4228..d0d518a8 100644 --- a/AltStore/Operations/DownloadAppOperation.swift +++ b/AltStore/Operations/DownloadAppOperation.swift @@ -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. diff --git a/AltStore/Operations/FetchSourceOperation.swift b/AltStore/Operations/FetchSourceOperation.swift index c161f797..b47c6ffa 100644 --- a/AltStore/Operations/FetchSourceOperation.swift +++ b/AltStore/Operations/FetchSourceOperation.swift @@ -153,6 +153,11 @@ final 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 0a4b1f7a..fcff08b0 100644 --- a/AltStoreCore/Extensions/UserDefaults+AltStore.swift +++ b/AltStoreCore/Extensions/UserDefaults+AltStore.swift @@ -51,6 +51,7 @@ public extension UserDefaults @NSManaged var trustedSourceIDs: [String]? @NSManaged var trustedServerURL: String? + @NSManaged var skipPatreonDownloads: Bool @nonobjc var activeAppsLimit: Int? { 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";