mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-11 02:51:11 +00:00
Add packet filter alert
This commit is contained in:
1 parent
6c6c79cdad
commit
c9140cf19f
20 files changed
+30
-24
No files matched your search
@@ -305,11 +305,13 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
|
||||
case .inputOutput:
|
||||
description = "I/O Error";
|
||||
case .protocolError(_):
|
||||
description = NSLocalizedString("Error.Protocol", value: "Communication error", comment: "")
|
||||
description = NSLocalizedString("Error.Protocol", value: "Communication error", comment: "") + "(\(ne.localizedDescription))"
|
||||
case .packetFilterError:
|
||||
description = NSLocalizedString("Error.PacketFilter", value: "Communication error", comment: "")
|
||||
case .requiredFieldMissing:
|
||||
description = NSLocalizedString("Error.Protocol", value: "Communication error", comment: "")
|
||||
description = NSLocalizedString("Error.Protocol", value: "Communication error", comment: "") + "(\(ne.localizedDescription))"
|
||||
case .ukey2:
|
||||
description = NSLocalizedString("Error.Crypto", value: "Encryption error", comment: "")
|
||||
description = NSLocalizedString("Error.Crypto", value: "Encryption error", comment: "") + "(\(ne.localizedDescription))"
|
||||
case .canceled(reason: _):
|
||||
break; // can't happen for incoming transfers
|
||||
}
|
||||
@@ -328,7 +330,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
|
||||
|
||||
if let plusWindow = plusWindow {
|
||||
log("Closing plus screen because of error")
|
||||
self.plusWindow?.close()
|
||||
plusWindow.close()
|
||||
}
|
||||
|
||||
log("Showing alert with message: \"\(alert.messageText)\" and description: \"\(alert.informativeText)\"")
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
/* 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.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"NFiles" = "%d files";
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Error.Protocol" = "خطأ في الاتصال";
|
||||
"Error.PacketFilter" = "قد يحتوي جهاز Mac الخاص بك على مرشح حزم معطّل. افتح تفضيلات النظام > الشبكة > VPN & التصفية، وقم بتعطيل مرشح المحتوى لاستخدام QuickDrop.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"NFiles" = "%d ملفات";
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
/* 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.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"NFiles" = "%d Dateien";
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
/* 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.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
//"NFiles" = "%d files";
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
/* 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.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"NFiles" = "%d fichiers";
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
/* 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.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"NFiles" = "%d fájl";
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
/* 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.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"NFiles" = "%d files";
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Error.Protocol" = "通信エラー";
|
||||
"Error.PacketFilter" = "お使いのMacで不具合のあるパケットフィルターが有効になっている可能性があります。システム設定 > ネットワーク > VPNとフィルターを開き、コンテンツフィルターを無効にしてQuickDropを使用してください。";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"NFiles" = "%dつのファイル";
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Error.Protocol" = "통신 오류";
|
||||
"Error.PacketFilter" = "Mac에서 오류가 있는 패킷 필터가 활성화되어 있을 수 있습니다. 시스템 설정 > 네트워크 > VPN 및 필터로 이동하여 콘텐츠 필터를 비활성화하면 QuickDrop을 사용할 수 있습니다.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"NFiles" = "%d개의 파일";
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
/* 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.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"NFiles" = "%d bestanden";
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
/* 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.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"NFiles" = "%d arquivos";
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
/* 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.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"NFiles" = "%d ficheiros";
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
/* 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.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"NFiles" = "%d fișiere";
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Error.Protocol" = "Ошибка протокола";
|
||||
"Error.PacketFilter" = "На вашем Mac может быть включен неисправный фильтр пакетов. Откройте Системные настройки > Сеть > VPN и фильтры и отключите фильтр содержимого, чтобы использовать QuickDrop.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
/*"NFiles" = "%d файлов";*/
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Error.Protocol" = "การสื่อสารผิดพลาด";
|
||||
"Error.PacketFilter" = "Mac ของคุณอาจเปิดใช้ตัวกรองแพ็กเกจที่มีปัญหาอยู่ เปิดการตั้งค่าระบบ > เครือข่าย > VPN และตัวกรอง แล้วปิดตัวกรองเนื้อหาเพื่อใช้งาน QuickDrop";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"NFiles" = "%d ไฟล์";
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Error.Protocol" = "Помилка протоколу";
|
||||
"Error.PacketFilter" = "На вашому Mac може бути ввімкнено несправний фільтр пакетів. Відкрийте Системні налаштування > Мережа > VPN і фільтр та вимкніть фільтр вмісту, щоб скористатися QuickDrop.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"NFiles" = "%d files";
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Error.Protocol" = "通信出错";
|
||||
"Error.PacketFilter" = "你的 Mac 可能启用了有故障的数据包过滤器。请打开系统设置 > 网络 > VPN 与过滤器,并禁用内容过滤器以使用 QuickDrop。";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"NFiles" = "%d files";
|
||||
|
||||
@@ -67,30 +67,16 @@ class InboundNearbyConnection: NearbyConnection {
|
||||
let frame = try Location_Nearby_Connections_OfflineFrame(serializedBytes: frameData)
|
||||
try processConnectionResponseFrame(frame)
|
||||
default:
|
||||
var smsg: Securemessage_SecureMessage
|
||||
|
||||
do {
|
||||
smsg = try Securemessage_SecureMessage(serializedBytes: frameData)
|
||||
let smsg = try Securemessage_SecureMessage(serializedBytes: frameData)
|
||||
try decryptAndProcessReceivedSecureMessage(smsg)
|
||||
} catch {
|
||||
log("Error deserializing secure message. Trying again....")
|
||||
|
||||
// last 32 bytes = HMAC key
|
||||
// change 2 bytes before to 0x12 0x20 for Protobuf to succeed
|
||||
|
||||
if frameData.count < 34 {
|
||||
throw NearbyError.protocolError("Frame too short")
|
||||
}
|
||||
|
||||
var newData = frameData
|
||||
let count = newData.count
|
||||
newData[count - 34] = 0x12
|
||||
newData[count - 33] = 0x20
|
||||
|
||||
smsg = try Securemessage_SecureMessage(serializedBytes: newData)
|
||||
|
||||
log("Secure message deserialized successfully after fixing Protobuf message")
|
||||
|
||||
log("Error deserializing secure message (probably due to packet filter)")
|
||||
lastError = NearbyError.packetFilterError
|
||||
protocolError()
|
||||
}
|
||||
try decryptAndProcessReceivedSecureMessage(smsg)
|
||||
}
|
||||
} catch {
|
||||
lastError = error
|
||||
|
||||
@@ -52,6 +52,7 @@ public enum NearbyError: Error {
|
||||
case protocolError(_ message: String)
|
||||
case requiredFieldMissing(_ message: String)
|
||||
case ukey2
|
||||
case packetFilterError
|
||||
case inputOutput
|
||||
case canceled(reason: CancellationReason)
|
||||
|
||||
|
||||
Reference in new issue
Block a user