From d00e6de8a2b6db24743a9ac1d31862d13ed1c2ab Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Wed, 1 Mar 2023 15:00:27 -0600 Subject: [PATCH] [Shared] Updates CocoaPods dependencies --- .gitignore | 2 + .../App Detail/AppContentViewController.swift | 15 +++--- AltStore/App Detail/AppViewController.swift | 7 +-- .../Browse/BrowseCollectionViewCell.swift | 15 +++--- AltStore/Browse/BrowseViewController.swift | 13 ++--- AltStore/My Apps/MyAppsViewController.swift | 13 ++--- AltStore/News/NewsViewController.swift | 13 ++--- .../Error Log/ErrorLogViewController.swift | 11 ++--- AltStore/Types/ScreenshotProcessor.swift | 4 +- Podfile | 41 ++++++++++++++++ Podfile.lock | 47 +++++++++++++++++++ 11 files changed, 128 insertions(+), 53 deletions(-) create mode 100644 Podfile create mode 100644 Podfile.lock diff --git a/.gitignore b/.gitignore index 72b3ada8..cc76d321 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,8 @@ # Xcode # +Pods/ + ## Build generated build/ DerivedData diff --git a/AltStore/App Detail/AppContentViewController.swift b/AltStore/App Detail/AppContentViewController.swift index 2aacf37c..199f3a39 100644 --- a/AltStore/App Detail/AppContentViewController.swift +++ b/AltStore/App Detail/AppContentViewController.swift @@ -149,19 +149,16 @@ private extension AppContentViewController } dataSource.prefetchHandler = { (imageURL, indexPath, completionHandler) in return RSTAsyncBlockOperation() { (operation) in - let request = ImageRequest(url: imageURL as URL, processor: .screenshot) - ImagePipeline.shared.loadImage(with: request, progress: nil, completion: { (response, error) in + let request = ImageRequest(url: imageURL as URL, processors: [.screenshot]) + ImagePipeline.shared.loadImage(with: request, progress: nil) { result in guard !operation.isCancelled else { return operation.finish() } - if let image = response?.image + switch result { - completionHandler(image, nil) + case .success(let response): completionHandler(response.image, nil) + case .failure(let error): completionHandler(nil, error) } - else - { - completionHandler(nil, error) - } - }) + } } } dataSource.prefetchCompletionHandler = { (cell, image, indexPath, error) in diff --git a/AltStore/App Detail/AppViewController.swift b/AltStore/App Detail/AppViewController.swift index aff7a3f2..35774d2b 100644 --- a/AltStore/App Detail/AppViewController.swift +++ b/AltStore/App Detail/AppViewController.swift @@ -118,10 +118,11 @@ final class AppViewController: UIViewController { imageView.isIndicatingActivity = true - Nuke.loadImage(with: self.app.iconURL, options: .shared, into: imageView, progress: nil) { [weak imageView] (response, error) in - if response?.image != nil + Nuke.loadImage(with: self.app.iconURL, options: .shared, into: imageView, progress: nil) { [weak imageView] (result) in + switch result { - imageView?.isIndicatingActivity = false + case .success: imageView?.isIndicatingActivity = false + case .failure(let error): print("[ALTLog] Failed to load app icons.", error) } } } diff --git a/AltStore/Browse/BrowseCollectionViewCell.swift b/AltStore/Browse/BrowseCollectionViewCell.swift index 2eafc1d4..2fae77bd 100644 --- a/AltStore/Browse/BrowseCollectionViewCell.swift +++ b/AltStore/Browse/BrowseCollectionViewCell.swift @@ -53,19 +53,16 @@ private extension BrowseCollectionViewCell } dataSource.prefetchHandler = { (imageURL, indexPath, completionHandler) in return RSTAsyncBlockOperation() { (operation) in - let request = ImageRequest(url: imageURL as URL, processor: .screenshot) - ImagePipeline.shared.loadImage(with: request, progress: nil, completion: { (response, error) in + let request = ImageRequest(url: imageURL as URL, processors: [.screenshot]) + ImagePipeline.shared.loadImage(with: request, progress: nil) { result in guard !operation.isCancelled else { return operation.finish() } - if let image = response?.image + switch result { - completionHandler(image, nil) + case .success(let response): completionHandler(response.image, nil) + case .failure(let error): completionHandler(nil, error) } - else - { - completionHandler(nil, error) - } - }) + } } } dataSource.prefetchCompletionHandler = { (cell, image, indexPath, error) in diff --git a/AltStore/Browse/BrowseViewController.swift b/AltStore/Browse/BrowseViewController.swift index 6693fa3c..87effb6f 100644 --- a/AltStore/Browse/BrowseViewController.swift +++ b/AltStore/Browse/BrowseViewController.swift @@ -136,18 +136,15 @@ private extension BrowseViewController let iconURL = storeApp.iconURL return RSTAsyncBlockOperation() { (operation) in - ImagePipeline.shared.loadImage(with: iconURL, progress: nil, completion: { (response, error) in + ImagePipeline.shared.loadImage(with: iconURL, progress: nil) { result in guard !operation.isCancelled else { return operation.finish() } - if let image = response?.image + switch result { - completionHandler(image, nil) + case .success(let response): completionHandler(response.image, nil) + case .failure(let error): completionHandler(nil, error) } - else - { - completionHandler(nil, error) - } - }) + } } } dataSource.prefetchCompletionHandler = { (cell, image, indexPath, error) in diff --git a/AltStore/My Apps/MyAppsViewController.swift b/AltStore/My Apps/MyAppsViewController.swift index 31d53d07..2d69225b 100644 --- a/AltStore/My Apps/MyAppsViewController.swift +++ b/AltStore/My Apps/MyAppsViewController.swift @@ -278,18 +278,15 @@ private extension MyAppsViewController guard let iconURL = installedApp.storeApp?.iconURL else { return nil } return RSTAsyncBlockOperation() { (operation) in - ImagePipeline.shared.loadImage(with: iconURL, progress: nil, completion: { (response, error) in + ImagePipeline.shared.loadImage(with: iconURL, progress: nil) { result in guard !operation.isCancelled else { return operation.finish() } - if let image = response?.image + switch result { - completionHandler(image, nil) + case .success(let response): completionHandler(response.image, nil) + case .failure(let error): completionHandler(nil, error) } - else - { - completionHandler(nil, error) - } - }) + } } } dataSource.prefetchCompletionHandler = { (cell, image, indexPath, error) in diff --git a/AltStore/News/NewsViewController.swift b/AltStore/News/NewsViewController.swift index 9981d2a0..b2441337 100644 --- a/AltStore/News/NewsViewController.swift +++ b/AltStore/News/NewsViewController.swift @@ -158,18 +158,15 @@ private extension NewsViewController guard let imageURL = newsItem.imageURL else { return nil } return RSTAsyncBlockOperation() { (operation) in - ImagePipeline.shared.loadImage(with: imageURL, progress: nil, completion: { (response, error) in + ImagePipeline.shared.loadImage(with: imageURL, progress: nil) { result in guard !operation.isCancelled else { return operation.finish() } - if let image = response?.image + switch result { - completionHandler(image, nil) + case .success(let response): completionHandler(response.image, nil) + case .failure(let error): completionHandler(nil, error) } - else - { - completionHandler(nil, error) - } - }) + } } } dataSource.prefetchCompletionHandler = { (cell, image, indexPath, error) in diff --git a/AltStore/Settings/Error Log/ErrorLogViewController.swift b/AltStore/Settings/Error Log/ErrorLogViewController.swift index e0e8504c..2dac9563 100644 --- a/AltStore/Settings/Error Log/ErrorLogViewController.swift +++ b/AltStore/Settings/Error Log/ErrorLogViewController.swift @@ -140,16 +140,13 @@ private extension ErrorLogViewController } else if let storeApp = loggedError.storeApp { - ImagePipeline.shared.loadImage(with: storeApp.iconURL, progress: nil) { (response, error) in + ImagePipeline.shared.loadImage(with: storeApp.iconURL, progress: nil) { result in guard !operation.isCancelled else { return operation.finish() } - if let image = response?.image + switch result { - completion(image, nil) - } - else - { - completion(nil, error) + case .success(let response): completion(response.image, nil) + case .failure(let error): completion(nil, error) } } } diff --git a/AltStore/Types/ScreenshotProcessor.swift b/AltStore/Types/ScreenshotProcessor.swift index ce1ad8b5..2f3f6b45 100644 --- a/AltStore/Types/ScreenshotProcessor.swift +++ b/AltStore/Types/ScreenshotProcessor.swift @@ -10,7 +10,9 @@ import Nuke struct ScreenshotProcessor: ImageProcessing { - func process(image: Image, context: ImageProcessingContext) -> Image? + var identifier: String { "io.altstore.ScreenshotProcessor" } + + func process(_ image: PlatformImage) -> PlatformImage? { guard let cgImage = image.cgImage, image.size.width > image.size.height else { return image } diff --git a/Podfile b/Podfile new file mode 100644 index 00000000..d8978b56 --- /dev/null +++ b/Podfile @@ -0,0 +1,41 @@ +inhibit_all_warnings! + +target 'AltStore' do + platform :ios, '14.0' + + use_frameworks! + + # Pods for AltStore + pod 'Nuke', '~> 10.0' + pod 'AppCenter', '~> 5.0' + +end + +target 'AltServer' do + platform :macos, '11' + + use_frameworks! + + # Pods for AltServer + pod 'STPrivilegedTask', :git => 'https://github.com/rileytestut/STPrivilegedTask.git' + pod 'Sparkle', '~> 2.3' + +end + +target 'AltStoreCore' do + platform :ios, '14.0' + + use_frameworks! + + # Pods for AltServer + pod 'KeychainAccess', '~> 4.2.0' + +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + target.build_configurations.each do |config| + config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '14.0' + end + end +end \ No newline at end of file diff --git a/Podfile.lock b/Podfile.lock new file mode 100644 index 00000000..e09fe4bd --- /dev/null +++ b/Podfile.lock @@ -0,0 +1,47 @@ +PODS: + - AppCenter (5.0.1): + - AppCenter/Analytics (= 5.0.1) + - AppCenter/Crashes (= 5.0.1) + - AppCenter/Analytics (5.0.1): + - AppCenter/Core + - AppCenter/Core (5.0.1) + - AppCenter/Crashes (5.0.1): + - AppCenter/Core + - KeychainAccess (4.2.2) + - Nuke (10.7.1) + - Sparkle (2.3.2) + - STPrivilegedTask (1.0.7) + +DEPENDENCIES: + - AppCenter (~> 5.0) + - KeychainAccess (~> 4.2.0) + - Nuke (~> 10.0) + - Sparkle (~> 2.3) + - STPrivilegedTask (from `https://github.com/rileytestut/STPrivilegedTask.git`) + +SPEC REPOS: + trunk: + - AppCenter + - KeychainAccess + - Nuke + - Sparkle + +EXTERNAL SOURCES: + STPrivilegedTask: + :git: https://github.com/rileytestut/STPrivilegedTask.git + +CHECKOUT OPTIONS: + STPrivilegedTask: + :commit: 6ca513d0dcb2aefb0e5a95915b77bbbbd8a6d942 + :git: https://github.com/rileytestut/STPrivilegedTask.git + +SPEC CHECKSUMS: + AppCenter: 18153bb6bc4241d14c8cce57466ac1c88136b476 + KeychainAccess: c0c4f7f38f6fc7bbe58f5702e25f7bd2f65abf51 + Nuke: 279f17a599fd1c83cf51de5e0e1f2db143a287b0 + Sparkle: b36a51855e81585a1c38e32e53101d36c00f4304 + STPrivilegedTask: 56c3397238a1ec07720fb877a044898373cd2c68 + +PODFILE CHECKSUM: ca0ab842e91a672a9020d57cc032e765532a5163 + +COCOAPODS: 1.11.3