[iOS] Remove key upload functionality

It was never finished and uploading a key file unencrypted via WiFi is a
bad idea anyway.

FossilOrigin-Name: 0c2ffe58fdc61f477675a204326a34910f476539441b81af07db77518955d844
This commit is contained in:
Jonathan Schleifer 2024-08-25 10:48:32 +00:00
parent e07f2ad241
commit 2d69e05096
4 changed files with 9 additions and 92 deletions

View file

@ -23,21 +23,6 @@ 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()
@ -58,13 +43,6 @@ class SelectKeyFileController: UITableViewController {
navigationController?.popViewController(animated: true)
return
}
httpServerThread.start()
}
override func viewDidDisappear(_ animated: Bool) {
httpServerThread.runLoop.stop()
httpServerThread.join()
}
override func tableView(_ tableView: UITableView,
@ -92,29 +70,4 @@ class SelectKeyFileController: UITableViewController {
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)
}
}