diff --git a/.github/workflows/attach_build_products.yml b/.github/workflows/attach_build_products.yml new file mode 100644 index 00000000..1a1ea691 --- /dev/null +++ b/.github/workflows/attach_build_products.yml @@ -0,0 +1,22 @@ +name: Add artifact links to pull request and related issues +on: + workflow_run: + workflows: [Pull Request SideStore build] + types: [completed] + +jobs: + artifacts-url-comments: + name: add artifact links to pull request and related issues job + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} + steps: + - name: add artifact links to pull request and related issues step + uses: tonyhallett/artifacts-url-comments@v1.1.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + prefix: Builds for this Pull Request are available at + suffix: Have a nice day. + format: name + addTo: pull + # addTo: pullandissues diff --git a/AltStore/Analytics/AnalyticsManager.swift b/AltStore/Analytics/AnalyticsManager.swift index 67cea6e7..8c88647f 100644 --- a/AltStore/Analytics/AnalyticsManager.swift +++ b/AltStore/Analytics/AnalyticsManager.swift @@ -71,7 +71,7 @@ extension AnalyticsManager } } -class AnalyticsManager +final class AnalyticsManager { static let shared = AnalyticsManager() diff --git a/AltStore/App Detail/AppContentViewController.swift b/AltStore/App Detail/AppContentViewController.swift index 87d502f4..6dc52b87 100644 --- a/AltStore/App Detail/AppContentViewController.swift +++ b/AltStore/App Detail/AppContentViewController.swift @@ -25,7 +25,7 @@ extension AppContentViewController } } -class AppContentViewController: UITableViewController +final class AppContentViewController: UITableViewController { var app: StoreApp! diff --git a/AltStore/App Detail/AppContentViewControllerCells.swift b/AltStore/App Detail/AppContentViewControllerCells.swift index 923b5d6c..f0eded1a 100644 --- a/AltStore/App Detail/AppContentViewControllerCells.swift +++ b/AltStore/App Detail/AppContentViewControllerCells.swift @@ -8,7 +8,7 @@ import UIKit -class PermissionCollectionViewCell: UICollectionViewCell +final class PermissionCollectionViewCell: UICollectionViewCell { @IBOutlet var button: UIButton! @IBOutlet var textLabel: UILabel! @@ -29,7 +29,7 @@ class PermissionCollectionViewCell: UICollectionViewCell } } -class AppContentTableViewCell: UITableViewCell +final class AppContentTableViewCell: UITableViewCell { override func systemLayoutSizeFitting(_ targetSize: CGSize, withHorizontalFittingPriority horizontalFittingPriority: UILayoutPriority, verticalFittingPriority: UILayoutPriority) -> CGSize { diff --git a/AltStore/App Detail/AppViewController.swift b/AltStore/App Detail/AppViewController.swift index ccc6b4eb..238b90b8 100644 --- a/AltStore/App Detail/AppViewController.swift +++ b/AltStore/App Detail/AppViewController.swift @@ -13,7 +13,7 @@ import Roxas import Nuke -class AppViewController: UIViewController +final class AppViewController: UIViewController { var app: StoreApp! @@ -352,7 +352,7 @@ class AppViewController: UIViewController extension AppViewController { - class func makeAppViewController(app: StoreApp) -> AppViewController + final class func makeAppViewController(app: StoreApp) -> AppViewController { let storyboard = UIStoryboard(name: "Main", bundle: nil) diff --git a/AltStore/App Detail/PermissionPopoverViewController.swift b/AltStore/App Detail/PermissionPopoverViewController.swift index 7c3b1f1d..52174a68 100644 --- a/AltStore/App Detail/PermissionPopoverViewController.swift +++ b/AltStore/App Detail/PermissionPopoverViewController.swift @@ -10,7 +10,7 @@ import UIKit import AltStoreCore -class PermissionPopoverViewController: UIViewController +final class PermissionPopoverViewController: UIViewController { var permission: AppPermission! diff --git a/AltStore/App IDs/AppIDsViewController.swift b/AltStore/App IDs/AppIDsViewController.swift index d5ab49ab..1cd764b4 100644 --- a/AltStore/App IDs/AppIDsViewController.swift +++ b/AltStore/App IDs/AppIDsViewController.swift @@ -11,7 +11,7 @@ import UIKit import AltStoreCore import Roxas -class AppIDsViewController: UICollectionViewController +final class AppIDsViewController: UICollectionViewController { private lazy var dataSource = self.makeDataSource() diff --git a/AltStore/AppDelegate.swift b/AltStore/AppDelegate.swift index bd498aed..34e1b073 100644 --- a/AltStore/AppDelegate.swift +++ b/AltStore/AppDelegate.swift @@ -30,7 +30,7 @@ extension AppDelegate } @UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { +final class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? diff --git a/AltStore/Authentication/AuthenticationViewController.swift b/AltStore/Authentication/AuthenticationViewController.swift index bff72f06..fad4bead 100644 --- a/AltStore/Authentication/AuthenticationViewController.swift +++ b/AltStore/Authentication/AuthenticationViewController.swift @@ -10,7 +10,7 @@ import UIKit import AltSign -class AuthenticationViewController: UIViewController +final class AuthenticationViewController: UIViewController { var authenticationHandler: ((String, String, @escaping (Result<(ALTAccount, ALTAppleAPISession), Error>) -> Void) -> Void)? var completionHandler: (((ALTAccount, ALTAppleAPISession, String)?) -> Void)? diff --git a/AltStore/Authentication/InstructionsViewController.swift b/AltStore/Authentication/InstructionsViewController.swift index 0a37f2be..dc50eca5 100644 --- a/AltStore/Authentication/InstructionsViewController.swift +++ b/AltStore/Authentication/InstructionsViewController.swift @@ -8,7 +8,7 @@ import UIKit -class InstructionsViewController: UIViewController +final class InstructionsViewController: UIViewController { var completionHandler: (() -> Void)? diff --git a/AltStore/Authentication/RefreshAltStoreViewController.swift b/AltStore/Authentication/RefreshAltStoreViewController.swift index 94c5ccb9..cf430d2f 100644 --- a/AltStore/Authentication/RefreshAltStoreViewController.swift +++ b/AltStore/Authentication/RefreshAltStoreViewController.swift @@ -12,7 +12,7 @@ import AltStoreCore import AltSign import Roxas -class RefreshAltStoreViewController: UIViewController +final class RefreshAltStoreViewController: UIViewController { var context: AuthenticatedOperationContext! diff --git a/AltStore/Authentication/SelectTeamViewController.swift b/AltStore/Authentication/SelectTeamViewController.swift index 822dc945..d42f425c 100644 --- a/AltStore/Authentication/SelectTeamViewController.swift +++ b/AltStore/Authentication/SelectTeamViewController.swift @@ -14,7 +14,7 @@ import IntentsUI import AltSign -class SelectTeamViewController: UITableViewController +final class SelectTeamViewController: UITableViewController { public var teams: [ALTTeam]? public var completionHandler: ((Result) -> Void)? diff --git a/AltStore/Browse/BrowseCollectionViewCell.swift b/AltStore/Browse/BrowseCollectionViewCell.swift index 07fae19c..2eafc1d4 100644 --- a/AltStore/Browse/BrowseCollectionViewCell.swift +++ b/AltStore/Browse/BrowseCollectionViewCell.swift @@ -12,7 +12,7 @@ import Roxas import Nuke -@objc class BrowseCollectionViewCell: UICollectionViewCell +@objc final class BrowseCollectionViewCell: UICollectionViewCell { var imageURLs: [URL] = [] { didSet { diff --git a/AltStore/Components/AppIconImageView.swift b/AltStore/Components/AppIconImageView.swift index 08371e8a..ccb207d8 100644 --- a/AltStore/Components/AppIconImageView.swift +++ b/AltStore/Components/AppIconImageView.swift @@ -8,7 +8,7 @@ import UIKit -class AppIconImageView: UIImageView +final class AppIconImageView: UIImageView { override func awakeFromNib() { diff --git a/AltStore/Components/BackgroundTaskManager.swift b/AltStore/Components/BackgroundTaskManager.swift index db44eb0a..5ab54b33 100644 --- a/AltStore/Components/BackgroundTaskManager.swift +++ b/AltStore/Components/BackgroundTaskManager.swift @@ -8,7 +8,7 @@ import AVFoundation -class BackgroundTaskManager +final class BackgroundTaskManager { static let shared = BackgroundTaskManager() diff --git a/AltStore/Components/BannerCollectionViewCell.swift b/AltStore/Components/BannerCollectionViewCell.swift index a478940b..a1a810a8 100644 --- a/AltStore/Components/BannerCollectionViewCell.swift +++ b/AltStore/Components/BannerCollectionViewCell.swift @@ -8,7 +8,7 @@ import UIKit -class BannerCollectionViewCell: UICollectionViewCell +final class BannerCollectionViewCell: UICollectionViewCell { private(set) var errorBadge: UIView? @IBOutlet private(set) var bannerView: AppBannerView! diff --git a/AltStore/Components/Button.swift b/AltStore/Components/Button.swift index 7963c2cf..02f43840 100644 --- a/AltStore/Components/Button.swift +++ b/AltStore/Components/Button.swift @@ -8,7 +8,7 @@ import UIKit -class Button: UIButton +final class Button: UIButton { override var intrinsicContentSize: CGSize { var size = super.intrinsicContentSize diff --git a/AltStore/Components/CollapsingTextView.swift b/AltStore/Components/CollapsingTextView.swift index 656a8fcb..be966c54 100644 --- a/AltStore/Components/CollapsingTextView.swift +++ b/AltStore/Components/CollapsingTextView.swift @@ -8,7 +8,7 @@ import UIKit -class CollapsingTextView: UITextView +final class CollapsingTextView: UITextView { var isCollapsed = true { didSet { diff --git a/AltStore/Components/ForwardingNavigationController.swift b/AltStore/Components/ForwardingNavigationController.swift index 6af0f806..554bb728 100644 --- a/AltStore/Components/ForwardingNavigationController.swift +++ b/AltStore/Components/ForwardingNavigationController.swift @@ -8,7 +8,7 @@ import UIKit -class ForwardingNavigationController: UINavigationController +final class ForwardingNavigationController: UINavigationController { override var childForStatusBarStyle: UIViewController? { return self.topViewController diff --git a/AltStore/Components/NavigationBar.swift b/AltStore/Components/NavigationBar.swift index a57a2599..beb46fac 100644 --- a/AltStore/Components/NavigationBar.swift +++ b/AltStore/Components/NavigationBar.swift @@ -10,7 +10,7 @@ import UIKit import Roxas -class NavigationBar: UINavigationBar +final class NavigationBar: UINavigationBar { @IBInspectable var automaticallyAdjustsItemPositions: Bool = true diff --git a/AltStore/Components/PillButton.swift b/AltStore/Components/PillButton.swift index 04da7992..3527fe02 100644 --- a/AltStore/Components/PillButton.swift +++ b/AltStore/Components/PillButton.swift @@ -8,7 +8,7 @@ import UIKit -class PillButton: UIButton +final class PillButton: UIButton { override var accessibilityValue: String? { get { diff --git a/AltStore/Components/ToastView.swift b/AltStore/Components/ToastView.swift index b58c5dfa..6670efbd 100644 --- a/AltStore/Components/ToastView.swift +++ b/AltStore/Components/ToastView.swift @@ -16,7 +16,7 @@ extension TimeInterval static let longToastViewDuration = 8.0 } -class ToastView: RSTToastView +final class ToastView: RSTToastView { var preferredDuration: TimeInterval diff --git a/AltStore/Extensions/OSLog+SideStore.swift b/AltStore/Extensions/OSLog+SideStore.swift index 73fb7c0e..0cb11525 100644 --- a/AltStore/Extensions/OSLog+SideStore.swift +++ b/AltStore/Extensions/OSLog+SideStore.swift @@ -9,7 +9,7 @@ import Foundation import OSLog -let customLog = OSLog(subsystem: "org.sidestore.sidestore", +public let customLog = OSLog(subsystem: "org.sidestore.sidestore", category: "ios") @@ -18,6 +18,7 @@ public extension OSLog { /// - Parameters: /// - message: String or format string /// - args: optional args for format string + @inlinable static func error(_ message: StaticString, _ args: CVarArg...) { os_log(message, log: customLog, type: .error, args) } @@ -26,6 +27,7 @@ public extension OSLog { /// - Parameters: /// - message: String or format string /// - args: optional args for format string + @inlinable static func info(_ message: StaticString, _ args: CVarArg...) { os_log(message, log: customLog, type: .info, args) } @@ -34,6 +36,7 @@ public extension OSLog { /// - Parameters: /// - message: String or format string /// - args: optional args for format string + @inlinable static func debug(_ message: StaticString, _ args: CVarArg...) { os_log(message, log: customLog, type: .debug, args) } @@ -45,6 +48,7 @@ public extension OSLog { /// - Parameters: /// - message: String or format string /// - args: optional args for format string +@inlinable public func ELOG(_ message: StaticString, file: StaticString = #file, function: StaticString = #function, line: UInt = #line, _ args: CVarArg...) { OSLog.error(message, args) } @@ -53,6 +57,7 @@ public func ELOG(_ message: StaticString, file: StaticString = #file, function: /// - Parameters: /// - message: String or format string /// - args: optional args for format string +@inlinable public func ILOG(_ message: StaticString, file: StaticString = #file, function: StaticString = #function, line: UInt = #line, _ args: CVarArg...) { OSLog.info(message, args) } diff --git a/AltStore/Intents/IntentHandler.swift b/AltStore/Intents/IntentHandler.swift index 4a11e640..cad45e75 100644 --- a/AltStore/Intents/IntentHandler.swift +++ b/AltStore/Intents/IntentHandler.swift @@ -11,7 +11,7 @@ import Foundation import AltStoreCore @available(iOS 14, *) -class IntentHandler: NSObject, RefreshAllIntentHandling +final class IntentHandler: NSObject, RefreshAllIntentHandling { private let queue = DispatchQueue(label: "io.altstore.IntentHandler") diff --git a/AltStore/LaunchViewController.swift b/AltStore/LaunchViewController.swift index 83e8c47e..25692f06 100644 --- a/AltStore/LaunchViewController.swift +++ b/AltStore/LaunchViewController.swift @@ -14,7 +14,7 @@ import minimuxer import AltStoreCore import UniformTypeIdentifiers -class LaunchViewController: RSTLaunchViewController, UIDocumentPickerDelegate +final class LaunchViewController: RSTLaunchViewController, UIDocumentPickerDelegate { private var didFinishLaunching = false @@ -47,6 +47,7 @@ class LaunchViewController: RSTLaunchViewController, UIDocumentPickerDelegate override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(true) + #if !targetEnvironment(simulator) start_em_proxy(bind_addr: Consts.Proxy.serverURL) guard let pf = fetchPairingFile() else { @@ -54,6 +55,7 @@ class LaunchViewController: RSTLaunchViewController, UIDocumentPickerDelegate return } start_minimuxer_threads(pf) + #endif } func fetchPairingFile() -> String? { @@ -147,7 +149,17 @@ class LaunchViewController: RSTLaunchViewController, UIDocumentPickerDelegate func start_minimuxer_threads(_ pairing_file: String) { set_usbmuxd_socket() + #if false // Retries + var res = start_minimuxer(pairing_file: pairing_file) + var attempts = 10 + while (attempts != 0 && res != 0) { + print("start_minimuxer `res` != 0, retry #\(attempts)") + res = start_minimuxer(pairing_file: pairing_file) + attempts -= 1 + } + #else let res = start_minimuxer(pairing_file: pairing_file) + #endif if res != 0 { displayError("minimuxer failed to start. Incorrect arguments were passed.") } diff --git a/AltStore/Managing Apps/AppManager.swift b/AltStore/Managing Apps/AppManager.swift index f3c6acd4..d85fa339 100644 --- a/AltStore/Managing Apps/AppManager.swift +++ b/AltStore/Managing Apps/AppManager.swift @@ -28,7 +28,7 @@ extension AppManager } @available(iOS 13, *) -class AppManagerPublisher: ObservableObject +final class AppManagerPublisher: ObservableObject { @Published fileprivate(set) var installationProgress = [String: Progress]() @@ -42,7 +42,7 @@ private func ==(lhs: OperatingSystemVersion, rhs: OperatingSystemVersion) -> Boo return (lhs.majorVersion == rhs.majorVersion && lhs.minorVersion == rhs.minorVersion && lhs.patchVersion == rhs.patchVersion) } -class AppManager +final class AppManager { static let shared = AppManager() @@ -664,7 +664,7 @@ extension AppManager @available(iOS 14, *) func enableJIT(for installedApp: InstalledApp, completionHandler: @escaping (Result) -> Void) { - class Context: OperationContext, EnableJITContext + final class Context: OperationContext, EnableJITContext { var installedApp: InstalledApp? } @@ -684,7 +684,7 @@ extension AppManager @available(iOS 14.0, *) func patch(resignedApp: ALTApplication, presentingViewController: UIViewController, context authContext: AuthenticatedOperationContext, completionHandler: @escaping (Result) -> Void) -> PatchAppOperation { - class Context: InstallAppOperationContext, PatchAppContext + final class Context: InstallAppOperationContext, PatchAppContext { } diff --git a/AltStore/My Apps/InstalledAppsCollectionHeaderView.swift b/AltStore/My Apps/InstalledAppsCollectionHeaderView.swift index b3564e9e..519dcfe6 100644 --- a/AltStore/My Apps/InstalledAppsCollectionHeaderView.swift +++ b/AltStore/My Apps/InstalledAppsCollectionHeaderView.swift @@ -8,7 +8,7 @@ import UIKit -class InstalledAppsCollectionHeaderView: UICollectionReusableView +final class InstalledAppsCollectionHeaderView: UICollectionReusableView { let textLabel: UILabel let button: UIButton diff --git a/AltStore/My Apps/MyAppsComponents.swift b/AltStore/My Apps/MyAppsComponents.swift index a01090ce..8801b574 100644 --- a/AltStore/My Apps/MyAppsComponents.swift +++ b/AltStore/My Apps/MyAppsComponents.swift @@ -9,7 +9,7 @@ import UIKit import Roxas -class InstalledAppCollectionViewCell: UICollectionViewCell +final class InstalledAppCollectionViewCell: UICollectionViewCell { private(set) var deactivateBadge: UIView? @@ -55,13 +55,13 @@ class InstalledAppCollectionViewCell: UICollectionViewCell } } -class InstalledAppsCollectionFooterView: UICollectionReusableView +final class InstalledAppsCollectionFooterView: UICollectionReusableView { @IBOutlet var textLabel: UILabel! @IBOutlet var button: UIButton! } -class NoUpdatesCollectionViewCell: UICollectionViewCell +final class NoUpdatesCollectionViewCell: UICollectionViewCell { @IBOutlet var blurView: UIVisualEffectView! @@ -73,7 +73,7 @@ class NoUpdatesCollectionViewCell: UICollectionViewCell } } -class UpdatesCollectionHeaderView: UICollectionReusableView +final class UpdatesCollectionHeaderView: UICollectionReusableView { let button = PillButton(type: .system) diff --git a/AltStore/My Apps/MyAppsViewController.swift b/AltStore/My Apps/MyAppsViewController.swift index 03d65be0..9f968e16 100644 --- a/AltStore/My Apps/MyAppsViewController.swift +++ b/AltStore/My Apps/MyAppsViewController.swift @@ -30,7 +30,7 @@ extension MyAppsViewController } } -class MyAppsViewController: UICollectionViewController +final class MyAppsViewController: UICollectionViewController { private let coordinator = NSFileCoordinator() private let operationQueue = OperationQueue() diff --git a/AltStore/My Apps/UpdateCollectionViewCell.swift b/AltStore/My Apps/UpdateCollectionViewCell.swift index beecafdd..b9c92791 100644 --- a/AltStore/My Apps/UpdateCollectionViewCell.swift +++ b/AltStore/My Apps/UpdateCollectionViewCell.swift @@ -17,7 +17,7 @@ extension UpdateCollectionViewCell } } -@objc class UpdateCollectionViewCell: UICollectionViewCell +@objc final class UpdateCollectionViewCell: UICollectionViewCell { var mode: Mode = .expanded { didSet { diff --git a/AltStore/News/NewsCollectionViewCell.swift b/AltStore/News/NewsCollectionViewCell.swift index d9c4b276..3fae6638 100644 --- a/AltStore/News/NewsCollectionViewCell.swift +++ b/AltStore/News/NewsCollectionViewCell.swift @@ -8,7 +8,7 @@ import UIKit -class NewsCollectionViewCell: UICollectionViewCell +final class NewsCollectionViewCell: UICollectionViewCell { @IBOutlet var titleLabel: UILabel! @IBOutlet var captionLabel: UILabel! diff --git a/AltStore/News/NewsViewController.swift b/AltStore/News/NewsViewController.swift index 0cf77a9c..347d605f 100644 --- a/AltStore/News/NewsViewController.swift +++ b/AltStore/News/NewsViewController.swift @@ -14,7 +14,7 @@ import Roxas import Nuke -private class AppBannerFooterView: UICollectionReusableView +private final class AppBannerFooterView: UICollectionReusableView { let bannerView = AppBannerView(frame: .zero) let tapGestureRecognizer = UITapGestureRecognizer(target: nil, action: nil) @@ -41,7 +41,7 @@ private class AppBannerFooterView: UICollectionReusableView } } -class NewsViewController: UICollectionViewController +final class NewsViewController: UICollectionViewController { private lazy var dataSource = self.makeDataSource() private lazy var placeholderView = RSTPlaceholderView(frame: .zero) diff --git a/AltStore/Operations/AuthenticationOperation.swift b/AltStore/Operations/AuthenticationOperation.swift index c787ffdc..af510de2 100644 --- a/AltStore/Operations/AuthenticationOperation.swift +++ b/AltStore/Operations/AuthenticationOperation.swift @@ -34,7 +34,7 @@ enum AuthenticationError: LocalizedError } @objc(AuthenticationOperation) -class AuthenticationOperation: ResultOperation<(ALTTeam, ALTCertificate, ALTAppleAPISession)> +final class AuthenticationOperation: ResultOperation<(ALTTeam, ALTCertificate, ALTAppleAPISession)> { let context: AuthenticatedOperationContext diff --git a/AltStore/Operations/BackgroundRefreshAppsOperation.swift b/AltStore/Operations/BackgroundRefreshAppsOperation.swift index 3d0fd6a4..0b3aa209 100644 --- a/AltStore/Operations/BackgroundRefreshAppsOperation.swift +++ b/AltStore/Operations/BackgroundRefreshAppsOperation.swift @@ -51,7 +51,7 @@ private let ReceivedApplicationState: @convention(c) (CFNotificationCenter?, Uns } @objc(BackgroundRefreshAppsOperation) -class BackgroundRefreshAppsOperation: ResultOperation<[String: Result]> +final class BackgroundRefreshAppsOperation: ResultOperation<[String: Result]> { let installedApps: [InstalledApp] private let managedObjectContext: NSManagedObjectContext diff --git a/AltStore/Operations/DeactivateAppOperation.swift b/AltStore/Operations/DeactivateAppOperation.swift index 3dd11e5d..e96d1fee 100644 --- a/AltStore/Operations/DeactivateAppOperation.swift +++ b/AltStore/Operations/DeactivateAppOperation.swift @@ -14,7 +14,7 @@ import Roxas import minimuxer @objc(DeactivateAppOperation) -class DeactivateAppOperation: ResultOperation +final class DeactivateAppOperation: ResultOperation { let app: InstalledApp let context: OperationContext diff --git a/AltStore/Operations/DownloadAppOperation.swift b/AltStore/Operations/DownloadAppOperation.swift index c386bb35..83820388 100644 --- a/AltStore/Operations/DownloadAppOperation.swift +++ b/AltStore/Operations/DownloadAppOperation.swift @@ -30,7 +30,7 @@ private extension DownloadAppOperation } @objc(DownloadAppOperation) -class DownloadAppOperation: ResultOperation +final class DownloadAppOperation: ResultOperation { let app: AppProtocol let context: AppOperationContext diff --git a/AltStore/Operations/EnableJITOperation.swift b/AltStore/Operations/EnableJITOperation.swift index da4da7da..f89296bf 100644 --- a/AltStore/Operations/EnableJITOperation.swift +++ b/AltStore/Operations/EnableJITOperation.swift @@ -21,7 +21,7 @@ protocol EnableJITContext } @available(iOS 14, *) -class EnableJITOperation: ResultOperation +final class EnableJITOperation: ResultOperation { let context: Context diff --git a/AltStore/Operations/FetchAnisetteDataOperation.swift b/AltStore/Operations/FetchAnisetteDataOperation.swift index cd652722..4a121751 100644 --- a/AltStore/Operations/FetchAnisetteDataOperation.swift +++ b/AltStore/Operations/FetchAnisetteDataOperation.swift @@ -13,7 +13,7 @@ import AltSign import Roxas @objc(FetchAnisetteDataOperation) -class FetchAnisetteDataOperation: ResultOperation +final class FetchAnisetteDataOperation: ResultOperation { let context: OperationContext diff --git a/AltStore/Operations/FetchAppIDsOperation.swift b/AltStore/Operations/FetchAppIDsOperation.swift index b3816428..4f75c9e7 100644 --- a/AltStore/Operations/FetchAppIDsOperation.swift +++ b/AltStore/Operations/FetchAppIDsOperation.swift @@ -13,7 +13,7 @@ import AltSign import Roxas @objc(FetchAppIDsOperation) -class FetchAppIDsOperation: ResultOperation<([AppID], NSManagedObjectContext)> +final class FetchAppIDsOperation: ResultOperation<([AppID], NSManagedObjectContext)> { let context: AuthenticatedOperationContext let managedObjectContext: NSManagedObjectContext diff --git a/AltStore/Operations/FetchProvisioningProfilesOperation.swift b/AltStore/Operations/FetchProvisioningProfilesOperation.swift index 3ed6ad82..e7b0eb30 100644 --- a/AltStore/Operations/FetchProvisioningProfilesOperation.swift +++ b/AltStore/Operations/FetchProvisioningProfilesOperation.swift @@ -13,7 +13,7 @@ import AltSign import Roxas @objc(FetchProvisioningProfilesOperation) -class FetchProvisioningProfilesOperation: ResultOperation<[String: ALTProvisioningProfile]> +final class FetchProvisioningProfilesOperation: ResultOperation<[String: ALTProvisioningProfile]> { let context: AppOperationContext diff --git a/AltStore/Operations/FetchSourceOperation.swift b/AltStore/Operations/FetchSourceOperation.swift index 9492503d..443cd037 100644 --- a/AltStore/Operations/FetchSourceOperation.swift +++ b/AltStore/Operations/FetchSourceOperation.swift @@ -13,7 +13,7 @@ import AltStoreCore import Roxas @objc(FetchSourceOperation) -class FetchSourceOperation: ResultOperation +final class FetchSourceOperation: ResultOperation { let sourceURL: URL let managedObjectContext: NSManagedObjectContext diff --git a/AltStore/Operations/FetchTrustedSourcesOperation.swift b/AltStore/Operations/FetchTrustedSourcesOperation.swift index 1ef8c3eb..9fced831 100644 --- a/AltStore/Operations/FetchTrustedSourcesOperation.swift +++ b/AltStore/Operations/FetchTrustedSourcesOperation.swift @@ -32,7 +32,7 @@ extension FetchTrustedSourcesOperation } } -class FetchTrustedSourcesOperation: ResultOperation<[FetchTrustedSourcesOperation.TrustedSource]> +final class FetchTrustedSourcesOperation: ResultOperation<[FetchTrustedSourcesOperation.TrustedSource]> { override func main() { diff --git a/AltStore/Operations/InstallAppOperation.swift b/AltStore/Operations/InstallAppOperation.swift index deaf8a50..f10c1272 100644 --- a/AltStore/Operations/InstallAppOperation.swift +++ b/AltStore/Operations/InstallAppOperation.swift @@ -13,7 +13,7 @@ import AltSign import Roxas @objc(InstallAppOperation) -class InstallAppOperation: ResultOperation +final class InstallAppOperation: ResultOperation { let context: InstallAppOperationContext diff --git a/AltStore/Operations/OperationContexts.swift b/AltStore/Operations/OperationContexts.swift index e18361d6..e60178b3 100644 --- a/AltStore/Operations/OperationContexts.swift +++ b/AltStore/Operations/OperationContexts.swift @@ -38,7 +38,7 @@ class OperationContext } } -class AuthenticatedOperationContext: OperationContext +final class AuthenticatedOperationContext: OperationContext { var session: ALTAppleAPISession? diff --git a/AltStore/Operations/Patch App/PatchAppOperation.swift b/AltStore/Operations/Patch App/PatchAppOperation.swift index af724e1e..0d06f6b8 100644 --- a/AltStore/Operations/Patch App/PatchAppOperation.swift +++ b/AltStore/Operations/Patch App/PatchAppOperation.swift @@ -52,7 +52,7 @@ private struct OTAUpdate } @available(iOS 14, *) -class PatchAppOperation: ResultOperation +final class PatchAppOperation: ResultOperation { let context: PatchAppContext diff --git a/AltStore/Operations/Patch App/PatchViewController.swift b/AltStore/Operations/Patch App/PatchViewController.swift index a20b2fa8..9e7afec9 100644 --- a/AltStore/Operations/Patch App/PatchViewController.swift +++ b/AltStore/Operations/Patch App/PatchViewController.swift @@ -29,7 +29,7 @@ extension PatchViewController } @available(iOS 14.0, *) -class PatchViewController: UIViewController +final class PatchViewController: UIViewController { var patchApp: AnyApp? var installedApp: InstalledApp? diff --git a/AltStore/Operations/RefreshAppOperation.swift b/AltStore/Operations/RefreshAppOperation.swift index 7da13306..084e281c 100644 --- a/AltStore/Operations/RefreshAppOperation.swift +++ b/AltStore/Operations/RefreshAppOperation.swift @@ -14,7 +14,7 @@ import Roxas import minimuxer @objc(RefreshAppOperation) -class RefreshAppOperation: ResultOperation +final class RefreshAppOperation: ResultOperation { let context: AppOperationContext diff --git a/AltStore/Operations/RefreshGroup.swift b/AltStore/Operations/RefreshGroup.swift index 01d6c965..27406257 100644 --- a/AltStore/Operations/RefreshGroup.swift +++ b/AltStore/Operations/RefreshGroup.swift @@ -12,7 +12,7 @@ import CoreData import AltStoreCore import AltSign -class RefreshGroup: NSObject +final class RefreshGroup: NSObject { let context: AuthenticatedOperationContext let progress = Progress.discreteProgress(totalUnitCount: 0) diff --git a/AltStore/Operations/RemoveAppBackupOperation.swift b/AltStore/Operations/RemoveAppBackupOperation.swift index 6e40b72d..24df7ba2 100644 --- a/AltStore/Operations/RemoveAppBackupOperation.swift +++ b/AltStore/Operations/RemoveAppBackupOperation.swift @@ -9,7 +9,7 @@ import Foundation @objc(RemoveAppBackupOperation) -class RemoveAppBackupOperation: ResultOperation +final class RemoveAppBackupOperation: ResultOperation { let context: InstallAppOperationContext diff --git a/AltStore/Operations/RemoveAppOperation.swift b/AltStore/Operations/RemoveAppOperation.swift index b7a4c150..6ec3cba4 100644 --- a/AltStore/Operations/RemoveAppOperation.swift +++ b/AltStore/Operations/RemoveAppOperation.swift @@ -12,7 +12,7 @@ import AltStoreCore import minimuxer @objc(RemoveAppOperation) -class RemoveAppOperation: ResultOperation +final class RemoveAppOperation: ResultOperation { let context: InstallAppOperationContext diff --git a/AltStore/Operations/ResignAppOperation.swift b/AltStore/Operations/ResignAppOperation.swift index add08658..8be28221 100644 --- a/AltStore/Operations/ResignAppOperation.swift +++ b/AltStore/Operations/ResignAppOperation.swift @@ -13,7 +13,7 @@ import AltStoreCore import AltSign @objc(ResignAppOperation) -class ResignAppOperation: ResultOperation +final class ResignAppOperation: ResultOperation { let context: InstallAppOperationContext diff --git a/AltStore/Operations/SendAppOperation.swift b/AltStore/Operations/SendAppOperation.swift index 35933b90..fb239ba1 100644 --- a/AltStore/Operations/SendAppOperation.swift +++ b/AltStore/Operations/SendAppOperation.swift @@ -11,7 +11,7 @@ import Network import AltStoreCore @objc(SendAppOperation) -class SendAppOperation: ResultOperation<()> +final class SendAppOperation: ResultOperation<()> { let context: InstallAppOperationContext diff --git a/AltStore/Operations/UpdatePatronsOperation.swift b/AltStore/Operations/UpdatePatronsOperation.swift index 54000883..8e4064b8 100644 --- a/AltStore/Operations/UpdatePatronsOperation.swift +++ b/AltStore/Operations/UpdatePatronsOperation.swift @@ -30,7 +30,7 @@ extension UpdatePatronsOperation } } -class UpdatePatronsOperation: ResultOperation +final class UpdatePatronsOperation: ResultOperation { let context: NSManagedObjectContext diff --git a/AltStore/Operations/VerifyAppOperation.swift b/AltStore/Operations/VerifyAppOperation.swift index 1daa92b0..c595d52f 100644 --- a/AltStore/Operations/VerifyAppOperation.swift +++ b/AltStore/Operations/VerifyAppOperation.swift @@ -55,7 +55,7 @@ enum VerificationError: ALTLocalizedError } @objc(VerifyAppOperation) -class VerifyAppOperation: ResultOperation +final class VerifyAppOperation: ResultOperation { let context: AppOperationContext var verificationHandler: ((VerificationError) -> Bool)? diff --git a/AltStore/SceneDelegate.swift b/AltStore/SceneDelegate.swift index 938b895d..c195f3ea 100644 --- a/AltStore/SceneDelegate.swift +++ b/AltStore/SceneDelegate.swift @@ -11,7 +11,7 @@ import AltStoreCore import EmotionalDamage @available(iOS 13, *) -class SceneDelegate: UIResponder, UIWindowSceneDelegate +final class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? diff --git a/AltStore/Settings/Error Log/ErrorLogTableViewCell.swift b/AltStore/Settings/Error Log/ErrorLogTableViewCell.swift index 5fa63551..71b67b88 100644 --- a/AltStore/Settings/Error Log/ErrorLogTableViewCell.swift +++ b/AltStore/Settings/Error Log/ErrorLogTableViewCell.swift @@ -9,7 +9,7 @@ import UIKit @objc(ErrorLogTableViewCell) -class ErrorLogTableViewCell: UITableViewCell +final class ErrorLogTableViewCell: UITableViewCell { @IBOutlet var appIconImageView: AppIconImageView! diff --git a/AltStore/Settings/Error Log/ErrorLogViewController.swift b/AltStore/Settings/Error Log/ErrorLogViewController.swift index c0f7fa27..86d84e66 100644 --- a/AltStore/Settings/Error Log/ErrorLogViewController.swift +++ b/AltStore/Settings/Error Log/ErrorLogViewController.swift @@ -14,7 +14,7 @@ import Roxas import Nuke -class ErrorLogViewController: UITableViewController +final class ErrorLogViewController: UITableViewController { private lazy var dataSource = self.makeDataSource() private var expandedErrorIDs = Set() diff --git a/AltStore/Settings/InsetGroupTableViewCell.swift b/AltStore/Settings/InsetGroupTableViewCell.swift index 02760c32..47a4e887 100644 --- a/AltStore/Settings/InsetGroupTableViewCell.swift +++ b/AltStore/Settings/InsetGroupTableViewCell.swift @@ -19,7 +19,7 @@ extension InsetGroupTableViewCell } } -class InsetGroupTableViewCell: UITableViewCell +final class InsetGroupTableViewCell: UITableViewCell { #if !TARGET_INTERFACE_BUILDER @IBInspectable var style: Style = .single { diff --git a/AltStore/Settings/LicensesViewController.swift b/AltStore/Settings/LicensesViewController.swift index 66b50736..d6ffc6ff 100644 --- a/AltStore/Settings/LicensesViewController.swift +++ b/AltStore/Settings/LicensesViewController.swift @@ -8,7 +8,7 @@ import UIKit -class LicensesViewController: UIViewController +final class LicensesViewController: UIViewController { private var _didAppear = false diff --git a/AltStore/Settings/PatreonComponents.swift b/AltStore/Settings/PatreonComponents.swift index d0d4a86d..4f2ec8ea 100644 --- a/AltStore/Settings/PatreonComponents.swift +++ b/AltStore/Settings/PatreonComponents.swift @@ -8,12 +8,12 @@ import UIKit -class PatronCollectionViewCell: UICollectionViewCell +final class PatronCollectionViewCell: UICollectionViewCell { @IBOutlet var textLabel: UILabel! } -class PatronsHeaderView: UICollectionReusableView +final class PatronsHeaderView: UICollectionReusableView { let textLabel = UILabel() @@ -31,7 +31,7 @@ class PatronsHeaderView: UICollectionReusableView } } -class PatronsFooterView: UICollectionReusableView +final class PatronsFooterView: UICollectionReusableView { let button = UIButton(type: .system) @@ -53,7 +53,7 @@ class PatronsFooterView: UICollectionReusableView } } -class AboutPatreonHeaderView: UICollectionReusableView +final class AboutPatreonHeaderView: UICollectionReusableView { @IBOutlet var supportButton: UIButton! @IBOutlet var accountButton: UIButton! diff --git a/AltStore/Settings/PatreonViewController.swift b/AltStore/Settings/PatreonViewController.swift index 6b1be872..12c82f73 100644 --- a/AltStore/Settings/PatreonViewController.swift +++ b/AltStore/Settings/PatreonViewController.swift @@ -22,7 +22,7 @@ extension PatreonViewController } } -class PatreonViewController: UICollectionViewController +final class PatreonViewController: UICollectionViewController { private lazy var dataSource = self.makeDataSource() private lazy var patronsDataSource = self.makePatronsDataSource() diff --git a/AltStore/Settings/RefreshAttemptsViewController.swift b/AltStore/Settings/RefreshAttemptsViewController.swift index cd048907..d00a834d 100644 --- a/AltStore/Settings/RefreshAttemptsViewController.swift +++ b/AltStore/Settings/RefreshAttemptsViewController.swift @@ -12,14 +12,14 @@ import AltStoreCore import Roxas @objc(RefreshAttemptTableViewCell) -private class RefreshAttemptTableViewCell: UITableViewCell +private final class RefreshAttemptTableViewCell: UITableViewCell { @IBOutlet var successLabel: UILabel! @IBOutlet var dateLabel: UILabel! @IBOutlet var errorDescriptionLabel: UILabel! } -class RefreshAttemptsViewController: UITableViewController +final class RefreshAttemptsViewController: UITableViewController { private lazy var dataSource = self.makeDataSource() diff --git a/AltStore/Settings/SettingsHeaderFooterView.swift b/AltStore/Settings/SettingsHeaderFooterView.swift index aec7b2f7..89d1d4a6 100644 --- a/AltStore/Settings/SettingsHeaderFooterView.swift +++ b/AltStore/Settings/SettingsHeaderFooterView.swift @@ -10,7 +10,7 @@ import UIKit import Roxas -class SettingsHeaderFooterView: UITableViewHeaderFooterView +final class SettingsHeaderFooterView: UITableViewHeaderFooterView { @IBOutlet var primaryLabel: UILabel! @IBOutlet var secondaryLabel: UILabel! diff --git a/AltStore/Settings/SettingsViewController.swift b/AltStore/Settings/SettingsViewController.swift index 77a7ad28..9c45fdd8 100644 --- a/AltStore/Settings/SettingsViewController.swift +++ b/AltStore/Settings/SettingsViewController.swift @@ -57,7 +57,7 @@ extension SettingsViewController } } -class SettingsViewController: UITableViewController +final class SettingsViewController: UITableViewController { private var activeTeam: Team? diff --git a/AltStore/Sources/SourcesViewController.swift b/AltStore/Sources/SourcesViewController.swift index c1b62556..2b15c240 100644 --- a/AltStore/Sources/SourcesViewController.swift +++ b/AltStore/Sources/SourcesViewController.swift @@ -31,7 +31,7 @@ struct SourceError: LocalizedError } @objc(SourcesFooterView) -private class SourcesFooterView: TextCollectionReusableView +private final class SourcesFooterView: TextCollectionReusableView { @IBOutlet var activityIndicatorView: UIActivityIndicatorView! @IBOutlet var textView: UITextView! @@ -46,7 +46,7 @@ extension SourcesViewController } } -class SourcesViewController: UICollectionViewController +final class SourcesViewController: UICollectionViewController { var deepLinkSourceURL: URL? { didSet { diff --git a/AltStore/TabBarController.swift b/AltStore/TabBarController.swift index f1b9daa9..91263340 100644 --- a/AltStore/TabBarController.swift +++ b/AltStore/TabBarController.swift @@ -20,7 +20,7 @@ extension TabBarController } } -class TabBarController: UITabBarController +final class TabBarController: UITabBarController { private var initialSegue: (identifier: String, sender: Any?)? diff --git a/AltStoreCore/Model/Source.swift b/AltStoreCore/Model/Source.swift index c8d97c6d..8f1a72a7 100644 --- a/AltStoreCore/Model/Source.swift +++ b/AltStoreCore/Model/Source.swift @@ -7,6 +7,7 @@ // import CoreData +import UIKit public extension Source { @@ -35,6 +36,146 @@ public extension Source #endif } +public struct AppPermissionFeed: Codable { + let type: String // ALTAppPermissionType + let usageDescription: String + + enum CodingKeys: String, CodingKey + { + case type + case usageDescription + } +} + +public struct AppVersionFeed: Codable { + /* Properties */ + let version: String + let date: Date + let localizedDescription: String? + + let downloadURL: URL + let size: Int64 + + enum CodingKeys: String, CodingKey + { + case version + case date + case localizedDescription + case downloadURL + case size + } +} + +public struct PlatformURLFeed: Codable { + /* Properties */ + let platform: Platform + let downloadURL: URL + + + private enum CodingKeys: String, CodingKey + { + case platform + case downloadURL + } +} + + +public struct StoreAppFeed: Codable { + let name: String + let bundleIdentifier: String + let subtitle: String? + + let developerName: String + let localizedDescription: String + let size: Int64 + + let iconURL: URL + let screenshotURLs: [URL] + + let version: String + let versionDate: Date + let versionDescription: String? + let downloadURL: URL + let platformURLs: [PlatformURLFeed]? + + let tintColor: String? // UIColor? + let isBeta: Bool + + // let source: Source? + let appPermission: [AppPermissionFeed] + let versions: [AppVersionFeed] + + enum CodingKeys: String, CodingKey + { + case bundleIdentifier + case developerName + case downloadURL + case iconURL + case isBeta = "beta" + case localizedDescription + case name + case appPermission = "permissions" + case platformURLs + case screenshotURLs + case size + case subtitle + case tintColor + case version + case versionDate + case versionDescription + case versions + } +} + +public struct NewsItemFeed: Codable { + let identifier: String + let date: Date + + let title: String + let caption: String + let tintColor: String //UIColor + let notify: Bool + + let imageURL: URL? + let externalURL: URL? + + let appID: String? + + private enum CodingKeys: String, CodingKey + { + case identifier + case date + case title + case caption + case tintColor + case imageURL + case externalURL = "url" + case appID + case notify + } +} + + +public struct SourceJSON: Codable { + let name: String + let identifier: String + let sourceURL: URL + let userInfo: [String:String]? //[ALTSourceUserInfoKey:String]? + let apps: [StoreAppFeed] + let news: [NewsItemFeed] + + enum CodingKeys: String, CodingKey + { + case name + case identifier + case sourceURL + case userInfo + case apps + case news + } + +} + @objc(Source) public class Source: NSManagedObject, Fetchable, Decodable { diff --git a/AltStoreCore/Model/StoreApp.swift b/AltStoreCore/Model/StoreApp.swift index ad10f835..2e38b57d 100644 --- a/AltStoreCore/Model/StoreApp.swift +++ b/AltStoreCore/Model/StoreApp.swift @@ -26,14 +26,12 @@ public extension StoreApp } @objc -public enum Platform: UInt { +public enum Platform: UInt, Codable { case ios case tvos case macos } -extension Platform: Decodable {} - @objc public final class PlatformURL: NSManagedObject, Decodable { /* Properties */ diff --git a/minimuxer/minimuxer.swift b/minimuxer/minimuxer.swift index d1afe1d8..fb024f63 100644 --- a/minimuxer/minimuxer.swift +++ b/minimuxer/minimuxer.swift @@ -27,7 +27,17 @@ public func set_usbmuxd_socket() { public func debug_app(app_id: String) throws -> Uhoh { let ai = NSString(string: app_id) let ai_pointer = UnsafeMutablePointer(mutating: ai.utf8String) + #if false // Retries + var res = minimuxer_debug_app(ai_pointer) + var attempts = 10 + while (attempts != 0 && res != 0) { + print("(JIT) ATTEMPTS: \(attempts)") + res = minimuxer_debug_app(ai_pointer) + attempts -= 1 + } + #else let res = minimuxer_debug_app(ai_pointer) + #endif if res != 0 { throw Uhoh.Bad(code: res) } @@ -38,7 +48,17 @@ public func install_provisioning_profile(plist: Data) throws -> Uhoh { let pls = String(decoding: plist, as: UTF8.self) print(pls) print(plist) + #if false // Retries + var res = minimuxer_install_provisioning_profile(x, UInt32(plist.count)) + var attempts = 10 + while (attempts != 0 && res != 0) { + print("(INSTALL) ATTEMPTS: \(attempts)") + res = minimuxer_install_provisioning_profile(x, UInt32(plist.count)) + attempts -= 1 + } + #else let x = plist.withUnsafeBytes { buf in UnsafeMutableRawPointer(mutating: buf) } + #endif let res = minimuxer_install_provisioning_profile(x, UInt32(plist.count)) if res != 0 { throw Uhoh.Bad(code: res) @@ -49,7 +69,17 @@ public func install_provisioning_profile(plist: Data) throws -> Uhoh { public func remove_provisioning_profile(id: String) throws -> Uhoh { let id_ns = NSString(string: id) let id_pointer = UnsafeMutablePointer(mutating: id_ns.utf8String) + #if false // Retries + var res = minimuxer_remove_provisioning_profile(id_pointer) + var attempts = 10 + while (attempts != 0 && res != 0) { + print("(REMOVE PROFILE) ATTEMPTS: \(attempts)") + res = minimuxer_remove_provisioning_profile(id_pointer) + attempts -= 1 + } + #else let res = minimuxer_remove_provisioning_profile(id_pointer) + #endif if res != 0 { throw Uhoh.Bad(code: res) }