mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-28 07:57:38 +01:00
debloat: converted xcode groups to xcode folder + removed unused files
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,27 +0,0 @@
|
|||||||
//
|
|
||||||
// PermissionPopoverViewController.swift
|
|
||||||
// AltStore
|
|
||||||
//
|
|
||||||
// Created by Riley Testut on 7/23/19.
|
|
||||||
// Copyright © 2019 Riley Testut. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
import UIKit
|
|
||||||
|
|
||||||
import AltStoreCore
|
|
||||||
|
|
||||||
final class PermissionPopoverViewController: UIViewController
|
|
||||||
{
|
|
||||||
var permission: AppPermission!
|
|
||||||
|
|
||||||
@IBOutlet private var nameLabel: UILabel!
|
|
||||||
@IBOutlet private var descriptionLabel: UILabel!
|
|
||||||
|
|
||||||
override func viewDidLoad()
|
|
||||||
{
|
|
||||||
super.viewDidLoad()
|
|
||||||
|
|
||||||
self.nameLabel.text = self.permission.localizedName ?? self.permission.permission.rawValue
|
|
||||||
self.descriptionLabel.text = self.permission.usageDescription
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// Proxy.swift
|
// AppConstants.swift
|
||||||
// SideStore
|
// SideStore
|
||||||
//
|
//
|
||||||
// Created by Joseph Mattiello on 11/7/22.
|
// Created by Joseph Mattiello on 11/7/22.
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
public extension Consts {
|
public enum AppConstants {
|
||||||
enum Proxy {
|
enum Proxy {
|
||||||
static let address = "127.0.0.1"
|
static let address = "127.0.0.1"
|
||||||
static let port = "51820"
|
static let port = "51820"
|
||||||
@@ -99,7 +99,7 @@ final class AppDelegate: UIResponder, UIApplicationDelegate {
|
|||||||
|
|
||||||
// TODO: @mahee96: find if we need to start em_proxy as in altstore?
|
// TODO: @mahee96: find if we need to start em_proxy as in altstore?
|
||||||
if UserDefaults.standard.enableEMPforWireguard {
|
if UserDefaults.standard.enableEMPforWireguard {
|
||||||
start_em_proxy(bind_addr: Consts.Proxy.serverURL)
|
start_em_proxy(bind_addr: AppConstants.Proxy.serverURL)
|
||||||
}
|
}
|
||||||
|
|
||||||
SecureValueTransformer.register()
|
SecureValueTransformer.register()
|
||||||
@@ -145,7 +145,7 @@ final class AppDelegate: UIResponder, UIApplicationDelegate {
|
|||||||
{
|
{
|
||||||
AppManager.shared.update()
|
AppManager.shared.update()
|
||||||
if UserDefaults.standard.enableEMPforWireguard {
|
if UserDefaults.standard.enableEMPforWireguard {
|
||||||
start_em_proxy(bind_addr: Consts.Proxy.serverURL)
|
start_em_proxy(bind_addr: AppConstants.Proxy.serverURL)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
//
|
|
||||||
// Consts.swift
|
|
||||||
// SideStore
|
|
||||||
//
|
|
||||||
// Created by Joseph Mattiello on 11/7/22.
|
|
||||||
// Copyright © 2022 Riley Testut. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
import Foundation
|
|
||||||
|
|
||||||
public enum Consts {
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -77,7 +77,7 @@ final class LaunchViewController: UIViewController, UIDocumentPickerDelegate {
|
|||||||
detectAndImportAccountFile()
|
detectAndImportAccountFile()
|
||||||
|
|
||||||
if UserDefaults.standard.enableEMPforWireguard {
|
if UserDefaults.standard.enableEMPforWireguard {
|
||||||
start_em_proxy(bind_addr: Consts.Proxy.serverURL)
|
start_em_proxy(bind_addr: AppConstants.Proxy.serverURL)
|
||||||
}
|
}
|
||||||
guard let pf = fetchPairingFile() else {
|
guard let pf = fetchPairingFile() else {
|
||||||
displayError("Device pairing file not found.")
|
displayError("Device pairing file not found.")
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ final class BackgroundRefreshAppsOperation: ResultOperation<[String: Result<Inst
|
|||||||
}
|
}
|
||||||
|
|
||||||
if UserDefaults.standard.enableEMPforWireguard {
|
if UserDefaults.standard.enableEMPforWireguard {
|
||||||
start_em_proxy(bind_addr: Consts.Proxy.serverURL)
|
start_em_proxy(bind_addr: AppConstants.Proxy.serverURL)
|
||||||
}
|
}
|
||||||
target_minimuxer_address()
|
target_minimuxer_address()
|
||||||
let documentsDirectory = FileManager.default.documentsDirectory.absoluteString
|
let documentsDirectory = FileManager.default.documentsDirectory.absoluteString
|
||||||
|
|||||||
@@ -1,65 +0,0 @@
|
|||||||
//
|
|
||||||
// FetchTrustedSourcesOperation.swift
|
|
||||||
// AltStore
|
|
||||||
//
|
|
||||||
// Created by Riley Testut on 4/13/22.
|
|
||||||
// Copyright © 2022 Riley Testut. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
import Foundation
|
|
||||||
|
|
||||||
private extension URL
|
|
||||||
{
|
|
||||||
#if STAGING
|
|
||||||
static let trustedSources = URL(string: "https://raw.githubusercontent.com/SideStore/SideStore/develop/trustedapps.json")!
|
|
||||||
#else
|
|
||||||
static let trustedSources = URL(string: "https://raw.githubusercontent.com/SideStore/SideStore/develop/trustedapps.json")!
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
extension FetchTrustedSourcesOperation
|
|
||||||
{
|
|
||||||
struct TrustedSource: Decodable
|
|
||||||
{
|
|
||||||
var identifier: String
|
|
||||||
var sourceURL: URL?
|
|
||||||
}
|
|
||||||
|
|
||||||
private struct Response: Decodable
|
|
||||||
{
|
|
||||||
var version: Int
|
|
||||||
var sources: [FetchTrustedSourcesOperation.TrustedSource]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
final class FetchTrustedSourcesOperation: ResultOperation<[FetchTrustedSourcesOperation.TrustedSource]>
|
|
||||||
{
|
|
||||||
override func main()
|
|
||||||
{
|
|
||||||
super.main()
|
|
||||||
|
|
||||||
let dataTask = URLSession.shared.dataTask(with: .trustedSources) { (data, response, error) in
|
|
||||||
do
|
|
||||||
{
|
|
||||||
if let response = response as? HTTPURLResponse
|
|
||||||
{
|
|
||||||
guard response.statusCode != 404 else {
|
|
||||||
self.finish(.failure(URLError(.fileDoesNotExist, userInfo: [NSURLErrorKey: URL.trustedSources])))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
guard let data = data else { throw error! }
|
|
||||||
|
|
||||||
let response = try Foundation.JSONDecoder().decode(Response.self, from: data)
|
|
||||||
self.finish(.success(response.sources))
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
self.finish(.failure(error))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dataTask.resume()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,108 +0,0 @@
|
|||||||
//
|
|
||||||
// UpdatePatronsOperation.swift
|
|
||||||
// AltStore
|
|
||||||
//
|
|
||||||
// Created by Riley Testut on 4/11/22.
|
|
||||||
// Copyright © 2022 Riley Testut. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
import Foundation
|
|
||||||
import CoreData
|
|
||||||
|
|
||||||
import AltStoreCore
|
|
||||||
|
|
||||||
private extension URL
|
|
||||||
{
|
|
||||||
#if STAGING
|
|
||||||
static let patreonInfo = URL(string: "https://f000.backblazeb2.com/file/altstore-staging/altstore/patreon.json")!
|
|
||||||
#else
|
|
||||||
static let patreonInfo = URL(string: "https://cdn.altstore.io/file/altstore/altstore/patreon.json")!
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
extension UpdatePatronsOperation
|
|
||||||
{
|
|
||||||
private struct Response: Decodable
|
|
||||||
{
|
|
||||||
var version: Int
|
|
||||||
var accessToken: String
|
|
||||||
var refreshID: String
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
final class UpdatePatronsOperation: ResultOperation<Void>
|
|
||||||
{
|
|
||||||
let context: NSManagedObjectContext
|
|
||||||
|
|
||||||
init(context: NSManagedObjectContext = DatabaseManager.shared.persistentContainer.newBackgroundContext())
|
|
||||||
{
|
|
||||||
self.context = context
|
|
||||||
}
|
|
||||||
|
|
||||||
override func main()
|
|
||||||
{
|
|
||||||
super.main()
|
|
||||||
|
|
||||||
let dataTask = URLSession.shared.dataTask(with: .patreonInfo) { (data, response, error) in
|
|
||||||
do
|
|
||||||
{
|
|
||||||
if let response = response as? HTTPURLResponse
|
|
||||||
{
|
|
||||||
guard response.statusCode != 404 else {
|
|
||||||
self.finish(.failure(URLError(.fileDoesNotExist, userInfo: [NSURLErrorKey: URL.patreonInfo])))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
guard let data = data else { throw error! }
|
|
||||||
|
|
||||||
let response = try AltStoreCore.JSONDecoder().decode(Response.self, from: data)
|
|
||||||
Keychain.shared.patreonCreatorAccessToken = response.accessToken
|
|
||||||
|
|
||||||
let previousRefreshID = UserDefaults.shared.patronsRefreshID
|
|
||||||
guard response.refreshID != previousRefreshID else {
|
|
||||||
self.finish(.success(()))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
PatreonAPI.shared.fetchPatrons { (result) in
|
|
||||||
self.context.perform {
|
|
||||||
do
|
|
||||||
{
|
|
||||||
let patrons = try result.get()
|
|
||||||
let managedPatrons = patrons.compactMap { ManagedPatron(patron: $0, context: self.context) }
|
|
||||||
|
|
||||||
let patronIDs = Set(managedPatrons.map { $0.identifier })
|
|
||||||
let nonFriendZonePredicate = NSPredicate(format: "NOT (%K IN %@)", #keyPath(ManagedPatron.identifier), patronIDs)
|
|
||||||
|
|
||||||
let nonFriendZonePatrons = ManagedPatron.all(satisfying: nonFriendZonePredicate, in: self.context)
|
|
||||||
for managedPatron in nonFriendZonePatrons
|
|
||||||
{
|
|
||||||
self.context.delete(managedPatron)
|
|
||||||
}
|
|
||||||
|
|
||||||
try self.context.save()
|
|
||||||
|
|
||||||
UserDefaults.shared.patronsRefreshID = response.refreshID
|
|
||||||
|
|
||||||
self.finish(.success(()))
|
|
||||||
|
|
||||||
Logger.main.notice("Updated Friend Zone Patrons! Refresh ID: \(response.refreshID, privacy: .public)")
|
|
||||||
}
|
|
||||||
catch let error as NSError
|
|
||||||
{
|
|
||||||
Logger.main.error("Failed to update Friend Zone Patrons. \(error.localizedDebugDescription ?? error.localizedDescription, privacy: .public)")
|
|
||||||
self.finish(.failure(error))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
self.finish(.failure(error))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dataTask.resume()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -41,7 +41,7 @@ final class SceneDelegate: UIResponder, UIWindowSceneDelegate
|
|||||||
|
|
||||||
AppManager.shared.update()
|
AppManager.shared.update()
|
||||||
if UserDefaults.standard.enableEMPforWireguard {
|
if UserDefaults.standard.enableEMPforWireguard {
|
||||||
start_em_proxy(bind_addr: Consts.Proxy.serverURL)
|
start_em_proxy(bind_addr: AppConstants.Proxy.serverURL)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
BIN
Dependencies/libcurl/libcurl.a
vendored
BIN
Dependencies/libcurl/libcurl.a
vendored
Binary file not shown.
Reference in New Issue
Block a user