Merge pull request #213 from SideStore/feature/JoeMFixes

Joe M fixes for 1.0
This commit is contained in:
Joe Mattiello
2023-01-04 12:58:56 -05:00
committed by GitHub
69 changed files with 290 additions and 82 deletions

View File

@@ -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

View File

@@ -71,7 +71,7 @@ extension AnalyticsManager
}
}
class AnalyticsManager
final class AnalyticsManager
{
static let shared = AnalyticsManager()

View File

@@ -25,7 +25,7 @@ extension AppContentViewController
}
}
class AppContentViewController: UITableViewController
final class AppContentViewController: UITableViewController
{
var app: StoreApp!

View File

@@ -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
{

View File

@@ -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)

View File

@@ -10,7 +10,7 @@ import UIKit
import AltStoreCore
class PermissionPopoverViewController: UIViewController
final class PermissionPopoverViewController: UIViewController
{
var permission: AppPermission!

View File

@@ -11,7 +11,7 @@ import UIKit
import AltStoreCore
import Roxas
class AppIDsViewController: UICollectionViewController
final class AppIDsViewController: UICollectionViewController
{
private lazy var dataSource = self.makeDataSource()

View File

@@ -30,7 +30,7 @@ extension AppDelegate
}
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
final class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?

View File

@@ -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)?

View File

@@ -8,7 +8,7 @@
import UIKit
class InstructionsViewController: UIViewController
final class InstructionsViewController: UIViewController
{
var completionHandler: (() -> Void)?

View File

@@ -12,7 +12,7 @@ import AltStoreCore
import AltSign
import Roxas
class RefreshAltStoreViewController: UIViewController
final class RefreshAltStoreViewController: UIViewController
{
var context: AuthenticatedOperationContext!

View File

@@ -14,7 +14,7 @@ import IntentsUI
import AltSign
class SelectTeamViewController: UITableViewController
final class SelectTeamViewController: UITableViewController
{
public var teams: [ALTTeam]?
public var completionHandler: ((Result<ALTTeam, Swift.Error>) -> Void)?

View File

@@ -12,7 +12,7 @@ import Roxas
import Nuke
@objc class BrowseCollectionViewCell: UICollectionViewCell
@objc final class BrowseCollectionViewCell: UICollectionViewCell
{
var imageURLs: [URL] = [] {
didSet {

View File

@@ -8,7 +8,7 @@
import UIKit
class AppIconImageView: UIImageView
final class AppIconImageView: UIImageView
{
override func awakeFromNib()
{

View File

@@ -8,7 +8,7 @@
import AVFoundation
class BackgroundTaskManager
final class BackgroundTaskManager
{
static let shared = BackgroundTaskManager()

View File

@@ -8,7 +8,7 @@
import UIKit
class BannerCollectionViewCell: UICollectionViewCell
final class BannerCollectionViewCell: UICollectionViewCell
{
private(set) var errorBadge: UIView?
@IBOutlet private(set) var bannerView: AppBannerView!

View File

@@ -8,7 +8,7 @@
import UIKit
class Button: UIButton
final class Button: UIButton
{
override var intrinsicContentSize: CGSize {
var size = super.intrinsicContentSize

View File

@@ -8,7 +8,7 @@
import UIKit
class CollapsingTextView: UITextView
final class CollapsingTextView: UITextView
{
var isCollapsed = true {
didSet {

View File

@@ -8,7 +8,7 @@
import UIKit
class ForwardingNavigationController: UINavigationController
final class ForwardingNavigationController: UINavigationController
{
override var childForStatusBarStyle: UIViewController? {
return self.topViewController

View File

@@ -10,7 +10,7 @@ import UIKit
import Roxas
class NavigationBar: UINavigationBar
final class NavigationBar: UINavigationBar
{
@IBInspectable var automaticallyAdjustsItemPositions: Bool = true

View File

@@ -8,7 +8,7 @@
import UIKit
class PillButton: UIButton
final class PillButton: UIButton
{
override var accessibilityValue: String? {
get {

View File

@@ -16,7 +16,7 @@ extension TimeInterval
static let longToastViewDuration = 8.0
}
class ToastView: RSTToastView
final class ToastView: RSTToastView
{
var preferredDuration: TimeInterval

View File

@@ -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)
}

View File

@@ -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")

View File

@@ -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.")
}

View File

@@ -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, Error>) -> 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<InstalledApp, Error>) -> Void) -> PatchAppOperation
{
class Context: InstallAppOperationContext, PatchAppContext
final class Context: InstallAppOperationContext, PatchAppContext
{
}

View File

@@ -8,7 +8,7 @@
import UIKit
class InstalledAppsCollectionHeaderView: UICollectionReusableView
final class InstalledAppsCollectionHeaderView: UICollectionReusableView
{
let textLabel: UILabel
let button: UIButton

View File

@@ -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)

View File

@@ -30,7 +30,7 @@ extension MyAppsViewController
}
}
class MyAppsViewController: UICollectionViewController
final class MyAppsViewController: UICollectionViewController
{
private let coordinator = NSFileCoordinator()
private let operationQueue = OperationQueue()

View File

@@ -17,7 +17,7 @@ extension UpdateCollectionViewCell
}
}
@objc class UpdateCollectionViewCell: UICollectionViewCell
@objc final class UpdateCollectionViewCell: UICollectionViewCell
{
var mode: Mode = .expanded {
didSet {

View File

@@ -8,7 +8,7 @@
import UIKit
class NewsCollectionViewCell: UICollectionViewCell
final class NewsCollectionViewCell: UICollectionViewCell
{
@IBOutlet var titleLabel: UILabel!
@IBOutlet var captionLabel: UILabel!

View File

@@ -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)

View File

@@ -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

View File

@@ -51,7 +51,7 @@ private let ReceivedApplicationState: @convention(c) (CFNotificationCenter?, Uns
}
@objc(BackgroundRefreshAppsOperation)
class BackgroundRefreshAppsOperation: ResultOperation<[String: Result<InstalledApp, Error>]>
final class BackgroundRefreshAppsOperation: ResultOperation<[String: Result<InstalledApp, Error>]>
{
let installedApps: [InstalledApp]
private let managedObjectContext: NSManagedObjectContext

View File

@@ -14,7 +14,7 @@ import Roxas
import minimuxer
@objc(DeactivateAppOperation)
class DeactivateAppOperation: ResultOperation<InstalledApp>
final class DeactivateAppOperation: ResultOperation<InstalledApp>
{
let app: InstalledApp
let context: OperationContext

View File

@@ -30,7 +30,7 @@ private extension DownloadAppOperation
}
@objc(DownloadAppOperation)
class DownloadAppOperation: ResultOperation<ALTApplication>
final class DownloadAppOperation: ResultOperation<ALTApplication>
{
let app: AppProtocol
let context: AppOperationContext

View File

@@ -21,7 +21,7 @@ protocol EnableJITContext
}
@available(iOS 14, *)
class EnableJITOperation<Context: EnableJITContext>: ResultOperation<Void>
final class EnableJITOperation<Context: EnableJITContext>: ResultOperation<Void>
{
let context: Context

View File

@@ -13,7 +13,7 @@ import AltSign
import Roxas
@objc(FetchAnisetteDataOperation)
class FetchAnisetteDataOperation: ResultOperation<ALTAnisetteData>
final class FetchAnisetteDataOperation: ResultOperation<ALTAnisetteData>
{
let context: OperationContext

View File

@@ -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

View File

@@ -13,7 +13,7 @@ import AltSign
import Roxas
@objc(FetchProvisioningProfilesOperation)
class FetchProvisioningProfilesOperation: ResultOperation<[String: ALTProvisioningProfile]>
final class FetchProvisioningProfilesOperation: ResultOperation<[String: ALTProvisioningProfile]>
{
let context: AppOperationContext

View File

@@ -13,7 +13,7 @@ import AltStoreCore
import Roxas
@objc(FetchSourceOperation)
class FetchSourceOperation: ResultOperation<Source>
final class FetchSourceOperation: ResultOperation<Source>
{
let sourceURL: URL
let managedObjectContext: NSManagedObjectContext

View File

@@ -32,7 +32,7 @@ extension FetchTrustedSourcesOperation
}
}
class FetchTrustedSourcesOperation: ResultOperation<[FetchTrustedSourcesOperation.TrustedSource]>
final class FetchTrustedSourcesOperation: ResultOperation<[FetchTrustedSourcesOperation.TrustedSource]>
{
override func main()
{

View File

@@ -13,7 +13,7 @@ import AltSign
import Roxas
@objc(InstallAppOperation)
class InstallAppOperation: ResultOperation<InstalledApp>
final class InstallAppOperation: ResultOperation<InstalledApp>
{
let context: InstallAppOperationContext

View File

@@ -38,7 +38,7 @@ class OperationContext
}
}
class AuthenticatedOperationContext: OperationContext
final class AuthenticatedOperationContext: OperationContext
{
var session: ALTAppleAPISession?

View File

@@ -52,7 +52,7 @@ private struct OTAUpdate
}
@available(iOS 14, *)
class PatchAppOperation: ResultOperation<Void>
final class PatchAppOperation: ResultOperation<Void>
{
let context: PatchAppContext

View File

@@ -29,7 +29,7 @@ extension PatchViewController
}
@available(iOS 14.0, *)
class PatchViewController: UIViewController
final class PatchViewController: UIViewController
{
var patchApp: AnyApp?
var installedApp: InstalledApp?

View File

@@ -14,7 +14,7 @@ import Roxas
import minimuxer
@objc(RefreshAppOperation)
class RefreshAppOperation: ResultOperation<InstalledApp>
final class RefreshAppOperation: ResultOperation<InstalledApp>
{
let context: AppOperationContext

View File

@@ -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)

View File

@@ -9,7 +9,7 @@
import Foundation
@objc(RemoveAppBackupOperation)
class RemoveAppBackupOperation: ResultOperation<Void>
final class RemoveAppBackupOperation: ResultOperation<Void>
{
let context: InstallAppOperationContext

View File

@@ -12,7 +12,7 @@ import AltStoreCore
import minimuxer
@objc(RemoveAppOperation)
class RemoveAppOperation: ResultOperation<InstalledApp>
final class RemoveAppOperation: ResultOperation<InstalledApp>
{
let context: InstallAppOperationContext

View File

@@ -13,7 +13,7 @@ import AltStoreCore
import AltSign
@objc(ResignAppOperation)
class ResignAppOperation: ResultOperation<ALTApplication>
final class ResignAppOperation: ResultOperation<ALTApplication>
{
let context: InstallAppOperationContext

View File

@@ -11,7 +11,7 @@ import Network
import AltStoreCore
@objc(SendAppOperation)
class SendAppOperation: ResultOperation<()>
final class SendAppOperation: ResultOperation<()>
{
let context: InstallAppOperationContext

View File

@@ -30,7 +30,7 @@ extension UpdatePatronsOperation
}
}
class UpdatePatronsOperation: ResultOperation<Void>
final class UpdatePatronsOperation: ResultOperation<Void>
{
let context: NSManagedObjectContext

View File

@@ -55,7 +55,7 @@ enum VerificationError: ALTLocalizedError
}
@objc(VerifyAppOperation)
class VerifyAppOperation: ResultOperation<Void>
final class VerifyAppOperation: ResultOperation<Void>
{
let context: AppOperationContext
var verificationHandler: ((VerificationError) -> Bool)?

View File

@@ -11,7 +11,7 @@ import AltStoreCore
import EmotionalDamage
@available(iOS 13, *)
class SceneDelegate: UIResponder, UIWindowSceneDelegate
final class SceneDelegate: UIResponder, UIWindowSceneDelegate
{
var window: UIWindow?

View File

@@ -9,7 +9,7 @@
import UIKit
@objc(ErrorLogTableViewCell)
class ErrorLogTableViewCell: UITableViewCell
final class ErrorLogTableViewCell: UITableViewCell
{
@IBOutlet var appIconImageView: AppIconImageView!

View File

@@ -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<NSManagedObjectID>()

View File

@@ -19,7 +19,7 @@ extension InsetGroupTableViewCell
}
}
class InsetGroupTableViewCell: UITableViewCell
final class InsetGroupTableViewCell: UITableViewCell
{
#if !TARGET_INTERFACE_BUILDER
@IBInspectable var style: Style = .single {

View File

@@ -8,7 +8,7 @@
import UIKit
class LicensesViewController: UIViewController
final class LicensesViewController: UIViewController
{
private var _didAppear = false

View File

@@ -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!

View File

@@ -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()

View File

@@ -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()

View File

@@ -10,7 +10,7 @@ import UIKit
import Roxas
class SettingsHeaderFooterView: UITableViewHeaderFooterView
final class SettingsHeaderFooterView: UITableViewHeaderFooterView
{
@IBOutlet var primaryLabel: UILabel!
@IBOutlet var secondaryLabel: UILabel!

View File

@@ -57,7 +57,7 @@ extension SettingsViewController
}
}
class SettingsViewController: UITableViewController
final class SettingsViewController: UITableViewController
{
private var activeTeam: Team?

View File

@@ -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 {

View File

@@ -20,7 +20,7 @@ extension TabBarController
}
}
class TabBarController: UITabBarController
final class TabBarController: UITabBarController
{
private var initialSegue: (identifier: String, sender: Any?)?

View File

@@ -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
{

View File

@@ -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 */

View File

@@ -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<CChar>(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<CChar>(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)
}