Index: iOS/Base.lproj/Main.storyboard ================================================================== --- iOS/Base.lproj/Main.storyboard +++ iOS/Base.lproj/Main.storyboard @@ -1,21 +1,21 @@ - + - + - + @@ -38,18 +38,18 @@ - + - + @@ -99,11 +99,11 @@ - + @@ -232,11 +232,11 @@ - + @@ -307,11 +307,11 @@ - + @@ -323,15 +323,10 @@ - - - - - Index: iOS/CryptoPassphrase.xcodeproj/project.pbxproj ================================================================== --- iOS/CryptoPassphrase.xcodeproj/project.pbxproj +++ iOS/CryptoPassphrase.xcodeproj/project.pbxproj @@ -13,11 +13,10 @@ 4B31D80922B58F0F00494B15 /* SiteStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B31D80822B58F0F00494B15 /* SiteStorage.swift */; }; 4B5BCEF922B5B94C00E551BD /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B5BCEF822B5B94C00E551BD /* AppDelegate.swift */; }; 4B5BCEFB22B5CF3200E551BD /* MainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B5BCEFA22B5CF3200E551BD /* MainViewController.swift */; }; 4B5BCEFD22B5D98800E551BD /* SelectKeyFileController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B5BCEFC22B5D98800E551BD /* SelectKeyFileController.swift */; }; 4B5BCEFF22B5E36900E551BD /* ShowDetailsController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B5BCEFE22B5E36900E551BD /* ShowDetailsController.swift */; }; - 4B93656E22B5ADA00099DD08 /* HTTPServerDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B93656D22B5ADA00099DD08 /* HTTPServerDelegate.swift */; }; 4B93657022B5AE2C0099DD08 /* AboutController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B93656F22B5AE2C0099DD08 /* AboutController.swift */; }; 4B93657222B5B1FB0099DD08 /* AddSiteController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B93657122B5B1FB0099DD08 /* AddSiteController.swift */; }; 4B9525251F96BB900095F259 /* ObjFW.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B9525231F96BB820095F259 /* ObjFW.framework */; }; 4B9525261F96BB900095F259 /* ObjFWBridge.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B9525241F96BB820095F259 /* ObjFWBridge.framework */; }; 4B9525291F994CD30095F259 /* ObjFW.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4B9525231F96BB820095F259 /* ObjFW.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; @@ -54,11 +53,10 @@ 4B38148322B5ED01005C27B2 /* bridge.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = bridge.h; sourceTree = ""; }; 4B5BCEF822B5B94C00E551BD /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 4B5BCEFA22B5CF3200E551BD /* MainViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainViewController.swift; sourceTree = ""; }; 4B5BCEFC22B5D98800E551BD /* SelectKeyFileController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectKeyFileController.swift; sourceTree = ""; }; 4B5BCEFE22B5E36900E551BD /* ShowDetailsController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShowDetailsController.swift; sourceTree = ""; }; - 4B93656D22B5ADA00099DD08 /* HTTPServerDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HTTPServerDelegate.swift; sourceTree = ""; }; 4B93656F22B5AE2C0099DD08 /* AboutController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutController.swift; sourceTree = ""; }; 4B93657122B5B1FB0099DD08 /* AddSiteController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddSiteController.swift; sourceTree = ""; }; 4B9525231F96BB820095F259 /* ObjFW.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ObjFW.framework; path = Frameworks/ObjFW.framework; sourceTree = ""; }; 4B9525241F96BB820095F259 /* ObjFWBridge.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ObjFWBridge.framework; path = Frameworks/ObjFWBridge.framework; sourceTree = ""; }; 4BA115CD1DA9432D007ED4EA /* LegacyPasswordGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LegacyPasswordGenerator.h; path = ../LegacyPasswordGenerator.h; sourceTree = ""; }; @@ -108,11 +106,10 @@ children = ( 4B2E52EB1DA942840040D091 /* Assets.xcassets */, 4B93656F22B5AE2C0099DD08 /* AboutController.swift */, 4B93657122B5B1FB0099DD08 /* AddSiteController.swift */, 4B5BCEF822B5B94C00E551BD /* AppDelegate.swift */, - 4B93656D22B5ADA00099DD08 /* HTTPServerDelegate.swift */, 4B2E52F01DA942840040D091 /* Info.plist */, 4B2E52ED1DA942840040D091 /* LaunchScreen.storyboard */, 4B2E52E81DA942840040D091 /* Main.storyboard */, 4B5BCEFA22B5CF3200E551BD /* MainViewController.swift */, 4B5BCEFC22B5D98800E551BD /* SelectKeyFileController.swift */, @@ -221,11 +218,10 @@ 4B2E52D81DA942840040D091 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 4B5BCEF922B5B94C00E551BD /* AppDelegate.swift in Sources */, - 4B93656E22B5ADA00099DD08 /* HTTPServerDelegate.swift in Sources */, 4B5BCEFB22B5CF3200E551BD /* MainViewController.swift in Sources */, 4B93657222B5B1FB0099DD08 /* AddSiteController.swift in Sources */, 4BA115D21DA9432D007ED4EA /* LegacyPasswordGenerator.m in Sources */, 4BA115D31DA9432D007ED4EA /* NewPasswordGenerator.m in Sources */, 4B31D80922B58F0F00494B15 /* SiteStorage.swift in Sources */, DELETED iOS/HTTPServerDelegate.swift Index: iOS/HTTPServerDelegate.swift ================================================================== --- iOS/HTTPServerDelegate.swift +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2016 - 2023 Jonathan Schleifer - * - * https://fl.nil.im/cryptopassphrase - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -import Foundation -import ObjFW - -class HTTPServerDelegate: OFObject, OFHTTPServerDelegate { - func server(_ server: OFHTTPServer, didReceive request: OFHTTPRequest, - requestBody: OFStream?, response: OFHTTPResponse) { - print("\(request)") - } -} Index: iOS/SelectKeyFileController.swift ================================================================== --- iOS/SelectKeyFileController.swift +++ iOS/SelectKeyFileController.swift @@ -21,25 +21,10 @@ class SelectKeyFileController: UITableViewController { public var addSiteController: AddSiteController? private var keyFiles: [String] = [] - private var httpServer: OFHTTPServer - private var httpServerDelegate: HTTPServerDelegate - private var httpServerThread: OFThread - - required init?(coder aDecoder: NSCoder) { - httpServer = OFHTTPServer() - httpServer.host = "127.0.0.1".ofObject - - httpServerDelegate = HTTPServerDelegate() - httpServer.delegate = self.httpServerDelegate - - httpServerThread = OFThread() - - super.init(coder: aDecoder) - } override func viewDidLoad() { super.viewDidLoad() guard let documentDirectory = NSSearchPathForDirectoriesInDomains( @@ -56,17 +41,10 @@ } catch let error as NSError { print("Could not get key files: \(error)") navigationController?.popViewController(animated: true) return } - - httpServerThread.start() - } - - override func viewDidDisappear(_ animated: Bool) { - httpServerThread.runLoop.stop() - httpServerThread.join() } override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return keyFiles.count + 1 @@ -90,31 +68,6 @@ addSiteController?.keyFileLabel?.text = indexPath.row > 0 ? keyFiles[indexPath.row - 1] : "None" self.navigationController?.popViewController(animated: true) } - - @IBAction func upload(_ sender: Any?) { - let timer = OFTimer.scheduledTimer(withTimeInterval: 0, - repeats: false) { (OFTimer) in - self.httpServer.port = 0 - self.httpServer.start() - - let message = - "Navigate to http://\(self.httpServer.host!.nsObject):" + - "\(self.httpServer.port)/ in your browser.\n\n" + - "Press OK when done." - let alert = UIAlertController(title: "Server Running", - message: message, - preferredStyle: .alert) - alert.addAction( - UIAlertAction(title: "OK", style: .default, handler: nil)) - - DispatchQueue.main.sync { - self.present(alert, animated: true) { - self.httpServer.stop() - } - } - } - httpServerThread.runLoop.add(timer) - } }