mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
merge AltStore 1.6.3, add dynamic anisette lists, merge SideJITServer integration
* 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>
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import SwiftUI
|
||||
import SafariServices
|
||||
import MessageUI
|
||||
import Intents
|
||||
@@ -57,7 +58,7 @@ extension SettingsViewController
|
||||
case refreshSideJITServer
|
||||
case clearCache
|
||||
case resetPairingFile
|
||||
case resetAdiPb
|
||||
case anisetteServers
|
||||
case advancedSettings
|
||||
|
||||
}
|
||||
@@ -92,6 +93,7 @@ final class SettingsViewController: UITableViewController
|
||||
super.init(coder: aDecoder)
|
||||
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(SettingsViewController.openPatreonSettings(_:)), name: AppDelegate.openPatreonSettingsDeepLinkNotification, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(SettingsViewController.openErrorLog(_:)), name: ToastView.openErrorLogNotification, object: nil)
|
||||
}
|
||||
|
||||
override func viewDidLoad()
|
||||
@@ -109,16 +111,13 @@ final class SettingsViewController: UITableViewController
|
||||
debugModeGestureRecognizer.numberOfTouchesRequired = 3
|
||||
self.tableView.addGestureRecognizer(debugModeGestureRecognizer)
|
||||
|
||||
print(Bundle.main.infoDictionary)
|
||||
var versionString: String = ""
|
||||
if let version = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String
|
||||
{
|
||||
versionString += "SideStore \(version)"
|
||||
if let xcode = Bundle.main.object(forInfoDictionaryKey: "DTXcode") as? String {
|
||||
print(xcode)
|
||||
versionString += " - Xcode \(xcode) - "
|
||||
if let build = Bundle.main.object(forInfoDictionaryKey: "DTXcodeBuild") as? String {
|
||||
print(build)
|
||||
versionString += "\(build)"
|
||||
}
|
||||
}
|
||||
@@ -133,8 +132,14 @@ final class SettingsViewController: UITableViewController
|
||||
{
|
||||
versionString += "SideStore\t"
|
||||
}
|
||||
self.versionLabel.text = NSLocalizedString(versionString, comment: "SideStore Version")
|
||||
versionString += "\n\(Bundle.Info.appbundleIdentifier)"
|
||||
|
||||
self.versionLabel.text = NSLocalizedString(versionString, comment: "SideStore Version")
|
||||
|
||||
self.versionLabel.numberOfLines = 0
|
||||
self.versionLabel.lineBreakMode = .byWordWrapping
|
||||
self.versionLabel.setNeedsUpdateConstraints()
|
||||
|
||||
self.tableView.contentInset.bottom = 40
|
||||
|
||||
self.update()
|
||||
@@ -152,6 +157,18 @@ final class SettingsViewController: UITableViewController
|
||||
|
||||
self.update()
|
||||
}
|
||||
|
||||
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
|
||||
if segue.identifier == "anisetteServers" {
|
||||
let controller = UIHostingController(rootView: AnisetteServers(selected: UserDefaults.standard.menuAnisetteURL, errorCallback: {
|
||||
ToastView(text: "Cleared adi.pb!", detailText: "You will need to log back into Apple ID in SideStore.").show(in: self)
|
||||
}))
|
||||
self.show(controller, sender: nil)
|
||||
} else {
|
||||
super.prepare(for: segue, sender: sender)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private extension SettingsViewController
|
||||
@@ -408,6 +425,15 @@ private extension SettingsViewController
|
||||
self.performSegue(withIdentifier: "showPatreon", sender: nil)
|
||||
}
|
||||
}
|
||||
|
||||
@objc func openErrorLog(_: Notification) {
|
||||
guard self.presentedViewController == nil else { return }
|
||||
|
||||
self.navigationController?.popViewController(animated: false)
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
|
||||
self.performSegue(withIdentifier: "showErrorLog", sender: nil)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension SettingsViewController
|
||||
@@ -440,14 +466,14 @@ extension SettingsViewController
|
||||
{
|
||||
let cell = super.tableView(tableView, cellForRowAt: indexPath)
|
||||
|
||||
// if #available(iOS 14, *) {}
|
||||
// else if let cell = cell as? InsetGroupTableViewCell,
|
||||
// indexPath.section == Section.appRefresh.rawValue,
|
||||
// indexPath.row == AppRefreshRow.backgroundRefresh.rawValue
|
||||
// {
|
||||
// // Only one row is visible pre-iOS 14.
|
||||
// cell.style = .single
|
||||
// }
|
||||
if #available(iOS 14, *) {}
|
||||
else if let cell = cell as? InsetGroupTableViewCell,
|
||||
indexPath.section == Section.appRefresh.rawValue,
|
||||
indexPath.row == AppRefreshRow.backgroundRefresh.rawValue
|
||||
{
|
||||
// Only one row is visible pre-iOS 14.
|
||||
cell.style = .single
|
||||
}
|
||||
|
||||
if AppRefreshRow.AllCases().count == 1
|
||||
{
|
||||
@@ -667,25 +693,11 @@ extension SettingsViewController
|
||||
alertController.popoverPresentationController?.sourceRect = self.tableView.rectForRow(at: indexPath)
|
||||
self.present(alertController, animated: true)
|
||||
self.tableView.deselectRow(at: indexPath, animated: true)
|
||||
case .resetAdiPb:
|
||||
let alertController = UIAlertController(
|
||||
title: NSLocalizedString("Are you sure you want to reset the adi.pb file?", comment: ""),
|
||||
message: NSLocalizedString("The adi.pb file is used to generate anisette data, which is required to log into an Apple ID. If you are having issues with account related things, you can try this. However, you will be required to do 2FA again. This will do nothing if you are using an older anisette server.", comment: ""),
|
||||
preferredStyle: UIAlertController.Style.actionSheet)
|
||||
|
||||
alertController.addAction(UIAlertAction(title: NSLocalizedString("Reset adi.pb", comment: ""), style: .destructive){ _ in
|
||||
if Keychain.shared.adiPb != nil {
|
||||
Keychain.shared.adiPb = nil
|
||||
print("Cleared adi.pb from keychain")
|
||||
}
|
||||
self.tableView.deselectRow(at: indexPath, animated: true)
|
||||
})
|
||||
alertController.addAction(.cancel)
|
||||
//Fix crash on iPad
|
||||
alertController.popoverPresentationController?.sourceView = self.tableView
|
||||
alertController.popoverPresentationController?.sourceRect = self.tableView.rectForRow(at: indexPath)
|
||||
self.present(alertController, animated: true)
|
||||
self.tableView.deselectRow(at: indexPath, animated: true)
|
||||
case .anisetteServers:
|
||||
self.prepare(for: UIStoryboardSegue(identifier: "anisetteServers", source: self, destination: UIHostingController(rootView: AnisetteServers(selected: "", errorCallback: {
|
||||
ToastView(text: "Reset adi.pb", detailText: "Buh").show(in: self)
|
||||
}))), sender: nil)
|
||||
// self.performSegue(withIdentifier: "anisetteServers", sender: nil)
|
||||
case .advancedSettings:
|
||||
// Create the URL that deep links to your app's custom settings.
|
||||
if let url = URL(string: UIApplication.openSettingsURLString) {
|
||||
|
||||
Reference in New Issue
Block a user