diff --git a/Feather.xcodeproj/project.pbxproj b/Feather.xcodeproj/project.pbxproj index c938febe9..fd8d20efc 100644 --- a/Feather.xcodeproj/project.pbxproj +++ b/Feather.xcodeproj/project.pbxproj @@ -20,7 +20,6 @@ 336D43982DB7454A00206400 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 336D43972DB7454A00206400 /* MobileCoreServices.framework */; }; 3371F7322DA9ECDD00281AC6 /* Zip in Frameworks */ = {isa = PBXBuildFile; productRef = 3371F7312DA9ECDD00281AC6 /* Zip */; }; 33CF13392DB5ACFB0021D4C5 /* SWCompression in Frameworks */ = {isa = PBXBuildFile; productRef = 33CF13382DB5ACFB0021D4C5 /* SWCompression */; }; - 570920BE2F98A4F0008C4A83 /* Feather.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 570920BD2F98A4F0008C4A83 /* Feather.xcconfig */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -122,12 +121,10 @@ 3379C1B52DA869A1004372DA /* Sources */, 3379C1B62DA869A1004372DA /* Frameworks */, 3379C1B72DA869A1004372DA /* Resources */, - 3379BC662DC9DB32004372DA /* Copy Acknowledgements */, ); buildRules = ( ); dependencies = ( - 339776072DC9D0F800642FFB /* PBXTargetDependency */, ); fileSystemSynchronizedGroups = ( 3379C1BB2DA869A1004372DA /* Feather */, @@ -194,7 +191,6 @@ 330F68FF2DC03DF400D8C35D /* XCLocalSwiftPackageReference "NimbleKit" */, 3346F8372DC6C68300C7D508 /* XCRemoteSwiftPackageReference "Nuke" */, 33693A062DC8BF5B00730215 /* XCLocalSwiftPackageReference "AltSourceKit" */, - 339776052DC9D05C00642FFB /* XCRemoteSwiftPackageReference "LicensePlist" */, 3349E7652DEFB46F00E317ED /* XCLocalSwiftPackageReference "IDeviceKitten" */, ); preferredProjectObjectVersion = 77; @@ -212,29 +208,11 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 570920BE2F98A4F0008C4A83 /* Feather.xcconfig in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ -/* Begin PBXShellScriptBuildPhase section */ - 3379BC662DC9DB32004372DA /* Copy Acknowledgements */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Copy Acknowledgements"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "echo \"Will copy acknowledgements\"\n\nACKNOWLEDGEMENTS_DIR=${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/com.mono0926.LicensePlist.Output\nDESTINATION_PATH=${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Settings.bundle/\n\ncp -r \"${ACKNOWLEDGEMENTS_DIR}\"/thewonderofyou.Feather \"${DESTINATION_PATH}\"\ncp -r \"${ACKNOWLEDGEMENTS_DIR}\"/thewonderofyou.Feather.plist \"${DESTINATION_PATH}\"\nrm -rf \"${ACKNOWLEDGEMENTS_DIR}\"\n"; - }; -/* End PBXShellScriptBuildPhase section */ - /* Begin PBXSourcesBuildPhase section */ 3379C1B52DA869A1004372DA /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -245,13 +223,6 @@ }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXTargetDependency section */ - 339776072DC9D0F800642FFB /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - productRef = 339776062DC9D0F800642FFB /* LicensePlistBuildTool */; - }; -/* End PBXTargetDependency section */ - /* Begin XCBuildConfiguration section */ 3379C1CB2DA869A3004372DA /* Debug */ = { isa = XCBuildConfiguration; @@ -568,14 +539,6 @@ minimumVersion = 2.1.2; }; }; - 339776052DC9D05C00642FFB /* XCRemoteSwiftPackageReference "LicensePlist" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/mono0926/LicensePlist"; - requirement = { - kind = exactVersion; - version = 3.27.1; - }; - }; 33CF13372DB5ACFB0021D4C5 /* XCRemoteSwiftPackageReference "SWCompression" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/tsolomko/SWCompression"; @@ -634,11 +597,6 @@ package = 3371F6F52DA9EBA500281AC6 /* XCRemoteSwiftPackageReference "Zip" */; productName = Zip; }; - 339776062DC9D0F800642FFB /* LicensePlistBuildTool */ = { - isa = XCSwiftPackageProductDependency; - package = 339776052DC9D05C00642FFB /* XCRemoteSwiftPackageReference "LicensePlist" */; - productName = "plugin:LicensePlistBuildTool"; - }; 33CF13382DB5ACFB0021D4C5 /* SWCompression */ = { isa = XCSwiftPackageProductDependency; package = 33CF13372DB5ACFB0021D4C5 /* XCRemoteSwiftPackageReference "SWCompression" */; diff --git a/Feather.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Feather.xcworkspace/xcshareddata/swiftpm/Package.resolved index bf5605f0b..5baf97281 100644 --- a/Feather.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Feather.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,14 +1,5 @@ { "pins" : [ - { - "identity" : "apikit", - "kind" : "remoteSourceControl", - "location" : "https://github.com/ishkawa/APIKit.git", - "state" : { - "revision" : "b839e53b870104798035b279d2a6168b0a2227b1", - "version" : "5.4.0" - } - }, { "identity" : "async-http-client", "kind" : "remoteSourceControl", @@ -45,33 +36,6 @@ "version" : "4.15.2" } }, - { - "identity" : "heliumlogger", - "kind" : "remoteSourceControl", - "location" : "https://github.com/Kitura/HeliumLogger.git", - "state" : { - "revision" : "fc2a71597ae974da5282d751bcc11965964bccce", - "version" : "2.0.0" - } - }, - { - "identity" : "licenseplist", - "kind" : "remoteSourceControl", - "location" : "https://github.com/mono0926/LicensePlist", - "state" : { - "revision" : "ab1692c16f4ce50fc134a8f51179f3310d41c5ef", - "version" : "3.27.1" - } - }, - { - "identity" : "loggerapi", - "kind" : "remoteSourceControl", - "location" : "https://github.com/Kitura/LoggerAPI.git", - "state" : { - "revision" : "4e6b45e850ffa275e8e26a24c6454fd709d5b6ac", - "version" : "2.0.0" - } - }, { "identity" : "multipart-kit", "kind" : "remoteSourceControl", @@ -126,15 +90,6 @@ "version" : "1.2.1" } }, - { - "identity" : "swift-argument-parser", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-argument-parser.git", - "state" : { - "revision" : "41982a3656a71c768319979febd796c6fd111d5c", - "version" : "1.5.0" - } - }, { "identity" : "swift-asn1", "kind" : "remoteSourceControl", @@ -171,15 +126,6 @@ "version" : "3.12.3" } }, - { - "identity" : "swift-html-entities", - "kind" : "remoteSourceControl", - "location" : "https://github.com/Kitura/swift-html-entities.git", - "state" : { - "revision" : "d8ca73197f59ce260c71bd6d7f6eb8bbdccf508b", - "version" : "4.0.1" - } - }, { "identity" : "swift-http-structured-headers", "kind" : "remoteSourceControl", @@ -297,24 +243,6 @@ "version" : "2.15.0" } }, - { - "identity" : "xcodeedit", - "kind" : "remoteSourceControl", - "location" : "https://github.com/tomlokhorst/XcodeEdit.git", - "state" : { - "revision" : "0e550cdee72844b35431afc3a1e176042be6d0f0", - "version" : "2.13.0" - } - }, - { - "identity" : "yams", - "kind" : "remoteSourceControl", - "location" : "https://github.com/jpsim/Yams.git", - "state" : { - "revision" : "b4b8042411dc7bbb696300a34a4bf3ba1b7ad19b", - "version" : "5.3.1" - } - }, { "identity" : "zip", "kind" : "remoteSourceControl", diff --git a/Feather/FeatherApp.swift b/Feather/AppDelegate.swift similarity index 64% rename from Feather/FeatherApp.swift rename to Feather/AppDelegate.swift index 63ed30db7..1a80ad907 100644 --- a/Feather/FeatherApp.swift +++ b/Feather/AppDelegate.swift @@ -1,160 +1,45 @@ // -// FeatherApp.swift +// AppDelegate.swift // Feather // -// Created by samara on 10.04.2025. +// Created by samsam on 5/25/26. // +import UIKit import SwiftUI import Nuke import IDeviceSwift import OSLog -@main -struct FeatherApp: App { - @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate - - let heartbeat = HeartbeatManager.shared - - @StateObject var downloadManager = DownloadManager.shared - let storage = Storage.shared - - var body: some Scene { - WindowGroup { - VStack { - DownloadHeaderView(downloadManager: downloadManager) - .transition(.move(edge: .top).combined(with: .opacity)) - VariedTabbarView() - .environment(\.managedObjectContext, storage.context) - .onOpenURL(perform: _handleURL) - .transition(.move(edge: .top).combined(with: .opacity)) - } - .animation(.smooth, value: downloadManager.manualDownloads.description) - .onReceive(NotificationCenter.default.publisher(for: .heartbeatInvalidHost)) { _ in - DispatchQueue.main.async { - UIAlertController.showAlertWithOk( - title: "InvalidHostID", - message: .localized("Your pairing file is invalid and is incompatible with your device, please import a valid pairing file.") - ) - } - } - // dear god help me - .onAppear { - if let style = UIUserInterfaceStyle(rawValue: UserDefaults.standard.integer(forKey: "Feather.userInterfaceStyle")) { - UIApplication.topViewController()?.view.window?.overrideUserInterfaceStyle = style - } - - UIApplication.topViewController()?.view.window?.tintColor = UIColor(Color(hex: UserDefaults.standard.string(forKey: "Feather.userTintColor") ?? "#848ef9")) - } - } - } - - private func _handleURL(_ url: URL) { - if url.scheme == "feather" { - /// feather://import-certificate?p12=&mobileprovision=&password= - if url.host == "import-certificate" { - guard - let components = URLComponents(url: url, resolvingAgainstBaseURL: false), - let queryItems = components.queryItems - else { - return - } - - func queryValue(_ name: String) -> String? { - queryItems.first(where: { $0.name == name })?.value?.removingPercentEncoding - } - - guard - let p12Base64 = queryValue("p12"), - let provisionBase64 = queryValue("mobileprovision"), - let passwordBase64 = queryValue("password"), - let passwordData = Data(base64Encoded: passwordBase64), - let password = String(data: passwordData, encoding: .utf8) - else { - return - } - - let generator = UINotificationFeedbackGenerator() - generator.prepare() - - guard - let p12URL = FileManager.default.decodeAndWrite(base64: p12Base64, pathComponent: ".p12"), - let provisionURL = FileManager.default.decodeAndWrite(base64: provisionBase64, pathComponent: ".mobileprovision"), - FR.checkPasswordForCertificate(for: p12URL, with: password, using: provisionURL) - else { - generator.notificationOccurred(.error) - return - } - - FR.handleCertificateFiles( - p12URL: p12URL, - provisionURL: provisionURL, - p12Password: password - ) { error in - if let error = error { - UIAlertController.showAlertWithOk(title: .localized("Error"), message: error.localizedDescription) - } else { - generator.notificationOccurred(.success) - } - } - - return - } - /// feather://export-certificate?callback_template=