mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-08 22:33:26 +01:00
* Change error from Swift.Error to NSError
* Adds ResultOperation.localizedFailure
* Finish Riley's monster commit
3b38d725d7
May the Gods have mercy on my soul.
* Fix format strings I broke
* Include "Enable JIT" errors in Error Log
* Fix minimuxer status checking
* [skip ci] Update the no wifi message to include VPN
* Opens Error Log when tapping ToastView
* Fixes Error Log context menu covering cell content
* Fixes Error Log context menu appearing while scrolling
* Fixes incorrect Search FAQ URL
* Fix Error Log showing UIAlertController on iOS 14+
* Fix Error Log not showing UIAlertController on iOS <=13
* Fix wrong color in AuthenticationViewController
* Fix typo
* Fixes logging non-AltServerErrors as AltServerError.underlyingError
* Limits quitting other AltStore/SideStore processes to database migrations
* Skips logging cancelled errors
* Replaces StoreApp.latestVersion with latestSupportedVersion + latestAvailableVersion
We now store the latest supported version as a relationship on StoreApp, rather than the latest available version. This allows us to reference the latest supported version in predicates and sort descriptors.
However, we kept the underlying Core Data property name the same to avoid extra migration.
* Conforms OperatingSystemVersion to Comparable
* Parses AppVersion.minOSVersion/maxOSVersion from source JSON
* Supports non-NSManagedObjects for @Managed properties
This allows us to use @Managed with properties that may or may not be NSManagedObjects at runtime (e.g. protocols). If they are, Managed will keep strong reference to context like before.
* Supports optional @Managed properties
* Conforms AppVersion to AppProtocol
* Verifies min/max OS version before downloading app + asks user to download older app version if necessary
* Improves error message when file does not exist at AppVersion.downloadURL
* Removes unnecessary StoreApp convenience properties
* Removes unnecessary StoreApp convenience properties as well as fix other issues
* Remove Settings bundle, add SwiftUI view instead
Fix refresh all shortcut intent
* Update AuthenticationOperation.swift
Signed-off-by: June Park <rjp2030@outlook.com>
* Fix build issues given by develop
* Add availability check to fix CI build(?)
* If it's gonna be that way...
---------
Signed-off-by: June Park <rjp2030@outlook.com>
Co-authored-by: nythepegasus <nythepegasus84@gmail.com>
Co-authored-by: Riley Testut <riley@rileytestut.com>
Co-authored-by: ny <me@nythepegas.us>
149 lines
5.1 KiB
Swift
149 lines
5.1 KiB
Swift
//
|
|
// TabBarController.swift
|
|
// AltStore
|
|
//
|
|
// Created by Riley Testut on 9/19/19.
|
|
// Copyright © 2019 Riley Testut. All rights reserved.
|
|
//
|
|
|
|
import UIKit
|
|
import AltStoreCore
|
|
|
|
extension TabBarController
|
|
{
|
|
private enum Tab: Int, CaseIterable
|
|
{
|
|
case news
|
|
case browse
|
|
case myApps
|
|
case settings
|
|
}
|
|
}
|
|
|
|
final class TabBarController: UITabBarController
|
|
{
|
|
private var initialSegue: (identifier: String, sender: Any?)?
|
|
|
|
private var _viewDidAppear = false
|
|
|
|
required init?(coder aDecoder: NSCoder)
|
|
{
|
|
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.openErrorLog(_:)), name: ToastView.openErrorLogNotification, object: nil)
|
|
}
|
|
|
|
override func viewDidAppear(_ animated: Bool)
|
|
{
|
|
super.viewDidAppear(animated)
|
|
|
|
_viewDidAppear = true
|
|
|
|
if let (identifier, sender) = self.initialSegue
|
|
{
|
|
self.initialSegue = nil
|
|
self.performSegue(withIdentifier: identifier, sender: sender)
|
|
}
|
|
else if let patchedApps = UserDefaults.standard.patchedApps, !patchedApps.isEmpty
|
|
{
|
|
// Check if we need to finish installing untethered jailbreak.
|
|
let activeApps = InstalledApp.fetchActiveApps(in: DatabaseManager.shared.viewContext)
|
|
guard let patchedApp = activeApps.first(where: { patchedApps.contains($0.bundleIdentifier) }) else { return }
|
|
|
|
self.performSegue(withIdentifier: "finishJailbreak", sender: patchedApp)
|
|
}
|
|
}
|
|
|
|
override func prepare(for segue: UIStoryboardSegue, sender: Any?)
|
|
{
|
|
guard let identifier = segue.identifier else { return }
|
|
|
|
switch identifier
|
|
{
|
|
case "presentSources":
|
|
guard let notification = sender as? Notification,
|
|
let sourceURL = notification.userInfo?[AppDelegate.addSourceDeepLinkURLKey] as? URL
|
|
else { return }
|
|
|
|
let navigationController = segue.destination as! UINavigationController
|
|
let sourcesViewController = navigationController.viewControllers.first as! SourcesViewController
|
|
sourcesViewController.deepLinkSourceURL = sourceURL
|
|
|
|
case "finishJailbreak":
|
|
guard let installedApp = sender as? InstalledApp, #available(iOS 14, *) else { return }
|
|
|
|
let navigationController = segue.destination as! UINavigationController
|
|
|
|
let patchViewController = navigationController.viewControllers.first as! PatchViewController
|
|
patchViewController.installedApp = installedApp
|
|
patchViewController.completionHandler = { [weak self] _ in
|
|
self?.dismiss(animated: true, completion: nil)
|
|
}
|
|
|
|
default: break
|
|
}
|
|
}
|
|
|
|
override func performSegue(withIdentifier identifier: String, sender: Any?)
|
|
{
|
|
guard _viewDidAppear else {
|
|
self.initialSegue = (identifier, sender)
|
|
return
|
|
}
|
|
|
|
super.performSegue(withIdentifier: identifier, sender: sender)
|
|
}
|
|
}
|
|
|
|
extension TabBarController
|
|
{
|
|
@objc func presentSources(_ sender: Any)
|
|
{
|
|
if let presentedViewController = self.presentedViewController
|
|
{
|
|
if let navigationController = presentedViewController as? UINavigationController,
|
|
let sourcesViewController = navigationController.viewControllers.first as? SourcesViewController
|
|
{
|
|
if let notification = (sender as? Notification),
|
|
let sourceURL = notification.userInfo?[AppDelegate.addSourceDeepLinkURLKey] as? URL
|
|
{
|
|
sourcesViewController.deepLinkSourceURL = sourceURL
|
|
}
|
|
else
|
|
{
|
|
// Don't dismiss SourcesViewController if it's already presented.
|
|
}
|
|
}
|
|
else
|
|
{
|
|
presentedViewController.dismiss(animated: true) {
|
|
self.presentSources(sender)
|
|
}
|
|
}
|
|
|
|
return
|
|
}
|
|
|
|
self.performSegue(withIdentifier: "presentSources", sender: sender)
|
|
}
|
|
}
|
|
|
|
private extension TabBarController
|
|
{
|
|
@objc func openPatreonSettings(_ notification: Notification)
|
|
{
|
|
self.selectedIndex = Tab.settings.rawValue
|
|
}
|
|
|
|
@objc func importApp(_ notification: Notification)
|
|
{
|
|
self.selectedIndex = Tab.myApps.rawValue
|
|
}
|
|
@objc func openErrorLog(_: Notification){
|
|
self.selectedIndex = Tab.settings.rawValue
|
|
}
|
|
}
|