mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 23:03:27 +01:00
@@ -9,7 +9,10 @@
|
||||
import Foundation
|
||||
import Network
|
||||
import SideKit
|
||||
import os.log
|
||||
import OSLog
|
||||
#if canImport(Logging)
|
||||
import Logging
|
||||
#endif
|
||||
|
||||
public protocol SideConnection: Connection {
|
||||
func __send(_ data: Data, completionHandler: @escaping (Bool, Error?) -> Void)
|
||||
|
||||
@@ -9,7 +9,10 @@
|
||||
import Foundation
|
||||
import Network
|
||||
import SideKit
|
||||
import os.log
|
||||
import OSLog
|
||||
#if canImport(Logging)
|
||||
import Logging
|
||||
#endif
|
||||
|
||||
public protocol RequestHandler {
|
||||
func handleAnisetteDataRequest(_ request: AnisetteDataRequest, for connection: Connection, completionHandler: @escaping (Result<AnisetteDataResponse, Error>) -> Void)
|
||||
|
||||
@@ -8,7 +8,10 @@
|
||||
|
||||
import Foundation
|
||||
import SideKit
|
||||
import os.log
|
||||
import OSLog
|
||||
#if canImport(Logging)
|
||||
import Logging
|
||||
#endif
|
||||
|
||||
@objc private protocol XPCConnectionProxy {
|
||||
func ping(completionHandler: @escaping () -> Void)
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
//
|
||||
// UIApplication+AppExtension.swift
|
||||
// DeltaCore
|
||||
//
|
||||
// Created by Riley Testut on 6/14/18.
|
||||
// Copyright © 2018 Riley Testut. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
public extension UIApplication {
|
||||
// Cannot normally use UIApplication.shared from extensions, so we get around this by calling value(forKey:).
|
||||
class var alt_shared: UIApplication? {
|
||||
UIApplication.value(forKey: "sharedApplication") as? UIApplication
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
//
|
||||
// UIColor+AltStore.swift
|
||||
// AltStore
|
||||
//
|
||||
// Created by Riley Testut on 5/9/19.
|
||||
// Copyright © 2019 Riley Testut. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
public extension UIColor {
|
||||
private static let colorBundle = Bundle(for: DatabaseManager.self)
|
||||
|
||||
static let altPrimary = UIColor(named: "Primary", in: colorBundle, compatibleWith: nil)!
|
||||
static let deltaPrimary = UIColor(named: "DeltaPrimary", in: colorBundle, compatibleWith: nil)
|
||||
|
||||
static let altPink = UIColor(named: "Pink", in: colorBundle, compatibleWith: nil)!
|
||||
|
||||
static let refreshRed = UIColor(named: "RefreshRed", in: colorBundle, compatibleWith: nil)!
|
||||
static let refreshOrange = UIColor(named: "RefreshOrange", in: colorBundle, compatibleWith: nil)!
|
||||
static let refreshYellow = UIColor(named: "RefreshYellow", in: colorBundle, compatibleWith: nil)!
|
||||
static let refreshGreen = UIColor(named: "RefreshGreen", in: colorBundle, compatibleWith: nil)!
|
||||
}
|
||||
@@ -6,7 +6,8 @@
|
||||
// Copyright © 2019 Riley Testut. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
#if canImport(UIKit)
|
||||
import UIKit.UIColor
|
||||
|
||||
public extension UIColor {
|
||||
// Borrowed from https://stackoverflow.com/a/26341062
|
||||
@@ -69,3 +70,4 @@ public extension UIColor {
|
||||
)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
//
|
||||
|
||||
import CoreData
|
||||
import UIKit
|
||||
|
||||
public extension ALTAppPermissionType {
|
||||
var localizedShortName: String? {
|
||||
@@ -41,30 +40,6 @@ public extension ALTAppPermissionType {
|
||||
default: return nil
|
||||
}
|
||||
}
|
||||
|
||||
var icon: UIImage? {
|
||||
switch self {
|
||||
case .photos: return UIImage(systemName: "photo.on.rectangle.angled")
|
||||
case .camera: return UIImage(systemName: "camera.fill")
|
||||
case .location: return UIImage(systemName: "location.fill")
|
||||
case .contacts: return UIImage(systemName: "person.2.fill")
|
||||
case .reminders: return UIImage(systemName: "checklist")
|
||||
case .appleMusic: return UIImage(systemName: "music.note")
|
||||
case .microphone: return UIImage(systemName: "mic.fill")
|
||||
case .speechRecognition: return UIImage(systemName: "waveform.and.mic")
|
||||
case .backgroundAudio: return UIImage(systemName: "speaker.fill")
|
||||
case .backgroundFetch: return UIImage(systemName: "square.and.arrow.down")
|
||||
case .bluetooth: return UIImage(systemName: "wave.3.right")
|
||||
case .network: return UIImage(systemName: "network")
|
||||
case .calendars: return UIImage(systemName: "calendar")
|
||||
case .touchID: return UIImage(systemName: "touchid")
|
||||
case .faceID: return UIImage(systemName: "faceid")
|
||||
case .siri: return UIImage(systemName: "mic.and.signal.meter.fill")
|
||||
case .motion: return UIImage(systemName: "figure.walk.motion")
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@objc(AppPermission)
|
||||
|
||||
@@ -10,7 +10,10 @@ import CoreData
|
||||
|
||||
import AltSign
|
||||
import Roxas
|
||||
import os.log
|
||||
import OSLog
|
||||
#if canImport(Logging)
|
||||
import Logging
|
||||
#endif
|
||||
|
||||
private extension CFNotificationName {
|
||||
static let willAccessDatabase = CFNotificationName("com.rileytestut.AltStore.WillAccessDatabase" as CFString)
|
||||
|
||||
@@ -9,7 +9,10 @@
|
||||
import CoreData
|
||||
|
||||
import Roxas
|
||||
import os.log
|
||||
import OSLog
|
||||
#if canImport(Logging)
|
||||
import Logging
|
||||
#endif
|
||||
|
||||
open class MergePolicy: RSTRelationshipPreservingMergePolicy {
|
||||
override open func resolve(constraintConflicts conflicts: [NSConstraintConflict]) throws {
|
||||
|
||||
@@ -7,7 +7,15 @@
|
||||
//
|
||||
|
||||
import CoreData
|
||||
import UIKit
|
||||
|
||||
#if canImport(UIKit)
|
||||
import class UIKit.UIColor
|
||||
#elseif canImport(AppKit)
|
||||
import class AppKit.NSColor
|
||||
fileprivate typealias UIColor = NSColor
|
||||
#else
|
||||
#error ("Unsupported platform. Need to refactor UIColor/NSColor to extend support.")
|
||||
#endif
|
||||
|
||||
@objc(NewsItem)
|
||||
public class NewsItem: NSManagedObject, Decodable, Fetchable {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
//
|
||||
|
||||
import CoreData
|
||||
import UIKit
|
||||
import Foundation
|
||||
|
||||
public extension Source {
|
||||
#if ALPHA
|
||||
|
||||
@@ -8,8 +8,15 @@
|
||||
|
||||
import CoreData
|
||||
import Foundation
|
||||
import class UIKit.UIColor
|
||||
|
||||
#if canImport(UIKit)
|
||||
import class UIKit.UIColor
|
||||
#elseif canImport(AppKit)
|
||||
import class AppKit.NSColor
|
||||
fileprivate typealias UIColor = NSColor
|
||||
#else
|
||||
#error ("Unsupported platform. Need to refactor UIColor/NSColor to extend support.")
|
||||
#endif
|
||||
import Roxas
|
||||
|
||||
public extension StoreApp {
|
||||
|
||||
@@ -9,7 +9,10 @@
|
||||
import AuthenticationServices
|
||||
import CoreData
|
||||
import Foundation
|
||||
import os.log
|
||||
import OSLog
|
||||
#if canImport(Logging)
|
||||
import Logging
|
||||
#endif
|
||||
|
||||
private let clientID = "ZMx0EGUWe4TVWYXNZZwK_fbIK5jHFVWoUf1Qb-sqNXmT-YzAGwDPxxq7ak3_W5Q2"
|
||||
private let clientSecret = "1hktsZB89QyN69cB4R0tu55R4TCPQGXxvebYUUh7Y-5TLSnRswuxs6OUjdJ74IJt"
|
||||
@@ -115,8 +118,9 @@ public extension PatreonAPI {
|
||||
}
|
||||
}
|
||||
|
||||
if #available(iOS 13.0, *) {
|
||||
self.authenticationSession?.presentationContextProvider = self
|
||||
if let provider = self as? ASWebAuthenticationPresentationContextProviding,
|
||||
let authenticationSession = self.authenticationSession {
|
||||
authenticationSession.presentationContextProvider = provider
|
||||
}
|
||||
|
||||
authenticationSession?.start()
|
||||
@@ -359,10 +363,3 @@ private extension PatreonAPI {
|
||||
installedApps.forEach { $0.isActive = false }
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 13.0, *)
|
||||
extension PatreonAPI: ASWebAuthenticationPresentationContextProviding {
|
||||
public func presentationAnchor(for _: ASWebAuthenticationSession) -> ASPresentationAnchor {
|
||||
UIApplication.alt_shared?.keyWindow ?? UIWindow()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user