diff --git a/AltStore/App Detail/AppViewController.swift b/AltStore/App Detail/AppViewController.swift index 804dc4ad..f5d03dfd 100644 --- a/AltStore/App Detail/AppViewController.swift +++ b/AltStore/App Detail/AppViewController.swift @@ -392,7 +392,6 @@ private extension AppViewController { var buttonAction: AppBannerView.AppAction? - // if let installedApp = self.app.installedApp, let latestVersion = self.app.latestAvailableVersion, !installedApp.matches(latestVersion), !self.app.isPledgeRequired || self.app.isPledged if let installedApp = self.app.installedApp, installedApp.hasUpdate { // Explicitly set button action to .update if there is an update available, even if it's not supported. @@ -543,7 +542,6 @@ extension AppViewController { if let installedApp = self.app.installedApp { - // if let latestVersion = self.app.latestAvailableVersion, !installedApp.matches(latestVersion), !self.app.isPledgeRequired || self.app.isPledged if let latestVersion = self.app.latestAvailableVersion, installedApp.hasUpdate { self.updateApp(installedApp, to: latestVersion) diff --git a/AltStore/Browse/FeaturedViewController.swift b/AltStore/Browse/FeaturedViewController.swift index 56db1de3..b902ba87 100644 --- a/AltStore/Browse/FeaturedViewController.swift +++ b/AltStore/Browse/FeaturedViewController.swift @@ -363,13 +363,13 @@ private extension FeaturedViewController let sourceHasRemainingAppsPredicate = NSPredicate(format: """ SUBQUERY(%K, $app, - ($app.%K != %@) AND ($app.%K == nil) AND (($app.%K == NO) OR ($app.%K == NO) OR ($app.%K == YES)) + ($app.%K != %@) AND ($app.%K == nil) ).@count > 0 """, - #keyPath(StoreApp._source._apps), - #keyPath(StoreApp.bundleIdentifier), StoreApp.altstoreAppID, - #keyPath(StoreApp.installedApp), - #keyPath(StoreApp.isPledgeRequired), #keyPath(StoreApp.isHiddenWithoutPledge), #keyPath(StoreApp.isPledged) + #keyPath(StoreApp._source._apps), + #keyPath(StoreApp.bundleIdentifier), + StoreApp.altstoreAppID, + #keyPath(StoreApp.installedApp), ) let primaryFetchRequest = fetchRequest.copy() as! NSFetchRequest diff --git a/AltStore/Components/AppBannerView.swift b/AltStore/Components/AppBannerView.swift index acf13db9..e07548eb 100644 --- a/AltStore/Components/AppBannerView.swift +++ b/AltStore/Components/AppBannerView.swift @@ -167,29 +167,7 @@ extension AppBannerView self.subtitleLabel.text = NSLocalizedString("Sideloaded", comment: "") self.accessibilityLabel = values.name } - - if let storeApp = app.storeApp, storeApp.isPledgeRequired - { - // Always show button label for Patreon apps. - self.buttonLabel.isHidden = false - - if storeApp.isPledged - { - self.buttonLabel.text = NSLocalizedString("Pledged", comment: "") - } - else if storeApp.installedApp != nil - { - self.buttonLabel.text = NSLocalizedString("Pledge Expired", comment: "") - } - else - { - self.buttonLabel.text = NSLocalizedString("Join Patreon", comment: "") - } - } - else - { - self.buttonLabel.isHidden = true - } + self.buttonLabel.isHidden = true if let source = app.storeApp?.source, showSourceIcon { @@ -294,15 +272,6 @@ extension AppBannerView self.button.accessibilityLabel = String(format: NSLocalizedString("Install %@", comment: ""), app.name) self.button.accessibilityValue = buttonTitle } - else if let amount = storeApp.pledgeAmount, let currencyCode = storeApp.pledgeCurrency, !storeApp.prefersCustomPledge, #available(iOS 15, *) - { - let price = amount.formatted(.currency(code: currencyCode).presentation(.narrow).precision(.fractionLength(0...2))) - - let buttonTitle = String(format: NSLocalizedString("%@/mo", comment: ""), price) - self.button.setTitle(buttonTitle, for: .normal) - self.button.accessibilityLabel = String(format: NSLocalizedString("Pledge %@ a month", comment: ""), price) - self.button.accessibilityValue = String(format: NSLocalizedString("%@ a month", comment: ""), price) - } else { let buttonTitle = NSLocalizedString("Pledge", comment: "") diff --git a/AltStore/Managing Apps/AppManager.swift b/AltStore/Managing Apps/AppManager.swift index 2a6d21a6..dd435c00 100644 --- a/AltStore/Managing Apps/AppManager.swift +++ b/AltStore/Managing Apps/AppManager.swift @@ -1562,8 +1562,6 @@ private extension AppManager if let storeApp = downloadingApp.storeApp, storeApp.isPledgeRequired { - // Patreon apps may require authenticating with WebViewController, - // so make sure to run DownloadAppOperation serially. self.run([downloadOperation], context: group.context, requiresSerialQueue: true) if let index = operations.firstIndex(of: downloadOperation) diff --git a/AltStore/My Apps/MyAppsViewController.swift b/AltStore/My Apps/MyAppsViewController.swift index 297b56fb..e753537d 100644 --- a/AltStore/My Apps/MyAppsViewController.swift +++ b/AltStore/My Apps/MyAppsViewController.swift @@ -120,7 +120,6 @@ class MyAppsViewController: UICollectionViewController, PeekPopPreviewing { super.viewIsAppearing(animated) - // Ensure the button for each app reflects correct Patreon status. self.collectionView.reloadData() self.update() @@ -1990,8 +1989,6 @@ extension MyAppsViewController for action in actions where !allowedActions.contains(action) { - // Disable options for Patreon apps that we are no longer pledged to. - if let action = action as? UIAction { action.attributes = .disabled diff --git a/AltStore/Operations/DownloadAppOperation.swift b/AltStore/Operations/DownloadAppOperation.swift index b0068545..676af4d2 100644 --- a/AltStore/Operations/DownloadAppOperation.swift +++ b/AltStore/Operations/DownloadAppOperation.swift @@ -30,8 +30,6 @@ final class DownloadAppOperation: ResultOperation private let session = URLSession(configuration: .default) private let temporaryDirectory = FileManager.default.uniqueTemporaryURL() - private var downloadPatreonAppContinuation: CheckedContinuation? - init(app: AppProtocol, destinationURL: URL, context: InstallAppOperationContext) { self.app = app @@ -320,61 +318,6 @@ private extension DownloadAppOperation } } -extension DownloadAppOperation: WebViewControllerDelegate -{ - func webViewControllerDidFinish(_ webViewController: WebViewController) - { - guard let continuation = self.downloadPatreonAppContinuation else { return } - self.downloadPatreonAppContinuation = nil - - continuation.resume(throwing: CancellationError()) - } -} - -extension DownloadAppOperation: WKNavigationDelegate -{ - func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction) async -> WKNavigationActionPolicy - { - guard #available(iOS 14.5, *), navigationAction.shouldPerformDownload else { return .allow } - - guard let continuation = self.downloadPatreonAppContinuation else { return .allow } - self.downloadPatreonAppContinuation = nil - - if let downloadURL = navigationAction.request.url - { - continuation.resume(returning: downloadURL) - } - else - { - continuation.resume(throwing: URLError(.badURL)) - } - - return .cancel - } - - func webView(_ webView: WKWebView, decidePolicyFor navigationResponse: WKNavigationResponse) async -> WKNavigationResponsePolicy - { - // Called for Patreon attachments - - guard !navigationResponse.canShowMIMEType else { return .allow } - - guard let continuation = self.downloadPatreonAppContinuation else { return .allow } - self.downloadPatreonAppContinuation = nil - - guard let response = navigationResponse.response as? HTTPURLResponse, let responseURL = response.url, - let mimeType = response.mimeType, let type = UTType(mimeType: mimeType), - type.conforms(to: .ipa) || type.conforms(to: .zip) || type.conforms(to: .application) - else { - continuation.resume(throwing: OperationError.invalidApp) - return .cancel - } - - continuation.resume(returning: responseURL) - - return .cancel - } -} - private extension DownloadAppOperation { struct AltStorePlist: Decodable diff --git a/AltStore/Operations/FetchSourceOperation.swift b/AltStore/Operations/FetchSourceOperation.swift index 1e48e593..3e084d95 100644 --- a/AltStore/Operations/FetchSourceOperation.swift +++ b/AltStore/Operations/FetchSourceOperation.swift @@ -171,11 +171,6 @@ 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 childContext.save() diff --git a/AltStore/Settings/PatreonComponents.swift b/AltStore/Settings/PatreonComponents.swift index 0e0a4ea5..ba9b2a5f 100644 --- a/AltStore/Settings/PatreonComponents.swift +++ b/AltStore/Settings/PatreonComponents.swift @@ -8,10 +8,10 @@ import UIKit -final class PatronCollectionViewCell: UICollectionViewCell -{ - @IBOutlet var textLabel: UILabel! -} +//final class PatronCollectionViewCell: UICollectionViewCell +//{ +// @IBOutlet var textLabel: UILabel! +//} final class AboutPatreonHeaderView: UICollectionReusableView @@ -45,7 +45,7 @@ final class AboutPatreonHeaderView: UICollectionReusableView button.clipsToBounds = true button.layer.cornerRadius = 16 } -} + } override func layoutMarginsDidChange() { diff --git a/AltStoreCore/Components/Keychain.swift b/AltStoreCore/Components/Keychain.swift index d653f25e..5ec09e52 100644 --- a/AltStoreCore/Components/Keychain.swift +++ b/AltStoreCore/Components/Keychain.swift @@ -71,18 +71,6 @@ public class Keychain @KeychainItem(key: "signingCertificatePassword") public var signingCertificatePassword: String? - @KeychainItem(key: "patreonAccessToken") - public var patreonAccessToken: String? - - @KeychainItem(key: "patreonRefreshToken") - public var patreonRefreshToken: String? - - @KeychainItem(key: "patreonCreatorAccessToken") - public var patreonCreatorAccessToken: String? - - @KeychainItem(key: "patreonAccountID") - public var patreonAccountID: String? - @KeychainItem(key: "identifier") public var identifier: String? diff --git a/AltStoreCore/Extensions/UserDefaults+AltStore.swift b/AltStoreCore/Extensions/UserDefaults+AltStore.swift index 2b460b3a..a9b3d993 100644 --- a/AltStoreCore/Extensions/UserDefaults+AltStore.swift +++ b/AltStoreCore/Extensions/UserDefaults+AltStore.swift @@ -54,11 +54,8 @@ public extension UserDefaults @NSManaged var patchedApps: [String]? - @NSManaged var patronsRefreshID: String? - @NSManaged var trustedSourceIDs: [String]? @NSManaged var trustedServerURL: String? - @NSManaged var skipPatreonDownloads: Bool @NSManaged var betaUdpatesTrack: String?