From 4c6c7cbd6aa2a40eff7e904001c926bb6b66e00d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20B=C3=B6ttger?= Date: Thu, 15 May 2025 09:01:17 +0200 Subject: [PATCH] Add detection of firewall --- NearDrop/AppDelegate.swift | 32 +++++++++++++++-- NearDrop/Base.lproj/Localizable.strings | 3 ++ NearDrop/SelfTest/SelfTestManager.swift | 1 - NearDrop/ar.lproj/Localizable.strings | 3 ++ NearDrop/de.lproj/Localizable.strings | 3 ++ NearDrop/es.lproj/Localizable.strings | 3 ++ NearDrop/fr.lproj/Localizable.strings | 3 ++ NearDrop/hu.lproj/Localizable.strings | 3 ++ NearDrop/it.lproj/Localizable.strings | 3 ++ NearDrop/ja.lproj/Localizable.strings | 3 ++ NearDrop/ko.lproj/Localizable.strings | 3 ++ NearDrop/nl.lproj/Localizable.strings | 3 ++ NearDrop/pt-BR.lproj/Localizable.strings | 3 ++ NearDrop/pt-PT.lproj/Localizable.strings | 3 ++ NearDrop/ro.lproj/Localizable.strings | 3 ++ NearDrop/ru.lproj/Localizable.strings | 3 ++ NearDrop/th.lproj/Localizable.strings | 3 ++ NearDrop/uk.lproj/Localizable.strings | 3 ++ NearDrop/zh-Hans.lproj/Localizable.strings | 3 ++ NearbyShare/ConnectionFailureTracker.swift | 41 ++++++++++++++++++++++ NearbyShare/NearbyConnection.swift | 5 +++ NearbyShare/NearbyConnectionManager.swift | 1 + QuickDrop.xcodeproj/project.pbxproj | 4 +++ 23 files changed, 132 insertions(+), 3 deletions(-) create mode 100644 NearbyShare/ConnectionFailureTracker.swift diff --git a/NearDrop/AppDelegate.swift b/NearDrop/AppDelegate.swift index 86ee624..b8371c5 100644 --- a/NearDrop/AppDelegate.swift +++ b/NearDrop/AppDelegate.swift @@ -12,9 +12,11 @@ import SwiftUI import StoreKit import AudioToolbox import BezelNotification +import Network @main -class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDelegate, MainAppDelegate{ +class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDelegate, MainAppDelegate { + private var statusItem: NSStatusItem? private var activeIncomingTransfers: [String : TransferInfo] = [:] @@ -22,6 +24,8 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele var plusWindow: NSWindow? private var iapManager: IAPManager? + var showsFirewallAlert = false + func applicationDidFinishLaunching(_ aNotification: Notification) { let menu = NSMenu() @@ -294,6 +298,30 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele } + func showFirewallAlert() { + + if !showsFirewallAlert { + showsFirewallAlert = true + + DispatchQueue.main.async { + let alert = NSAlert() + alert.alertStyle = .critical + + alert.messageText = "FirewallDetected".localized() + alert.informativeText = "FirewallDetectedDescription".localized() + + alert.addButton(withTitle: "CloseAlert".localized()) + + log("Showing alert with message: \"\(alert.messageText)\" and description: \"\(alert.informativeText)\"") + + let _ = alert.runModal() + + self.showsFirewallAlert = false + } + } + } + + func incomingTransfer(id: String, didFinishWith error: Error?) { guard let transfer = self.activeIncomingTransfers[id] else { return } if let error = error { @@ -313,7 +341,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele case .ukey2: description = NSLocalizedString("Error.Crypto", value: "Encryption error", comment: "") + "(\(ne.localizedDescription))" case .canceled(reason: _): - break; // can't happen for incoming transfers + break // can't happen for incoming transfers } } else { description = error.localizedDescription diff --git a/NearDrop/Base.lproj/Localizable.strings b/NearDrop/Base.lproj/Localizable.strings index 6ae13f3..8dc4b3e 100644 --- a/NearDrop/Base.lproj/Localizable.strings +++ b/NearDrop/Base.lproj/Localizable.strings @@ -16,6 +16,9 @@ /* No comment provided by engineer. */ "Error.Protocol" = "Communication error"; "Error.PacketFilter" = "Your Mac may have a faulty packet filter enabled. Open System Preferences > Network > VPN & Filter and disable the content filter to use QuickDrop."; +"FirewallDetected" = "Connection failed"; +"FirewallDetectedDescription" = "Your phone could not connect because a firewall is likely blocking incoming connections. Please allow QuickDrop in your firewall (or antivirus program) and try again."; +"AlertLearnMore" = "Learn more"; /* No comment provided by engineer. */ "NFiles" = "%d files"; diff --git a/NearDrop/SelfTest/SelfTestManager.swift b/NearDrop/SelfTest/SelfTestManager.swift index 0f3a580..0b3d64d 100644 --- a/NearDrop/SelfTest/SelfTestManager.swift +++ b/NearDrop/SelfTest/SelfTestManager.swift @@ -53,7 +53,6 @@ class SelfTestManager { let port: UInt16 = 43210 let packetCount = 10 // 32K packets let packetSize = 512 * 1024 // Each packet = UInt32 - let totalSize = packetCount * packetSize let server = TCPSelfTestServer() let client = TCPSelfTestClient() diff --git a/NearDrop/ar.lproj/Localizable.strings b/NearDrop/ar.lproj/Localizable.strings index 022a933..a2dffc2 100644 --- a/NearDrop/ar.lproj/Localizable.strings +++ b/NearDrop/ar.lproj/Localizable.strings @@ -16,6 +16,9 @@ /* No comment provided by engineer. */ "Error.Protocol" = "خطأ في الاتصال"; "Error.PacketFilter" = "قد يحتوي جهاز Mac الخاص بك على مرشح حزم معطّل. افتح تفضيلات النظام > الشبكة > VPN & التصفية، وقم بتعطيل مرشح المحتوى لاستخدام QuickDrop."; +"FirewallDetected" = "فشل الاتصال"; +"FirewallDetectedDescription" = "تعذر على هاتفك الاتصال، ومن المحتمل أن يكون جدار الحماية يحظر الاتصالات الواردة. يُرجى السماح لـ QuickDrop في جدار الحماية (أو برنامج مكافحة الفيروسات) ثم المحاولة مرة أخرى."; +"AlertLearnMore" = "اعرف المزيد"; /* No comment provided by engineer. */ "NFiles" = "%d ملفات"; diff --git a/NearDrop/de.lproj/Localizable.strings b/NearDrop/de.lproj/Localizable.strings index 6884fd8..438144c 100644 --- a/NearDrop/de.lproj/Localizable.strings +++ b/NearDrop/de.lproj/Localizable.strings @@ -16,6 +16,9 @@ /* No comment provided by engineer. */ "Error.Protocol" = "Fehler bei der Datenübertragung"; "Error.PacketFilter" = "Auf deinem Mac ist möglicherweise ein fehlerhafter Paketfilter aktiviert. Öffne Systemeinstellungen > Netzwerk > VPN & Filter und deaktiviere den Inhaltsfilter, um QuickDrop zu verwenden."; +"FirewallDetected" = "Verbindung fehlgeschlagen"; +"FirewallDetectedDescription" = "Dein Telefon konnte sich nicht verbinden, da vermutlich eine Firewall eingehende Verbindungen blockiert. Bitte erlaube QuickDrop in deiner Firewall (oder im Antivirenprogramm) und versuche es erneut."; +"AlertLearnMore" = "Mehr erfahren"; /* No comment provided by engineer. */ "NFiles" = "%d Dateien"; diff --git a/NearDrop/es.lproj/Localizable.strings b/NearDrop/es.lproj/Localizable.strings index 3a3b8fb..7d1a2ab 100644 --- a/NearDrop/es.lproj/Localizable.strings +++ b/NearDrop/es.lproj/Localizable.strings @@ -16,6 +16,9 @@ /* No comment provided by engineer. */ "Error.Protocol" = "Error de comunicación"; "Error.PacketFilter" = "Es posible que tu Mac tenga activado un filtro de paquetes defectuoso. Abre Preferencias del Sistema > Red > VPN y Filtro y desactiva el filtro de contenido para usar QuickDrop."; +"FirewallDetected" = "Conexión fallida"; +"FirewallDetectedDescription" = "Tu teléfono no pudo conectarse porque probablemente un firewall está bloqueando las conexiones entrantes. Permite QuickDrop en el firewall (o en el antivirus) y vuelve a intentarlo."; +"AlertLearnMore" = "Más información"; /* No comment provided by engineer. */ //"NFiles" = "%d files"; diff --git a/NearDrop/fr.lproj/Localizable.strings b/NearDrop/fr.lproj/Localizable.strings index 8580bac..d5a4b94 100644 --- a/NearDrop/fr.lproj/Localizable.strings +++ b/NearDrop/fr.lproj/Localizable.strings @@ -16,6 +16,9 @@ /* No comment provided by engineer. */ "Error.Protocol" = "Erreur de communication"; "Error.PacketFilter" = "Votre Mac peut avoir un filtre de paquets défectueux activé. Ouvrez Réglages système > Réseau > VPN et filtre, puis désactivez le filtre de contenu pour utiliser QuickDrop."; +"FirewallDetected" = "Échec de la connexion"; +"FirewallDetectedDescription" = "Votre téléphone n’a pas pu se connecter, probablement parce qu’un pare-feu bloque les connexions entrantes. Autorisez QuickDrop dans votre pare-feu (ou programme antivirus) et réessayez."; +"AlertLearnMore" = "En savoir plus"; /* No comment provided by engineer. */ "NFiles" = "%d fichiers"; diff --git a/NearDrop/hu.lproj/Localizable.strings b/NearDrop/hu.lproj/Localizable.strings index b29cd70..d2c10d8 100644 --- a/NearDrop/hu.lproj/Localizable.strings +++ b/NearDrop/hu.lproj/Localizable.strings @@ -16,6 +16,9 @@ /* No comment provided by engineer. */ "Error.Protocol" = "Kommunikációs hiba"; "Error.PacketFilter" = "Lehet, hogy a Mac-ed hibás csomagszűrőt használ. Nyisd meg a Rendszerbeállítások > Hálózat > VPN és szűrő menüt, és kapcsold ki a tartalomszűrőt a QuickDrop használatához."; +"FirewallDetected" = "Sikertelen csatlakozás"; +"FirewallDetectedDescription" = "A telefon nem tudott csatlakozni, mert valószínűleg egy tűzfal blokkolja a bejövő kapcsolatokat. Engedélyezd a QuickDrop-ot a tűzfalban (vagy az antivírus programban), majd próbáld újra."; +"AlertLearnMore" = "További információ"; /* No comment provided by engineer. */ "NFiles" = "%d fájl"; diff --git a/NearDrop/it.lproj/Localizable.strings b/NearDrop/it.lproj/Localizable.strings index e3ec567..2139ea1 100644 --- a/NearDrop/it.lproj/Localizable.strings +++ b/NearDrop/it.lproj/Localizable.strings @@ -16,6 +16,9 @@ /* No comment provided by engineer. */ "Error.Protocol" = "Errore di comunicazione"; "Error.PacketFilter" = "Sul tuo Mac potrebbe essere attivo un filtro pacchetti difettoso. Apri Impostazioni di Sistema > Rete > VPN e Filtri e disattiva il filtro dei contenuti per utilizzare QuickDrop."; +"FirewallDetected" = "Connessione non riuscita"; +"FirewallDetectedDescription" = "Il telefono non è riuscito a connettersi perché probabilmente un firewall blocca le connessioni in entrata. Consenti QuickDrop nel firewall (o nel programma antivirus) e riprova."; +"AlertLearnMore" = "Scopri di più"; /* No comment provided by engineer. */ "NFiles" = "%d files"; diff --git a/NearDrop/ja.lproj/Localizable.strings b/NearDrop/ja.lproj/Localizable.strings index b8503be..a8de9ca 100644 --- a/NearDrop/ja.lproj/Localizable.strings +++ b/NearDrop/ja.lproj/Localizable.strings @@ -16,6 +16,9 @@ /* No comment provided by engineer. */ "Error.Protocol" = "通信エラー"; "Error.PacketFilter" = "お使いのMacで不具合のあるパケットフィルターが有効になっている可能性があります。システム設定 > ネットワーク > VPNとフィルターを開き、コンテンツフィルターを無効にしてQuickDropを使用してください。"; +"FirewallDetected" = "接続に失敗しました"; +"FirewallDetectedDescription" = "ファイアウォールが着信接続をブロックしている可能性があるため、スマートフォンが接続できませんでした。ファイアウォール(またはウイルス対策ソフト)で QuickDrop を許可して、もう一度お試しください。"; +"AlertLearnMore" = "詳しく見る"; /* No comment provided by engineer. */ "NFiles" = "%dつのファイル"; diff --git a/NearDrop/ko.lproj/Localizable.strings b/NearDrop/ko.lproj/Localizable.strings index 47dc0b0..fcdde19 100644 --- a/NearDrop/ko.lproj/Localizable.strings +++ b/NearDrop/ko.lproj/Localizable.strings @@ -16,6 +16,9 @@ /* No comment provided by engineer. */ "Error.Protocol" = "통신 오류"; "Error.PacketFilter" = "Mac에서 오류가 있는 패킷 필터가 활성화되어 있을 수 있습니다. 시스템 설정 > 네트워크 > VPN 및 필터로 이동하여 콘텐츠 필터를 비활성화하면 QuickDrop을 사용할 수 있습니다."; +"FirewallDetected" = "연결 실패"; +"FirewallDetectedDescription" = "방화벽이 수신 연결을 차단하고 있어 휴대전화가 연결되지 않은 것 같습니다. 방화벽(또는 백신 프로그램)에서 QuickDrop을 허용한 후 다시 시도해 주세요."; +"AlertLearnMore" = "자세히 알아보기"; /* No comment provided by engineer. */ "NFiles" = "%d개의 파일"; diff --git a/NearDrop/nl.lproj/Localizable.strings b/NearDrop/nl.lproj/Localizable.strings index 7d78c07..f2cb5ef 100644 --- a/NearDrop/nl.lproj/Localizable.strings +++ b/NearDrop/nl.lproj/Localizable.strings @@ -16,6 +16,9 @@ /* No comment provided by engineer. */ "Error.Protocol" = "Communicatiefout"; "Error.PacketFilter" = "Je Mac heeft mogelijk een defect pakketfilter ingeschakeld. Open Systeemvoorkeuren > Netwerk > VPN & Filter en schakel het inhoudsfilter uit om QuickDrop te gebruiken."; +"FirewallDetected" = "Verbinding mislukt"; +"FirewallDetectedDescription" = "Je telefoon kon waarschijnlijk geen verbinding maken omdat een firewall inkomende verbindingen blokkeert. Sta QuickDrop toe in je firewall (of antivirusprogramma) en probeer het opnieuw."; +"AlertLearnMore" = "Meer informatie"; /* No comment provided by engineer. */ "NFiles" = "%d bestanden"; diff --git a/NearDrop/pt-BR.lproj/Localizable.strings b/NearDrop/pt-BR.lproj/Localizable.strings index c6f6017..eb0c6a1 100644 --- a/NearDrop/pt-BR.lproj/Localizable.strings +++ b/NearDrop/pt-BR.lproj/Localizable.strings @@ -16,6 +16,9 @@ /* No comment provided by engineer. */ "Error.Protocol" = "Erro de comunicação"; "Error.PacketFilter" = "O seu Mac pode ter um filtro de pacotes com defeito ativado. Abra Preferências do Sistema > Rede > VPN e Filtro e desative o filtro de conteúdo para usar o QuickDrop."; +"FirewallDetected" = "Falha na conexão"; +"FirewallDetectedDescription" = "Seu celular não conseguiu se conectar porque um firewall provavelmente está bloqueando conexões de entrada. Permita o QuickDrop no firewall (ou no antivírus) e tente novamente."; +"AlertLearnMore" = "Saiba mais"; /* No comment provided by engineer. */ "NFiles" = "%d arquivos"; diff --git a/NearDrop/pt-PT.lproj/Localizable.strings b/NearDrop/pt-PT.lproj/Localizable.strings index 70f339a..7ce6c7e 100644 --- a/NearDrop/pt-PT.lproj/Localizable.strings +++ b/NearDrop/pt-PT.lproj/Localizable.strings @@ -16,6 +16,9 @@ /* No comment provided by engineer. */ "Error.Protocol" = "Erro de comunicação"; "Error.PacketFilter" = "O seu Mac pode ter um filtro de pacotes com defeito ativado. Abra Preferências do Sistema > Rede > VPN e Filtro e desative o filtro de conteúdo para usar o QuickDrop."; +"FirewallDetected" = "Falha na ligação"; +"FirewallDetectedDescription" = "O seu telemóvel não conseguiu ligar-se porque um firewall poderá estar a bloquear ligações recebidas. Permita o QuickDrop no firewall (ou no programa antivírus) e tente novamente."; +"AlertLearnMore" = "Saber mais"; /* No comment provided by engineer. */ "NFiles" = "%d ficheiros"; diff --git a/NearDrop/ro.lproj/Localizable.strings b/NearDrop/ro.lproj/Localizable.strings index 19929ae..17b4b85 100644 --- a/NearDrop/ro.lproj/Localizable.strings +++ b/NearDrop/ro.lproj/Localizable.strings @@ -16,6 +16,9 @@ /* No comment provided by engineer. */ "Error.Protocol" = "Eroare de comunicare"; "Error.PacketFilter" = "Este posibil ca Mac-ul tău să aibă un filtru de pachete defect activat. Deschide Preferințe de sistem > Rețea > VPN și Filtru și dezactivează filtrul de conținut pentru a folosi QuickDrop."; +"FirewallDetected" = "Conexiune eșuată"; +"FirewallDetectedDescription" = "Telefonul tău nu s-a putut conecta deoarece este posibil ca un firewall să blocheze conexiunile primite. Permite QuickDrop în firewall (sau în programul antivirus) și încearcă din nou."; +"AlertLearnMore" = "Află mai multe"; /* No comment provided by engineer. */ "NFiles" = "%d fișiere"; diff --git a/NearDrop/ru.lproj/Localizable.strings b/NearDrop/ru.lproj/Localizable.strings index 6de19b5..cee5571 100644 --- a/NearDrop/ru.lproj/Localizable.strings +++ b/NearDrop/ru.lproj/Localizable.strings @@ -16,6 +16,9 @@ /* No comment provided by engineer. */ "Error.Protocol" = "Ошибка протокола"; "Error.PacketFilter" = "На вашем Mac может быть включен неисправный фильтр пакетов. Откройте Системные настройки > Сеть > VPN и фильтры и отключите фильтр содержимого, чтобы использовать QuickDrop."; +"FirewallDetected" = "Не удалось подключиться"; +"FirewallDetectedDescription" = "Телефон не может подключиться, вероятно, из-за того что брандмауэр блокирует входящие соединения. Разрешите QuickDrop в брандмауэре (или антивирусной программе) и попробуйте снова."; +"AlertLearnMore" = "Подробнее"; /* No comment provided by engineer. */ /*"NFiles" = "%d файлов";*/ diff --git a/NearDrop/th.lproj/Localizable.strings b/NearDrop/th.lproj/Localizable.strings index 1ab3617..3f30c97 100644 --- a/NearDrop/th.lproj/Localizable.strings +++ b/NearDrop/th.lproj/Localizable.strings @@ -16,6 +16,9 @@ /* No comment provided by engineer. */ "Error.Protocol" = "การสื่อสารผิดพลาด"; "Error.PacketFilter" = "Mac ของคุณอาจเปิดใช้ตัวกรองแพ็กเกจที่มีปัญหาอยู่ เปิดการตั้งค่าระบบ > เครือข่าย > VPN และตัวกรอง แล้วปิดตัวกรองเนื้อหาเพื่อใช้งาน QuickDrop"; +"FirewallDetected" = "การเชื่อมต่อล้มเหลว"; +"FirewallDetectedDescription" = "โทรศัพท์ของคุณไม่สามารถเชื่อมต่อได้ เนื่องจากไฟร์วอลล์อาจบล็อกการเชื่อมต่อขาเข้า โปรดอนุญาต QuickDrop ในไฟร์วอลล์ (หรือโปรแกรมป้องกันไวรัส) แล้วลองอีกครั้ง"; +"AlertLearnMore" = "เรียนรู้เพิ่มเติม"; /* No comment provided by engineer. */ "NFiles" = "%d ไฟล์"; diff --git a/NearDrop/uk.lproj/Localizable.strings b/NearDrop/uk.lproj/Localizable.strings index 9babd97..5513da0 100644 --- a/NearDrop/uk.lproj/Localizable.strings +++ b/NearDrop/uk.lproj/Localizable.strings @@ -16,6 +16,9 @@ /* No comment provided by engineer. */ "Error.Protocol" = "Помилка протоколу"; "Error.PacketFilter" = "На вашому Mac може бути ввімкнено несправний фільтр пакетів. Відкрийте Системні налаштування > Мережа > VPN і фільтр та вимкніть фільтр вмісту, щоб скористатися QuickDrop."; +"FirewallDetected" = "Помилка підключення"; +"FirewallDetectedDescription" = "Ймовірно, брандмауер блокує вхідні з’єднання, тому телефон не може підключитися. Дозвольте QuickDrop у брандмауері (або антивірусній програмі) і спробуйте знову."; +"AlertLearnMore" = "Дізнатися більше"; /* No comment provided by engineer. */ "NFiles" = "%d files"; diff --git a/NearDrop/zh-Hans.lproj/Localizable.strings b/NearDrop/zh-Hans.lproj/Localizable.strings index d42f958..50fc1b5 100644 --- a/NearDrop/zh-Hans.lproj/Localizable.strings +++ b/NearDrop/zh-Hans.lproj/Localizable.strings @@ -16,6 +16,9 @@ /* No comment provided by engineer. */ "Error.Protocol" = "通信出错"; "Error.PacketFilter" = "你的 Mac 可能启用了有故障的数据包过滤器。请打开系统设置 > 网络 > VPN 与过滤器,并禁用内容过滤器以使用 QuickDrop。"; +"FirewallDetected" = "连接失败"; +"FirewallDetectedDescription" = "您的手机无法连接,可能是由于防火墙阻止了传入连接。请在防火墙(或杀毒软件)中允许 QuickDrop 然后重试。"; +"AlertLearnMore" = "了解更多"; /* No comment provided by engineer. */ "NFiles" = "%d files"; diff --git a/NearbyShare/ConnectionFailureTracker.swift b/NearbyShare/ConnectionFailureTracker.swift new file mode 100644 index 0000000..d728a21 --- /dev/null +++ b/NearbyShare/ConnectionFailureTracker.swift @@ -0,0 +1,41 @@ +// +// ConnectionFailureTracker.swift +// QuickDrop +// +// Created by Leon Böttger on 15.05.25. +// + +import Foundation + +class ConnectionFailureTracker { + static let shared = ConnectionFailureTracker() + + private var failureTimestamps: [Date] = [] + private var lastAlertShownAt: Date? + + private let queue = DispatchQueue(label: "ConnectionFailureTrackerQueue") + + private init() {} + + func recordFailure(onTrigger: @escaping () -> Void) { + queue.async { + let now = Date() + + // Remove old timestamps older than 10 seconds + self.failureTimestamps = self.failureTimestamps.filter { now.timeIntervalSince($0) < 10 } + self.failureTimestamps.append(now) + + // Check if alert can be shown + let canShowAlert = self.failureTimestamps.count >= 2 && + (self.lastAlertShownAt == nil || now.timeIntervalSince(self.lastAlertShownAt!) >= 60) + + if canShowAlert { + self.lastAlertShownAt = now + self.failureTimestamps.removeAll() + DispatchQueue.main.async { + onTrigger() + } + } + } + } +} diff --git a/NearbyShare/NearbyConnection.swift b/NearbyShare/NearbyConnection.swift index 3f5dcd9..1dc0bdb 100644 --- a/NearbyShare/NearbyConnection.swift +++ b/NearbyShare/NearbyConnection.swift @@ -58,6 +58,11 @@ class NearbyConnection { } else if case let .failed(err) = state { self.lastError = err log("Error opening socket: \(err)") + + ConnectionFailureTracker.shared.recordFailure { + NearbyConnectionManager.shared.mainAppDelegate?.showFirewallAlert() + } + self.handleConnectionClosure() } } diff --git a/NearbyShare/NearbyConnectionManager.swift b/NearbyShare/NearbyConnectionManager.swift index 442a797..53c0c40 100644 --- a/NearbyShare/NearbyConnectionManager.swift +++ b/NearbyShare/NearbyConnectionManager.swift @@ -136,6 +136,7 @@ struct EndpointInfo { public protocol MainAppDelegate { func obtainUserConsent(for transfer: TransferMetadata, from device: RemoteDeviceInfo) func incomingTransfer(id: String, didFinishWith error: Error?) + func showFirewallAlert() } public protocol ShareExtensionDelegate: AnyObject { diff --git a/QuickDrop.xcodeproj/project.pbxproj b/QuickDrop.xcodeproj/project.pbxproj index a3054ad..2b9294d 100644 --- a/QuickDrop.xcodeproj/project.pbxproj +++ b/QuickDrop.xcodeproj/project.pbxproj @@ -39,6 +39,7 @@ EB2F9BFE2DA05F48004010A2 /* BezelNotification in Frameworks */ = {isa = PBXBuildFile; productRef = EB2F9BFD2DA05F48004010A2 /* BezelNotification */; }; EB3643602D73A2A2009CDFF8 /* AudioManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB36435F2D73A29F009CDFF8 /* AudioManager.swift */; }; EB3643622D73A2CA009CDFF8 /* timeIsNow.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = EB3643612D73A2CA009CDFF8 /* timeIsNow.mp3 */; }; + EB6E743E2DD5C77700331466 /* ConnectionFailureTracker.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB6E743D2DD5C76F00331466 /* ConnectionFailureTracker.swift */; }; EB6F62D72D91F4AF00534EC2 /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB6F62D62D91F4AC00534EC2 /* SettingsView.swift */; }; EB7CD1452D6FB0C300CB0CB5 /* Logger.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB7CD1442D6FB0C100CB0CB5 /* Logger.swift */; }; EB7CD1462D6FB0E800CB0CB5 /* Logger.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB7CD1442D6FB0C100CB0CB5 /* Logger.swift */; }; @@ -207,6 +208,7 @@ EB3B73F62DC8FF3A00369951 /* securemessage.proto */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.protobuf; path = securemessage.proto; sourceTree = ""; }; EB3B73F72DC8FF3A00369951 /* ukey.proto */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.protobuf; path = ukey.proto; sourceTree = ""; }; EB3B73F82DC8FF3A00369951 /* wire_format.proto */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.protobuf; path = wire_format.proto; sourceTree = ""; }; + EB6E743D2DD5C76F00331466 /* ConnectionFailureTracker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConnectionFailureTracker.swift; sourceTree = ""; }; EB6F62D62D91F4AC00534EC2 /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = ""; }; EB7CD1442D6FB0C100CB0CB5 /* Logger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Logger.swift; sourceTree = ""; }; EB7F540F2D78E6DD00989564 /* Sidebar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Sidebar.swift; sourceTree = ""; }; @@ -356,6 +358,7 @@ 691F53BD2ABF03820089FD92 /* OutboundNearbyConnection.swift */, EB2F9BFA2DA04B67004010A2 /* Helpers.swift */, 698DFAE529E2F91A0064F247 /* NearbyConnection.swift */, + EB6E743D2DD5C76F00331466 /* ConnectionFailureTracker.swift */, 69DA9A2029E0CC4E00A442DA /* Data+Extensions.swift */, ); path = NearbyShare; @@ -585,6 +588,7 @@ EB2F9BFB2DA04B69004010A2 /* Helpers.swift in Sources */, 69DCF48F2AB70E8C00CBE2CC /* securemessage.pb.swift in Sources */, 69DCF4912AB70E9700CBE2CC /* NearbyConnection.swift in Sources */, + EB6E743E2DD5C77700331466 /* ConnectionFailureTracker.swift in Sources */, 69DCF4922AB70E9700CBE2CC /* NearbyConnectionManager.swift in Sources */, 69DCF48E2AB70E8C00CBE2CC /* securegcm.pb.swift in Sources */, 691F53BE2ABF03820089FD92 /* OutboundNearbyConnection.swift in Sources */,