From eed895f145f64b2cd6cff40a5499869458c073e5 Mon Sep 17 00:00:00 2001 From: mahee96 <47920326+mahee96@users.noreply.github.com> Date: Sun, 22 Feb 2026 15:38:23 +0530 Subject: [PATCH] debloat: removed more patreon stuff carried over from altstore 2.0 --- AltStore/AppDelegate.swift | 7 -- AltStore/SceneDelegate.swift | 5 -- AltStore/Settings/AboutPatreonHeaderView.xib | 4 +- AltStore/Settings/PatreonComponents.swift | 57 ------------- AltStore/Settings/PatreonViewController.swift | 79 ++++++++++++------- AltStore/TabBarController.swift | 6 -- 6 files changed, 53 insertions(+), 105 deletions(-) delete mode 100644 AltStore/Settings/PatreonComponents.swift diff --git a/AltStore/AppDelegate.swift b/AltStore/AppDelegate.swift index 96e52f23..14c90c91 100644 --- a/AltStore/AppDelegate.swift +++ b/AltStore/AppDelegate.swift @@ -246,13 +246,6 @@ private extension AppDelegate switch host { - case "patreon": - DispatchQueue.main.async { - NotificationCenter.default.post(name: AppDelegate.openPatreonSettingsDeepLinkNotification, object: nil) - } - - return true - case "appbackupresponse": let result: Result diff --git a/AltStore/SceneDelegate.swift b/AltStore/SceneDelegate.swift index 44a52641..b86739e8 100644 --- a/AltStore/SceneDelegate.swift +++ b/AltStore/SceneDelegate.swift @@ -99,11 +99,6 @@ private extension SceneDelegate switch host { - case "patreon": - DispatchQueue.main.async { - NotificationCenter.default.post(name: AppDelegate.openPatreonSettingsDeepLinkNotification, object: nil) - } - case "appbackupresponse": let result: Result diff --git a/AltStore/Settings/AboutPatreonHeaderView.xib b/AltStore/Settings/AboutPatreonHeaderView.xib index bf56dac3..7f6fd2c6 100644 --- a/AltStore/Settings/AboutPatreonHeaderView.xib +++ b/AltStore/Settings/AboutPatreonHeaderView.xib @@ -122,9 +122,9 @@ Following us on social media allows us to give quick updates and spread the word - - + + diff --git a/AltStore/Settings/PatreonComponents.swift b/AltStore/Settings/PatreonComponents.swift deleted file mode 100644 index ba9b2a5f..00000000 --- a/AltStore/Settings/PatreonComponents.swift +++ /dev/null @@ -1,57 +0,0 @@ -// -// PatreonComponents.swift -// AltStore -// -// Created by Riley Testut on 9/5/19. -// Copyright © 2019 Riley Testut. All rights reserved. -// - -import UIKit - -//final class PatronCollectionViewCell: UICollectionViewCell -//{ -// @IBOutlet var textLabel: UILabel! -//} - - -final class AboutPatreonHeaderView: UICollectionReusableView -{ - @IBOutlet var supportButton: UIButton! - @IBOutlet var twitterButton: UIButton! - @IBOutlet var instagramButton: UIButton! - @IBOutlet var textView: UITextView! - - @IBOutlet private var rileyLabel: UILabel! - @IBOutlet private var shaneLabel: UILabel! - - @IBOutlet private var rileyImageView: UIImageView! - - override func awakeFromNib() - { - super.awakeFromNib() - - self.textView.clipsToBounds = true - self.textView.layer.cornerRadius = 20 - self.textView.textContainer.lineFragmentPadding = 0 - - for imageView in [self.rileyImageView].compactMap({$0}) - { - imageView.clipsToBounds = true - imageView.layer.cornerRadius = imageView.bounds.midY - } - - for button in [self.supportButton, self.twitterButton, self.instagramButton].compactMap({$0}) - { - button.clipsToBounds = true - button.layer.cornerRadius = 16 - } - } - - override func layoutMarginsDidChange() - { - super.layoutMarginsDidChange() - - self.textView.textContainerInset = UIEdgeInsets(top: self.layoutMargins.left, left: self.layoutMargins.left, bottom: self.layoutMargins.right, right: self.layoutMargins.right) - } -} - diff --git a/AltStore/Settings/PatreonViewController.swift b/AltStore/Settings/PatreonViewController.swift index f95ae098..017ef8a6 100644 --- a/AltStore/Settings/PatreonViewController.swift +++ b/AltStore/Settings/PatreonViewController.swift @@ -8,12 +8,8 @@ import UIKit import SafariServices -import AuthenticationServices -import AltStoreCore -import Roxas - -final class PatreonViewController: UICollectionViewController +final class PatreonViewController: UICollectionViewController, UICollectionViewDelegateFlowLayout { private var prototypeAboutHeader: AboutPatreonHeaderView! @@ -46,10 +42,7 @@ final class PatreonViewController: UICollectionViewController // TODO: if the intention here is to hide the cells, we should just modify the data source. @JoeMatt layout.itemSize = CGSize(width: 0, height: 0) } -} -private extension PatreonViewController -{ func prepare(_ headerView: AboutPatreonHeaderView) { headerView.layoutMargins = self.view.layoutMargins @@ -57,10 +50,24 @@ private extension PatreonViewController headerView.twitterButton.addTarget(self, action: #selector(PatreonViewController.openTwitterURL(_:)), for: .primaryActionTriggered) headerView.instagramButton.addTarget(self, action: #selector(PatreonViewController.openInstagramURL(_:)), for: .primaryActionTriggered) } -} + + override func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView + { + let headerView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "AboutHeader", for: indexPath) as! AboutPatreonHeaderView + self.prepare(headerView) + return headerView + } + + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize + { + let widthConstraint = self.prototypeAboutHeader.widthAnchor.constraint(equalToConstant: collectionView.bounds.width) + NSLayoutConstraint.activate([widthConstraint]) + defer { NSLayoutConstraint.deactivate([widthConstraint]) } + + self.prepare(self.prototypeAboutHeader) + return self.prototypeAboutHeader.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize) + } -private extension PatreonViewController -{ @objc func openPatreonURL(_ sender: UIButton) { let patreonURL = URL(string: "https://www.patreon.com/SideStoreIO")! @@ -89,25 +96,41 @@ private extension PatreonViewController } } -extension PatreonViewController +final class AboutPatreonHeaderView: UICollectionReusableView { - override func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView + @IBOutlet var supportButton: UIButton! + @IBOutlet var twitterButton: UIButton! + @IBOutlet var instagramButton: UIButton! + @IBOutlet var textView: UITextView! + + @IBOutlet private var teamIcon: UIImageView! + @IBOutlet private var teamLabel: UILabel! + + override func awakeFromNib() { - let headerView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "AboutHeader", for: indexPath) as! AboutPatreonHeaderView - self.prepare(headerView) - return headerView + super.awakeFromNib() + + self.textView.clipsToBounds = true + self.textView.layer.cornerRadius = 20 + self.textView.textContainer.lineFragmentPadding = 0 + + for imageView in [self.teamIcon].compactMap({$0}) + { + imageView.clipsToBounds = true + imageView.layer.cornerRadius = imageView.bounds.midY + } + + for button in [self.supportButton, self.twitterButton, self.instagramButton].compactMap({$0}) + { + button.clipsToBounds = true + button.layer.cornerRadius = 16 + } + } + + override func layoutMarginsDidChange() + { + super.layoutMarginsDidChange() + self.textView.textContainerInset = UIEdgeInsets(top: self.layoutMargins.left, left: self.layoutMargins.left, bottom: self.layoutMargins.right, right: self.layoutMargins.right) } } -extension PatreonViewController: UICollectionViewDelegateFlowLayout -{ - func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize - { - let widthConstraint = self.prototypeAboutHeader.widthAnchor.constraint(equalToConstant: collectionView.bounds.width) - NSLayoutConstraint.activate([widthConstraint]) - defer { NSLayoutConstraint.deactivate([widthConstraint]) } - - self.prepare(self.prototypeAboutHeader) - return self.prototypeAboutHeader.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize) - } -} diff --git a/AltStore/TabBarController.swift b/AltStore/TabBarController.swift index e60082ae..3f9ded15 100644 --- a/AltStore/TabBarController.swift +++ b/AltStore/TabBarController.swift @@ -33,7 +33,6 @@ final class TabBarController: UITabBarController { super.init(coder: aDecoder) - NotificationCenter.default.addObserver(self, selector: #selector(TabBarController.openPatreonSettings(_:)), name: AppDelegate.openPatreonSettingsDeepLinkNotification, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(TabBarController.importApp(_:)), name: AppDelegate.importAppDeepLinkNotification, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(TabBarController.presentSources(_:)), name: AppDelegate.addSourceDeepLinkNotification, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(TabBarController.exportFiles(_:)), name: AppDelegate.exportCertificateNotification, object: nil) @@ -128,11 +127,6 @@ extension TabBarController private extension TabBarController { - @objc func openPatreonSettings(_ notification: Notification) - { - self.selectedIndex = Tab.settings.rawValue - } - @objc func importApp(_ notification: Notification) { self.selectedIndex = Tab.myApps.rawValue