Skip to content

Linux + iPhone Continuity / iMessage / SMS

Revert "fix: bug fixes and performance improvements"

Zack Bartel8073a705a1c6
diff --git a/po/cs.po b/po/cs.po
index 4b75fe7..f63f46c 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-28 20:29-0700\n"
+"POT-Creation-Date: 2026-08-28 16:06-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Czech\n"
@@ -398,14 +398,6 @@ msgstr "Odesláno na %s\n"
msgid "The message was not sent."
msgstr "Zpráva nebyla odeslána."
-#: src/cli/main.cpp
-msgid "--port expects a number.\n"
-msgstr "--port očekává číslo.\n"
-
-#: src/cli/main.cpp
-msgid "--timeout expects a number in milliseconds.\n"
-msgstr "--timeout očekává číslo v milisekundách.\n"
-
#: src/cli/main.cpp
msgid "Unknown action. Run tether --help for options\n"
msgstr "Neznámá akce. Spusťte tether --help pro seznam voleb\n"
@@ -602,12 +594,6 @@ msgstr "Není vybrán žádný spárovaný iPhone."
msgid "Group replies are turned off."
msgstr "Skupinové odpovědi jsou vypnuté."
-#: src/core/src/bluetooth/groups.cpp
-msgid ""
-"Someone who is not in this group's saved member list has posted to it, so "
-"the list is out of date. Update it in groups.json before replying."
-msgstr "Do této skupiny napsal někdo, kdo není v jejím uloženém seznamu členů, takže seznam je zastaralý. Před odpovědí jej aktualizujte v souboru groups.json."
-
#: src/core/src/bluetooth/groups.cpp
#, c++-format
msgid "The roster for this group contains an unusable address: {}"
diff --git a/po/de.po b/po/de.po
index 01fcfc3..592b879 100644
--- a/po/de.po
+++ b/po/de.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-28 20:29-0700\n"
+"POT-Creation-Date: 2026-08-28 16:06-0700\n"
"PO-Revision-Date: 2026-08-22\n"
"Last-Translator: Tether project\n"
"Language-Team: German\n"
@@ -397,14 +397,6 @@ msgstr "Gesendet an %s\n"
msgid "The message was not sent."
msgstr "Die Nachricht wurde nicht gesendet."
-#: src/cli/main.cpp
-msgid "--port expects a number.\n"
-msgstr "--port erwartet eine Zahl.\n"
-
-#: src/cli/main.cpp
-msgid "--timeout expects a number in milliseconds.\n"
-msgstr "--timeout erwartet eine Zahl in Millisekunden.\n"
-
#: src/cli/main.cpp
msgid "Unknown action. Run tether --help for options\n"
msgstr ""
@@ -610,12 +602,6 @@ msgstr "Kein gekoppeltes iPhone ausgewählt."
msgid "Group replies are turned off."
msgstr "Antworten in Gruppen sind ausgeschaltet."
-#: src/core/src/bluetooth/groups.cpp
-msgid ""
-"Someone who is not in this group's saved member list has posted to it, so "
-"the list is out of date. Update it in groups.json before replying."
-msgstr "Jemand, der nicht in der gespeicherten Mitgliederliste dieser Gruppe steht, hat darin geschrieben. Die Liste ist also veraltet. Aktualisieren Sie sie in groups.json, bevor Sie antworten."
-
#: src/core/src/bluetooth/groups.cpp
#, c++-format
msgid "The roster for this group contains an unusable address: {}"
diff --git a/po/es.po b/po/es.po
index adeb43c..855ab3a 100644
--- a/po/es.po
+++ b/po/es.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-28 20:29-0700\n"
+"POT-Creation-Date: 2026-08-28 16:06-0700\n"
"PO-Revision-Date: 2026-08-22\n"
"Last-Translator: Tether project\n"
"Language-Team: Spanish\n"
@@ -395,14 +395,6 @@ msgstr "Enviado a %s\n"
msgid "The message was not sent."
msgstr "El mensaje no se envió."
-#: src/cli/main.cpp
-msgid "--port expects a number.\n"
-msgstr "--port espera un número.\n"
-
-#: src/cli/main.cpp
-msgid "--timeout expects a number in milliseconds.\n"
-msgstr "--timeout espera un número en milisegundos.\n"
-
#: src/cli/main.cpp
msgid "Unknown action. Run tether --help for options\n"
msgstr "Acción desconocida. Ejecute tether --help para ver las opciones\n"
@@ -607,12 +599,6 @@ msgstr "No hay ningún iPhone emparejado seleccionado."
msgid "Group replies are turned off."
msgstr "Las respuestas a grupos están desactivadas."
-#: src/core/src/bluetooth/groups.cpp
-msgid ""
-"Someone who is not in this group's saved member list has posted to it, so "
-"the list is out of date. Update it in groups.json before replying."
-msgstr "Alguien que no está en la lista de miembros guardada de este grupo ha escrito en él, así que la lista está desactualizada. Actualícela en groups.json antes de responder."
-
#: src/core/src/bluetooth/groups.cpp
#, c++-format
msgid "The roster for this group contains an unusable address: {}"
diff --git a/po/fr.po b/po/fr.po
index 8ea77f1..ca5433b 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-28 20:29-0700\n"
+"POT-Creation-Date: 2026-08-28 16:06-0700\n"
"PO-Revision-Date: 2026-08-22\n"
"Last-Translator: Tether project\n"
"Language-Team: French\n"
@@ -399,14 +399,6 @@ msgstr "Envoyé à %s\n"
msgid "The message was not sent."
msgstr "Le message n'a pas été envoyé."
-#: src/cli/main.cpp
-msgid "--port expects a number.\n"
-msgstr "--port attend un nombre.\n"
-
-#: src/cli/main.cpp
-msgid "--timeout expects a number in milliseconds.\n"
-msgstr "--timeout attend un nombre en millisecondes.\n"
-
#: src/cli/main.cpp
msgid "Unknown action. Run tether --help for options\n"
msgstr "Action inconnue. Lancez tether --help pour voir les options\n"
@@ -610,12 +602,6 @@ msgstr "Aucun iPhone appairé sélectionné."
msgid "Group replies are turned off."
msgstr "Les réponses aux groupes sont désactivées."
-#: src/core/src/bluetooth/groups.cpp
-msgid ""
-"Someone who is not in this group's saved member list has posted to it, so "
-"the list is out of date. Update it in groups.json before replying."
-msgstr "Quelqu'un qui ne figure pas dans la liste des membres enregistrée de ce groupe y a écrit ; la liste est donc obsolète. Mettez-la à jour dans groups.json avant de répondre."
-
#: src/core/src/bluetooth/groups.cpp
#, c++-format
msgid "The roster for this group contains an unusable address: {}"
diff --git a/po/it.po b/po/it.po
index f2343f3..90b55f2 100644
--- a/po/it.po
+++ b/po/it.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-28 20:29-0700\n"
+"POT-Creation-Date: 2026-08-28 16:06-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Italian\n"
@@ -396,14 +396,6 @@ msgstr "Inviato a %s\n"
msgid "The message was not sent."
msgstr "Il messaggio non è stato inviato."
-#: src/cli/main.cpp
-msgid "--port expects a number.\n"
-msgstr "--port richiede un numero.\n"
-
-#: src/cli/main.cpp
-msgid "--timeout expects a number in milliseconds.\n"
-msgstr "--timeout richiede un numero in millisecondi.\n"
-
#: src/cli/main.cpp
msgid "Unknown action. Run tether --help for options\n"
msgstr "Azione sconosciuta. Esegui tether --help per le opzioni\n"
@@ -608,12 +600,6 @@ msgstr "Nessun iPhone accoppiato selezionato."
msgid "Group replies are turned off."
msgstr "Le risposte di gruppo sono disattivate."
-#: src/core/src/bluetooth/groups.cpp
-msgid ""
-"Someone who is not in this group's saved member list has posted to it, so "
-"the list is out of date. Update it in groups.json before replying."
-msgstr "Qualcuno che non è nell'elenco dei membri salvato di questo gruppo vi ha scritto, quindi l'elenco non è aggiornato. Aggiornalo in groups.json prima di rispondere."
-
#: src/core/src/bluetooth/groups.cpp
#, c++-format
msgid "The roster for this group contains an unusable address: {}"
diff --git a/po/ja.po b/po/ja.po
index 3e5aafb..8d5665f 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-28 20:29-0700\n"
+"POT-Creation-Date: 2026-08-28 16:06-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Japanese\n"
@@ -384,14 +384,6 @@ msgstr "%s に送信しました\n"
msgid "The message was not sent."
msgstr "メッセージは送信されませんでした。"
-#: src/cli/main.cpp
-msgid "--port expects a number.\n"
-msgstr "--port には数値を指定してください。\n"
-
-#: src/cli/main.cpp
-msgid "--timeout expects a number in milliseconds.\n"
-msgstr "--timeout にはミリ秒単位の数値を指定してください。\n"
-
#: src/cli/main.cpp
msgid "Unknown action. Run tether --help for options\n"
msgstr ""
@@ -584,12 +576,6 @@ msgstr "ペアリング済みの iPhone が選択されていません。"
msgid "Group replies are turned off."
msgstr "グループへの返信はオフになっています。"
-#: src/core/src/bluetooth/groups.cpp
-msgid ""
-"Someone who is not in this group's saved member list has posted to it, so "
-"the list is out of date. Update it in groups.json before replying."
-msgstr "このグループの保存済みメンバーリストにない相手が投稿したため、リストが古くなっています。返信する前に groups.json で更新してください。"
-
#: src/core/src/bluetooth/groups.cpp
#, c++-format
msgid "The roster for this group contains an unusable address: {}"
diff --git a/po/ko.po b/po/ko.po
index e329293..6dc9b78 100644
--- a/po/ko.po
+++ b/po/ko.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-28 20:29-0700\n"
+"POT-Creation-Date: 2026-08-28 16:06-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Korean\n"
@@ -383,14 +383,6 @@ msgstr "%s(으)로 보냈습니다\n"
msgid "The message was not sent."
msgstr "메시지가 전송되지 않았습니다."
-#: src/cli/main.cpp
-msgid "--port expects a number.\n"
-msgstr "--port에는 숫자를 지정해야 합니다.\n"
-
-#: src/cli/main.cpp
-msgid "--timeout expects a number in milliseconds.\n"
-msgstr "--timeout에는 밀리초 단위의 숫자를 지정해야 합니다.\n"
-
#: src/cli/main.cpp
msgid "Unknown action. Run tether --help for options\n"
msgstr "알 수 없는 동작입니다. 옵션을 보려면 tether --help를 실행하십시오\n"
@@ -582,12 +574,6 @@ msgstr "선택된 페어링 iPhone이 없습니다."
msgid "Group replies are turned off."
msgstr "그룹 답장이 꺼져 있습니다."
-#: src/core/src/bluetooth/groups.cpp
-msgid ""
-"Someone who is not in this group's saved member list has posted to it, so "
-"the list is out of date. Update it in groups.json before replying."
-msgstr "이 그룹의 저장된 구성원 목록에 없는 사람이 글을 보냈으므로 목록이 오래되었습니다. 답장하기 전에 groups.json에서 업데이트하세요."
-
#: src/core/src/bluetooth/groups.cpp
#, c++-format
msgid "The roster for this group contains an unusable address: {}"
diff --git a/po/nl.po b/po/nl.po
index 7564b24..a57fa0f 100644
--- a/po/nl.po
+++ b/po/nl.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-28 20:29-0700\n"
+"POT-Creation-Date: 2026-08-28 16:06-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Dutch\n"
@@ -393,14 +393,6 @@ msgstr "Verstuurd naar %s\n"
msgid "The message was not sent."
msgstr "Het bericht is niet verstuurd."
-#: src/cli/main.cpp
-msgid "--port expects a number.\n"
-msgstr "--port verwacht een getal.\n"
-
-#: src/cli/main.cpp
-msgid "--timeout expects a number in milliseconds.\n"
-msgstr "--timeout verwacht een getal in milliseconden.\n"
-
#: src/cli/main.cpp
msgid "Unknown action. Run tether --help for options\n"
msgstr "Onbekende actie. Voer tether --help uit voor de opties\n"
@@ -601,12 +593,6 @@ msgstr "Geen gekoppelde iPhone geselecteerd."
msgid "Group replies are turned off."
msgstr "Groepsantwoorden staan uit."
-#: src/core/src/bluetooth/groups.cpp
-msgid ""
-"Someone who is not in this group's saved member list has posted to it, so "
-"the list is out of date. Update it in groups.json before replying."
-msgstr "Iemand die niet in de opgeslagen ledenlijst van deze groep staat, heeft erin geschreven, dus de lijst is verouderd. Werk hem bij in groups.json voordat u antwoordt."
-
#: src/core/src/bluetooth/groups.cpp
#, c++-format
msgid "The roster for this group contains an unusable address: {}"
diff --git a/po/pl.po b/po/pl.po
index 07d5b45..0fdf4dc 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-28 20:29-0700\n"
+"POT-Creation-Date: 2026-08-28 16:06-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Polish\n"
@@ -399,14 +399,6 @@ msgstr "Wysłano do %s\n"
msgid "The message was not sent."
msgstr "Wiadomość nie została wysłana."
-#: src/cli/main.cpp
-msgid "--port expects a number.\n"
-msgstr "--port oczekuje liczby.\n"
-
-#: src/cli/main.cpp
-msgid "--timeout expects a number in milliseconds.\n"
-msgstr "--timeout oczekuje liczby w milisekundach.\n"
-
#: src/cli/main.cpp
msgid "Unknown action. Run tether --help for options\n"
msgstr "Nieznane działanie. Uruchom tether --help, aby zobaczyć opcje\n"
@@ -606,12 +598,6 @@ msgstr "Nie wybrano żadnego sparowanego iPhone'a."
msgid "Group replies are turned off."
msgstr "Odpowiedzi grupowe są wyłączone."
-#: src/core/src/bluetooth/groups.cpp
-msgid ""
-"Someone who is not in this group's saved member list has posted to it, so "
-"the list is out of date. Update it in groups.json before replying."
-msgstr "Do tej grupy napisał ktoś, kogo nie ma na jej zapisanej liście członków, więc lista jest nieaktualna. Zaktualizuj ją w pliku groups.json przed odpowiedzią."
-
#: src/core/src/bluetooth/groups.cpp
#, c++-format
msgid "The roster for this group contains an unusable address: {}"
diff --git a/po/pt_BR.po b/po/pt_BR.po
index 18f30b1..acd1615 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-28 20:29-0700\n"
+"POT-Creation-Date: 2026-08-28 16:06-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Brazilian Portuguese\n"
@@ -393,14 +393,6 @@ msgstr "Enviado para %s\n"
msgid "The message was not sent."
msgstr "A mensagem não foi enviada."
-#: src/cli/main.cpp
-msgid "--port expects a number.\n"
-msgstr "--port espera um número.\n"
-
-#: src/cli/main.cpp
-msgid "--timeout expects a number in milliseconds.\n"
-msgstr "--timeout espera um número em milissegundos.\n"
-
#: src/cli/main.cpp
msgid "Unknown action. Run tether --help for options\n"
msgstr "Ação desconhecida. Execute tether --help para ver as opções\n"
@@ -603,12 +595,6 @@ msgstr "Nenhum iPhone pareado selecionado."
msgid "Group replies are turned off."
msgstr "As respostas em grupo estão desativadas."
-#: src/core/src/bluetooth/groups.cpp
-msgid ""
-"Someone who is not in this group's saved member list has posted to it, so "
-"the list is out of date. Update it in groups.json before replying."
-msgstr "Alguém que não está na lista de membros salva deste grupo escreveu nele, então a lista está desatualizada. Atualize-a em groups.json antes de responder."
-
#: src/core/src/bluetooth/groups.cpp
#, c++-format
msgid "The roster for this group contains an unusable address: {}"
diff --git a/po/ru.po b/po/ru.po
index 19d96a0..4bfd0a9 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-28 20:29-0700\n"
+"POT-Creation-Date: 2026-08-28 16:06-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Russian\n"
@@ -399,14 +399,6 @@ msgstr "Отправлено в %s\n"
msgid "The message was not sent."
msgstr "Сообщение не отправлено."
-#: src/cli/main.cpp
-msgid "--port expects a number.\n"
-msgstr "--port ожидает число.\n"
-
-#: src/cli/main.cpp
-msgid "--timeout expects a number in milliseconds.\n"
-msgstr "--timeout ожидает число в миллисекундах.\n"
-
#: src/cli/main.cpp
msgid "Unknown action. Run tether --help for options\n"
msgstr ""
@@ -607,12 +599,6 @@ msgstr "Не выбран сопряжённый iPhone."
msgid "Group replies are turned off."
msgstr "Групповые ответы выключены."
-#: src/core/src/bluetooth/groups.cpp
-msgid ""
-"Someone who is not in this group's saved member list has posted to it, so "
-"the list is out of date. Update it in groups.json before replying."
-msgstr "В эту группу написал кто-то, кого нет в её сохранённом списке участников, значит список устарел. Обновите его в groups.json, прежде чем отвечать."
-
#: src/core/src/bluetooth/groups.cpp
#, c++-format
msgid "The roster for this group contains an unusable address: {}"
diff --git a/po/sv.po b/po/sv.po
index 4428a2c..a2b21bb 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-28 20:29-0700\n"
+"POT-Creation-Date: 2026-08-28 16:06-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Swedish\n"
@@ -392,14 +392,6 @@ msgstr "Skickat till %s\n"
msgid "The message was not sent."
msgstr "Meddelandet skickades inte."
-#: src/cli/main.cpp
-msgid "--port expects a number.\n"
-msgstr "--port förväntar sig ett tal.\n"
-
-#: src/cli/main.cpp
-msgid "--timeout expects a number in milliseconds.\n"
-msgstr "--timeout förväntar sig ett tal i millisekunder.\n"
-
#: src/cli/main.cpp
msgid "Unknown action. Run tether --help for options\n"
msgstr "Okänd åtgärd. Kör tether --help för flaggorna\n"
@@ -597,12 +589,6 @@ msgstr "Ingen parkopplad iPhone vald."
msgid "Group replies are turned off."
msgstr "Gruppsvar är avstängda."
-#: src/core/src/bluetooth/groups.cpp
-msgid ""
-"Someone who is not in this group's saved member list has posted to it, so "
-"the list is out of date. Update it in groups.json before replying."
-msgstr "Någon som inte finns i gruppens sparade medlemslista har skrivit i den, så listan är inaktuell. Uppdatera den i groups.json innan du svarar."
-
#: src/core/src/bluetooth/groups.cpp
#, c++-format
msgid "The roster for this group contains an unusable address: {}"
diff --git a/po/tether.pot b/po/tether.pot
index e54ea0c..1a786df 100644
--- a/po/tether.pot
+++ b/po/tether.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether 0.2.15\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-28 20:29-0700\n"
+"POT-Creation-Date: 2026-08-28 16:06-0700\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -371,14 +371,6 @@ msgstr ""
msgid "The message was not sent."
msgstr ""
-#: src/cli/main.cpp
-msgid "--port expects a number.\n"
-msgstr ""
-
-#: src/cli/main.cpp
-msgid "--timeout expects a number in milliseconds.\n"
-msgstr ""
-
#: src/cli/main.cpp
msgid "Unknown action. Run tether --help for options\n"
msgstr ""
@@ -549,12 +541,6 @@ msgstr ""
msgid "Group replies are turned off."
msgstr ""
-#: src/core/src/bluetooth/groups.cpp
-msgid ""
-"Someone who is not in this group's saved member list has posted to it, so "
-"the list is out of date. Update it in groups.json before replying."
-msgstr ""
-
#: src/core/src/bluetooth/groups.cpp
#, c++-format
msgid "The roster for this group contains an unusable address: {}"
diff --git a/po/tr.po b/po/tr.po
index 3b35a29..e6965d8 100644
--- a/po/tr.po
+++ b/po/tr.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-28 20:29-0700\n"
+"POT-Creation-Date: 2026-08-28 16:06-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Turkish\n"
@@ -391,14 +391,6 @@ msgstr "%s adresine gönderildi\n"
msgid "The message was not sent."
msgstr "Mesaj gönderilmedi."
-#: src/cli/main.cpp
-msgid "--port expects a number.\n"
-msgstr "--port bir sayı bekliyor.\n"
-
-#: src/cli/main.cpp
-msgid "--timeout expects a number in milliseconds.\n"
-msgstr "--timeout milisaniye cinsinden bir sayı bekliyor.\n"
-
#: src/cli/main.cpp
msgid "Unknown action. Run tether --help for options\n"
msgstr "Bilinmeyen eylem. Seçenekler için tether --help komutunu çalıştırın\n"
@@ -597,12 +589,6 @@ msgstr "Eşleşmiş bir iPhone seçilmedi."
msgid "Group replies are turned off."
msgstr "Grup yanıtları kapalı."
-#: src/core/src/bluetooth/groups.cpp
-msgid ""
-"Someone who is not in this group's saved member list has posted to it, so "
-"the list is out of date. Update it in groups.json before replying."
-msgstr "Bu grubun kayıtlı üye listesinde olmayan biri gruba yazdı, dolayısıyla liste güncel değil. Yanıtlamadan önce groups.json dosyasında güncelleyin."
-
#: src/core/src/bluetooth/groups.cpp
#, c++-format
msgid "The roster for this group contains an unusable address: {}"
diff --git a/po/uk.po b/po/uk.po
index f6c619d..76d887a 100644
--- a/po/uk.po
+++ b/po/uk.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-28 20:29-0700\n"
+"POT-Creation-Date: 2026-08-28 16:06-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Ukrainian\n"
@@ -400,14 +400,6 @@ msgstr "Надіслано до %s\n"
msgid "The message was not sent."
msgstr "Повідомлення не надіслано."
-#: src/cli/main.cpp
-msgid "--port expects a number.\n"
-msgstr "--port очікує число.\n"
-
-#: src/cli/main.cpp
-msgid "--timeout expects a number in milliseconds.\n"
-msgstr "--timeout очікує число в мілісекундах.\n"
-
#: src/cli/main.cpp
msgid "Unknown action. Run tether --help for options\n"
msgstr "Невідома дія. Запустіть tether --help, щоб побачити параметри\n"
@@ -605,12 +597,6 @@ msgstr "Не вибрано спареного iPhone."
msgid "Group replies are turned off."
msgstr "Групові відповіді вимкнено."
-#: src/core/src/bluetooth/groups.cpp
-msgid ""
-"Someone who is not in this group's saved member list has posted to it, so "
-"the list is out of date. Update it in groups.json before replying."
-msgstr "У цю групу написав хтось, кого немає в її збереженому списку учасників, тож список застарів. Оновіть його у файлі groups.json, перш ніж відповідати."
-
#: src/core/src/bluetooth/groups.cpp
#, c++-format
msgid "The roster for this group contains an unusable address: {}"
diff --git a/po/zh_CN.po b/po/zh_CN.po
index 708aefb..6dc39bd 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-28 20:29-0700\n"
+"POT-Creation-Date: 2026-08-28 16:06-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Simplified Chinese\n"
@@ -381,14 +381,6 @@ msgstr "已发送至 %s\n"
msgid "The message was not sent."
msgstr "信息未发送。"
-#: src/cli/main.cpp
-msgid "--port expects a number.\n"
-msgstr "--port 需要一个数字。\n"
-
-#: src/cli/main.cpp
-msgid "--timeout expects a number in milliseconds.\n"
-msgstr "--timeout 需要一个以毫秒为单位的数字。\n"
-
#: src/cli/main.cpp
msgid "Unknown action. Run tether --help for options\n"
msgstr "未知操作。运行 tether --help 查看选项\n"
@@ -570,12 +562,6 @@ msgstr "未选择已配对的 iPhone。"
msgid "Group replies are turned off."
msgstr "群组回复已关闭。"
-#: src/core/src/bluetooth/groups.cpp
-msgid ""
-"Someone who is not in this group's saved member list has posted to it, so "
-"the list is out of date. Update it in groups.json before replying."
-msgstr "有不在该群组已保存成员列表中的人发了消息,说明该列表已过期。回复前请在 groups.json 中更新它。"
-
#: src/core/src/bluetooth/groups.cpp
#, c++-format
msgid "The roster for this group contains an unusable address: {}"
diff --git a/src/cli/main.cpp b/src/cli/main.cpp
index a7e6e12..8c4d620 100644
--- a/src/cli/main.cpp
+++ b/src/cli/main.cpp
@@ -1,8 +1,6 @@
#include <algorithm>
#include <atomic>
-#include <charconv>
#include <csignal>
-#include <cstring>
#include <ctime>
#include <iostream>
#include <nlohmann/json.hpp>
@@ -99,16 +97,6 @@ void run_native_messaging_host(tether::Client& client) {
}
}
-static bool parse_int(const char* text, int& out) {
- const char* end = text + std::strlen(text);
- int value = 0;
- auto [stop, ec] = std::from_chars(text, end, value);
- if (ec != std::errc{} || stop != end)
- return false;
- out = value;
- return true;
-}
-
static size_t term_width() {
struct winsize ws{};
if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws) == 0 && ws.ws_col > 20)
@@ -749,15 +737,11 @@ int main(int argc, char* argv[]) {
if (i + 1 < argc && argv[i + 1][0] != '-')
host = argv[++i];
} else if (arg == "--port") {
- if (i + 1 < argc && argv[i + 1][0] != '-' && !parse_int(argv[++i], port)) {
- debug::log(ERR, _("--port expects a number.\n"));
- return 1;
- }
+ if (i + 1 < argc && argv[i + 1][0] != '-')
+ port = std::stoi(argv[++i]);
} else if (arg == "--timeout") {
- if (i + 1 < argc && argv[i + 1][0] != '-' && !parse_int(argv[++i], timeout_ms)) {
- debug::log(ERR, _("--timeout expects a number in milliseconds.\n"));
- return 1;
- }
+ if (i + 1 < argc && argv[i + 1][0] != '-')
+ timeout_ms = std::stoi(argv[++i]);
} else if (arg == "-f" || arg == "--send-file") {
action = "file";
if (i + 1 < argc && argv[i + 1][0] != '-')
diff --git a/src/core/include/tether/bluetooth/advert.hpp b/src/core/include/tether/bluetooth/advert.hpp
index 2009d90..71d6d01 100644
--- a/src/core/include/tether/bluetooth/advert.hpp
+++ b/src/core/include/tether/bluetooth/advert.hpp
@@ -6,9 +6,6 @@
namespace tether::bluetooth {
- // How long BlueZ keeps the solicitation on air before retiring it and calling release
- inline constexpr int ANCS_ADVERT_TIMEOUT_SECONDS = 180;
-
struct AdvertState;
// Broadcasts an LE advertisement soliciting the ANCS service.
diff --git a/src/core/include/tether/bluetooth/ancs/client.hpp b/src/core/include/tether/bluetooth/ancs/client.hpp
index d4c4db8..20bfed7 100644
--- a/src/core/include/tether/bluetooth/ancs/client.hpp
+++ b/src/core/include/tether/bluetooth/ancs/client.hpp
@@ -15,9 +15,6 @@ namespace tether::bluetooth::ancs {
// How often to retry discovery, subscription and the readiness probe.
inline constexpr int ANCS_RETRY_SECONDS = 5;
- // How often a live subscription is re-confirmed against BlueZ.
- inline constexpr int ANCS_VERIFY_SECONDS = 30;
-
// Defined in client.cpp.
struct AncsClientState;
diff --git a/src/core/include/tether/bluetooth/diagnostics.hpp b/src/core/include/tether/bluetooth/diagnostics.hpp
index 5599b64..f4b330d 100644
--- a/src/core/include/tether/bluetooth/diagnostics.hpp
+++ b/src/core/include/tether/bluetooth/diagnostics.hpp
@@ -3,8 +3,6 @@
#include <map>
#include <nlohmann/json.hpp>
#include <string>
-#include <utility>
-#include <vector>
namespace tether::bluetooth {
@@ -13,9 +11,6 @@ namespace tether::bluetooth {
// addresses, and the user's home and runtime directories.
class Redactor {
public:
- // Registers a literal to scrub wherever it appears
- void hide(const std::string& literal, const std::string& kind);
-
std::string text(const std::string& in);
// Recursively redacts strings
@@ -25,8 +20,6 @@ namespace tether::bluetooth {
std::string placeholder(const std::string& kind, const std::string& key);
std::map<std::string, std::string> assigned_;
- // Longest first, so a name that contains another is replaced whole.
- std::vector<std::pair<std::string, std::string>> literals_;
};
// True for keys whose values are personal content and must never appear in
diff --git a/src/core/include/tether/bluetooth/groups.hpp b/src/core/include/tether/bluetooth/groups.hpp
index 99b29d5..9b34ae5 100644
--- a/src/core/include/tether/bluetooth/groups.hpp
+++ b/src/core/include/tether/bluetooth/groups.hpp
@@ -17,7 +17,6 @@ namespace tether::bluetooth {
bool is_group = false;
// when the group has a name
bool named = false;
- bool route_invalidated = false;
std::string name;
// display names parsed from an unnamed group's subtitle, excluding the user.
std::vector<std::string> participants;
diff --git a/src/core/include/tether/bluetooth/profile_supervisor.hpp b/src/core/include/tether/bluetooth/profile_supervisor.hpp
index 68ff662..3e966d2 100644
--- a/src/core/include/tether/bluetooth/profile_supervisor.hpp
+++ b/src/core/include/tether/bluetooth/profile_supervisor.hpp
@@ -9,9 +9,6 @@ namespace tether::bluetooth {
inline constexpr int PROFILE_INITIAL_POLL_SECONDS = 5;
inline constexpr int PROFILE_STEADY_POLL_SECONDS = 15;
- // How often an open session is confirmed still to exist.
- inline constexpr int PROFILE_VERIFY_SECONDS = 30;
-
// Why an OBEX session could not be opened. Forbidden and Busy look alike from a distance, and reporting one as the
// other sends the user off re-pairing for nothing.
enum class ObexError {
@@ -49,8 +46,6 @@ namespace tether::bluetooth {
// Returns the new session's object path, or an empty string with err set.
virtual std::string create_session(const std::string& target, std::string& err) = 0;
virtual void remove_session(const std::string& path) = 0;
- // Whether obexd still has this session.
- virtual bool session_alive(const std::string& path) = 0;
};
struct ProfileStatus {
@@ -86,9 +81,6 @@ namespace tether::bluetooth {
private:
bool open_profile(const std::string& target, std::string& path, ObexError& error, bool& retried);
- // Clears map_open/pbap_open for any session obexd has let go
- void verify_sessions(int64_t now);
-
ProfileOps& ops_;
ProfileStatus status_;
std::string map_path_;
@@ -96,7 +88,6 @@ namespace tether::bluetooth {
bool map_retried_ = false;
bool pbap_retried_ = false;
int64_t next_attempt_ = 0;
- int64_t next_verify_ = 0;
bool opened_once_ = false;
};
diff --git a/src/core/src/bluetooth/advert.cpp b/src/core/src/bluetooth/advert.cpp
index cf2e429..73bd53e 100644
--- a/src/core/src/bluetooth/advert.cpp
+++ b/src/core/src/bluetooth/advert.cpp
@@ -23,7 +23,8 @@ namespace tether::bluetooth {
constexpr guint16 INERT_MANUFACTURER_ID = 0xffff;
constexpr const char* INERT_SERVICE_UUID = "00009999-0000-1000-8000-00805f9b34fb";
- constexpr guint16 ADVERT_TIMEOUT_SECONDS = ANCS_ADVERT_TIMEOUT_SECONDS;
+ // iOS needs the it running long enough to notice
+ constexpr guint16 ADVERT_TIMEOUT_SECONDS = 180;
constexpr const char* ADVERT_XML = R"XML(
<node>
diff --git a/src/core/src/bluetooth/ancs/client.cpp b/src/core/src/bluetooth/ancs/client.cpp
index 5eee902..40c63d8 100644
--- a/src/core/src/bluetooth/ancs/client.cpp
+++ b/src/core/src/bluetooth/ancs/client.cpp
@@ -338,7 +338,7 @@ namespace tether::bluetooth::ancs {
data_source_path.clear();
}
- // `subscribed` records that StartNotify once succeeded, and `ready` that iOS once answered on the Data Source.
+ // `subscribed` records that StartNotify once succeeded, which is not the same as a subscription that is still live.
void AncsClientState::verify_subscription() {
if (!monitor || !monitor->connection())
return;
@@ -383,12 +383,10 @@ namespace tether::bluetooth::ancs {
object_gone ? "characteristics gone" : "BlueZ cleared Notifying");
if (object_gone) {
drop_gatt_paths();
- set_status(false, "Waiting for the iPhone's notification service.");
} else {
unsubscribe();
subscribed = false;
next_subscribe = 0;
- set_status(false, "Subscribing to the iPhone's notifications...");
}
sequencer->reset();
in_progress.clear();
@@ -463,12 +461,6 @@ namespace tether::bluetooth::ancs {
if (response.command != CommandId::GetNotificationAttributes)
return;
- if (response.uid != request.uid) {
- debug::log(
- WARN, "ancs: discarding a response for uid {} while {} was in flight", response.uid, request.uid);
- return;
- }
-
auto found = in_progress.find(request.uid);
if (found == in_progress.end())
return;
@@ -598,8 +590,8 @@ namespace tether::bluetooth::ancs {
if (s->device_path.empty())
return;
- if (s->subscribed && now >= s->next_verify) {
- s->next_verify = now + (s->ready ? ANCS_VERIFY_SECONDS : ANCS_RETRY_SECONDS);
+ if (s->subscribed && !s->ready && now >= s->next_verify) {
+ s->next_verify = now + ANCS_RETRY_SECONDS;
s->verify_subscription();
}
diff --git a/src/core/src/bluetooth/bearer_supervisor.cpp b/src/core/src/bluetooth/bearer_supervisor.cpp
index 0e2c6a6..6bac674 100644
--- a/src/core/src/bluetooth/bearer_supervisor.cpp
+++ b/src/core/src/bluetooth/bearer_supervisor.cpp
@@ -15,6 +15,8 @@ namespace tether::bluetooth {
}
// Failures that clear on their own, unlike a refusal from the phone.
+ // Backing off for minutes on these leaves the link down long after the
+ // reason for it is gone (left the room answers with a page timeout, not a rejection).
bool is_transient(const std::string& err) {
static const char* const transient[] = {
"org.bluez.Error.NotReady",
@@ -79,7 +81,6 @@ namespace tether::bluetooth {
classic_connected_since_ = -1;
next_classic_attempt_ = 0;
status_.classic_backoff = 0;
- status_.le_dialling = ops_.le_connect_outstanding();
}
bool BearerSupervisor::tick(int64_t now, bool obex_up) {
@@ -91,7 +92,6 @@ namespace tether::bluetooth {
status_.classic_connected = false;
status_.le_connected = false;
status_.le_available = false;
- status_.le_dialling = ops_.le_connect_outstanding();
classic_connected_since_ = -1;
status_.reason = status_.device_present ? "iPhone is not paired." : "iPhone not known to BlueZ.";
return !(status_ == previous);
@@ -154,8 +154,6 @@ namespace tether::bluetooth {
}
}
- status_.le_dialling = ops_.le_connect_outstanding();
-
// An iPhone that keeps refusing while unlocked, with its Bluetooth
// permissions already on, is wedged on its own side: nothing here
// clears it, and saying "connecting" forever hides that. A host with
diff --git a/src/core/src/bluetooth/bmessage.cpp b/src/core/src/bluetooth/bmessage.cpp
index a04458a..3f86d7a 100644
--- a/src/core/src/bluetooth/bmessage.cpp
+++ b/src/core/src/bluetooth/bmessage.cpp
@@ -396,9 +396,6 @@ namespace tether::bluetooth {
}
std::string stuff_body(const std::string& body) {
- if (body.empty())
- return {};
-
std::string out;
for (const std::string& line : split_lines(body)) {
if (line_needs_stuffing(line))
@@ -406,10 +403,10 @@ namespace tether::bluetooth {
out += line;
out += "\r\n";
}
-
- const size_t surplus = (body.back() == '\n' || body.back() == '\r') ? 4 : 2;
- if (out.size() >= surplus)
- out.erase(out.size() - surplus);
+ // split_lines yields a trailing empty element for a body ending in a
+ // line break; drop the extra break it would introduce.
+ if (!body.empty() && body.back() != '\n' && body.back() != '\r' && out.size() >= 2)
+ out.erase(out.size() - 2);
return out;
}
diff --git a/src/core/src/bluetooth/connection.cpp b/src/core/src/bluetooth/connection.cpp
index f4116e5..9e3746a 100644
--- a/src/core/src/bluetooth/connection.cpp
+++ b/src/core/src/bluetooth/connection.cpp
@@ -46,22 +46,6 @@ namespace tether::bluetooth {
constexpr const char* MAP_FOLDER_SENT = "sent";
} // namespace
- namespace {
- bool roster_contradicted(const std::string& thread_key, const std::string& sender_key) {
- const std::vector<std::string>* roster = g_rosters.find(thread_key);
- if (!roster || sender_key.empty())
- return false;
- std::vector<Recipient> members;
- for (const auto& address : *roster) {
- Recipient recipient;
- std::string ignored;
- if (recipient_from_thread_key(address, recipient, ignored))
- members.push_back(recipient);
- }
- return sender_invalidates_route(sender_key, members);
- }
- } // namespace
-
MessageStore& message_store() { return g_messages; }
std::mutex& message_store_mutex() { return g_messages_mutex; }
@@ -169,9 +153,6 @@ namespace tether::bluetooth {
void reload_group_rosters() {
std::lock_guard<std::mutex> lock(g_group_mutex);
g_rosters = load_rosters();
- // re-reading the file is the user's answer to an invalidation.
- for (auto& [key, info] : g_group_info)
- info.route_invalidated = false;
}
bool mark_message_read(const std::string& handle, bool read, std::string& err_out, bool* synced_out) {
@@ -526,35 +507,6 @@ namespace tether::bluetooth {
return session;
}
- // GetAll rather than a named property: it answers for the interface as
- // a whole, so this does not depend on which properties this obexd
- // publishes.
- bool session_alive(const std::string& path) override {
- if (path.empty() || !conn_)
- return false;
- GError* error = nullptr;
- GVariant* reply = g_dbus_connection_call_sync(conn_,
- OBEX_NAME,
- path.c_str(),
- IFACE_PROPS,
- "GetAll",
- g_variant_new("(s)", "org.bluez.obex.Session1"),
- G_VARIANT_TYPE("(a{sv})"),
- G_DBUS_CALL_FLAGS_NONE,
- 5000,
- nullptr,
- &error);
- if (reply) {
- g_variant_unref(reply);
- return true;
- }
-
- const std::string message = error && error->message ? error->message : "";
- g_clear_error(&error);
- return message.find("UnknownObject") == std::string::npos &&
- message.find("UnknownMethod") == std::string::npos;
- }
-
void remove_session(const std::string& path) override {
if (path.empty() || !conn_)
return;
@@ -880,16 +832,11 @@ namespace tether::bluetooth {
if (g_correlator.correlate(message.body, now, info) == Correlation::Matched) {
const std::string key = group_thread_key(info);
if (!key.empty()) {
-
- const bool stale = !message.outgoing && roster_contradicted(key, message.thread_key);
-
// The sender label is display only and never becomes
// part of the thread identity or the reply route.
message.peer_name = info.sender;
message.thread_key = key;
- const bool was_stale = g_group_info[key].route_invalidated;
g_group_info[key] = info;
- g_group_info[key].route_invalidated = was_stale || stale;
}
}
}
@@ -1097,7 +1044,7 @@ namespace tether::bluetooth {
}
state_->bearer_ops = std::make_unique<BluezBearerOps>(*state_->monitor, address);
state_->profile_ops = std::make_unique<ObexProfileOps>(address);
- state_->bearers = std::make_unique<BearerSupervisor>(*state_->bearer_ops, ancs_effective);
+ state_->bearers = std::make_unique<BearerSupervisor>(*state_->bearer_ops, ancs_enabled);
state_->profiles = std::make_unique<ProfileSupervisor>(*state_->profile_ops);
// Only built when the caller can actually show notifications and the
diff --git a/src/core/src/bluetooth/diagnostics.cpp b/src/core/src/bluetooth/diagnostics.cpp
index afa0fca..f9947c9 100644
--- a/src/core/src/bluetooth/diagnostics.cpp
+++ b/src/core/src/bluetooth/diagnostics.cpp
@@ -1,7 +1,6 @@
#include "tether/bluetooth/diagnostics.hpp"
#include "tether/bluetooth/config.hpp"
-#include "tether/bluetooth/monitor.hpp"
#include "tether/bluetooth/pairing.hpp"
#include "tether/version.hpp"
@@ -27,20 +26,6 @@ namespace tether::bluetooth {
const std::regex kNumber(R"(\+[0-9]{7,15})");
const std::regex kRuntimeDir(R"(/run/user/[0-9]+)");
- // Device names that identify a model rather than a person.
- bool is_generic_device_name(const std::string& name) {
- static const char* const GENERIC[] = {
- "iphone", "ipad", "ipod", "mac", "macbook", "apple watch", "watch", "airpods", "tether", "phone"};
- std::string lowered = name;
- std::transform(lowered.begin(), lowered.end(), lowered.begin(), [](unsigned char c) {
- return static_cast<char>(std::tolower(c));
- });
- for (const char* generic : GENERIC)
- if (lowered == generic)
- return true;
- return false;
- }
-
std::string upper(std::string s) {
std::transform(s.begin(), s.end(), s.begin(), [](unsigned char c) { return std::toupper(c); });
return s;
@@ -107,29 +92,9 @@ namespace tether::bluetooth {
return token;
}
- void Redactor::hide(const std::string& literal, const std::string& kind) {
- // A one- or two-character alias would shred unrelated text.
- if (literal.size() < 3)
- return;
-
- if (is_generic_device_name(literal))
- return;
-
- for (const auto& [existing, token] : literals_)
- if (existing == literal)
- return;
- literals_.emplace_back(literal, placeholder(kind, literal));
- std::sort(literals_.begin(), literals_.end(), [](const auto& a, const auto& b) {
- return a.first.size() > b.first.size();
- });
- }
-
std::string Redactor::text(const std::string& in) {
std::string out = in;
- for (const auto& [literal, token] : literals_)
- out = replace_literal(out, literal, token);
-
// Directories first: a path under $HOME can contain anything below.
if (const char* runtime = std::getenv("XDG_RUNTIME_DIR"); runtime && *runtime)
out = replace_literal(out, runtime, "<runtime>");
@@ -216,13 +181,6 @@ namespace tether::bluetooth {
const Config config = load_config();
Redactor redactor;
- if (g_bluez) {
- for (const auto& device : g_bluez->snapshot().devices)
- redactor.hide(device.name, "name");
- for (const auto& adapter : g_bluez->snapshot().adapters)
- redactor.hide(adapter.name, "name");
- }
-
nlohmann::json report;
report["command"] = "bt_diagnostics";
report["version"] = TETHER_VERSION;
diff --git a/src/core/src/bluetooth/groups.cpp b/src/core/src/bluetooth/groups.cpp
index c1eae21..1996b1c 100644
--- a/src/core/src/bluetooth/groups.cpp
+++ b/src/core/src/bluetooth/groups.cpp
@@ -279,12 +279,6 @@ namespace tether::bluetooth {
return ReplyEligibility::Disabled;
}
- if (info.route_invalidated) {
- reason = _("Someone who is not in this group's saved member list has posted to it, so the list is out of "
- "date. Update it in groups.json before replying.");
- return ReplyEligibility::RouteInvalidated;
- }
-
// user-supplied roster is authoritative for either kind of group
if (const std::vector<std::string>* roster = rosters.find(thread_key)) {
for (const auto& address : *roster) {
diff --git a/src/core/src/bluetooth/map_session.cpp b/src/core/src/bluetooth/map_session.cpp
index 0aca5d7..658eedd 100644
--- a/src/core/src/bluetooth/map_session.cpp
+++ b/src/core/src/bluetooth/map_session.cpp
@@ -2,7 +2,6 @@
#include "tether/bluetooth/obex_transfer.hpp"
#include "tether/log.hpp"
-#include <atomic>
#include <chrono>
#include <cstdlib>
#include <filesystem>
@@ -261,14 +260,13 @@ namespace tether::bluetooth {
return false;
}
- static std::atomic<uint64_t> serial{0};
+ // obexd reads the message from a file. It is staged in the per-user
+ // runtime directory rather than a shared temp directory, since it holds
+ // the message text and the recipient.
const char* runtime = getenv("XDG_RUNTIME_DIR");
- if (!runtime || !*runtime) {
- err = "XDG_RUNTIME_DIR is not set, and a message cannot be staged anywhere else.";
- return false;
- }
- std::filesystem::path source = std::filesystem::path(runtime) / ("tether-send-" + std::to_string(getpid()) +
- "-" + std::to_string(serial++) + ".bmsg");
+ std::filesystem::path source =
+ (runtime && *runtime ? std::filesystem::path(runtime) : std::filesystem::temp_directory_path()) /
+ ("tether-send-" + std::to_string(getpid()) + ".bmsg");
std::error_code ec;
{
diff --git a/src/core/src/bluetooth/pairing.cpp b/src/core/src/bluetooth/pairing.cpp
index 8f4fe33..6422004 100644
--- a/src/core/src/bluetooth/pairing.cpp
+++ b/src/core/src/bluetooth/pairing.cpp
@@ -277,18 +277,6 @@ namespace tether::bluetooth {
std::atomic<bool> g_pairing_owns_advert{false};
- std::atomic<int64_t> g_advert_hold_until_ms{0};
-
- int64_t steady_ms() {
- return std::chrono::duration_cast<std::chrono::milliseconds>(
- std::chrono::steady_clock::now().time_since_epoch())
- .count();
- }
-
- void hold_advert_for(int seconds) { g_advert_hold_until_ms = steady_ms() + seconds * 1000; }
-
- bool advert_held() { return steady_ms() < g_advert_hold_until_ms.load(); }
-
struct AdvertOwnership {
AdvertOwnership() { g_pairing_owns_advert = true; }
~AdvertOwnership() { g_pairing_owns_advert = false; }
@@ -381,39 +369,18 @@ namespace tether::bluetooth {
// report what BlueZ actually says.
auto objects = monitor.snapshot();
const std::string adapter = objects.adapters.empty() ? std::string{} : objects.adapters.front().path;
- if (!start_advert(monitor, adapter, err))
- return false;
-
- hold_advert_for(ANCS_ADVERT_TIMEOUT_SECONDS);
-
- return true;
+ return start_advert(monitor, adapter, err);
}
- namespace {
-
- bool rearm_solicitation(BluezMonitor& monitor, std::string& err) {
- if (!monitor.connection()) {
- err = "Bluetooth is unavailable.";
- return false;
- }
- auto objects = monitor.snapshot();
- const std::string adapter = objects.adapters.empty() ? std::string{} : objects.adapters.front().path;
- return start_advert(monitor, adapter, err);
- }
- } // namespace
-
bool ancs_solicitation_active() {
std::lock_guard<std::mutex> lock(g_advert_mutex);
return g_advert && g_advert->active();
}
- void stop_ancs_solicitation(BluezMonitor& monitor) {
- g_advert_hold_until_ms = 0;
- stop_advert(monitor);
- }
+ void stop_ancs_solicitation(BluezMonitor& monitor) { stop_advert(monitor); }
void supervise_ancs_solicitation(BluezMonitor& monitor, bool want) {
- if (g_pairing_owns_advert || advert_held())
+ if (g_pairing_owns_advert)
return;
if (!want) {
if (ancs_solicitation_active())
@@ -429,7 +396,7 @@ namespace tether::bluetooth {
return;
std::string err;
- if (rearm_solicitation(monitor, err)) {
+ if (solicit_ancs(monitor, err)) {
next_attempt = {};
return;
}
@@ -438,6 +405,8 @@ namespace tether::bluetooth {
}
bool confirm_with_dialog(const std::string& device_name, const std::string& code, bool& unavailable) {
+ // Translated before the fork: gettext takes a lock, and calling it in the
+ // child of a threaded process can deadlock if another thread held it.
// TRANSLATORS: {0} is the device name, {1} is the numeric pairing code.
const std::string body = tr_format(
_("{0} wants to pair.\n\nConfirm this code matches the one on your iPhone:\n\n{1}"), device_name, code);
@@ -445,14 +414,6 @@ namespace tether::bluetooth {
const std::string accept = _("Confirm");
const std::string reject = _("Cancel");
- std::filesystem::path self_path;
- try {
- self_path = std::filesystem::read_symlink("/proc/self/exe");
- } catch (...) {
- }
- const std::string sibling = (self_path.parent_path() / "tether-dialog").string();
- const std::string timeout = std::to_string(DIALOG_TIMEOUT_SECONDS);
-
pid_t pid = fork();
if (pid < 0) {
debug::log(ERR, "bluetooth: fork() for confirmation dialog failed");
@@ -461,6 +422,14 @@ namespace tether::bluetooth {
}
if (pid == 0) {
+ std::filesystem::path self_path;
+ try {
+ self_path = std::filesystem::read_symlink("/proc/self/exe");
+ } catch (...) {
+ }
+ std::string sibling = (self_path.parent_path() / "tether-dialog").string();
+ std::string timeout = std::to_string(DIALOG_TIMEOUT_SECONDS);
+
execl(sibling.c_str(),
"tether-dialog",
"--title",
@@ -724,27 +693,25 @@ namespace tether::bluetooth {
if (!set_property(conn, device.path, IFACE_DEVICE, "Trusted", g_variant_new_boolean(TRUE), &trust_err))
debug::log(WARN, "bluetooth: could not trust device: {}", trust_err);
- if (result.status == "paired") {
- // Prefer BR/EDR for the next outbound connection, then let the Classic
- // ACL settle before anything touches LE. Older BlueZ has no such property.
- set_property(conn, device.path, IFACE_DEVICE, "PreferredBearer", g_variant_new_string("bredr"));
- notify(progress, "settling", "waiting for the Classic link to settle");
- std::this_thread::sleep_for(std::chrono::seconds(CLASSIC_SETTLE_SECONDS));
- }
+ // Prefer BR/EDR for the next outbound connection, then let the Classic ACL
+ // settle before anything touches LE. Older BlueZ has no such property.
+ set_property(conn, device.path, IFACE_DEVICE, "PreferredBearer", g_variant_new_string("bredr"));
+ notify(progress, "settling", "waiting for the Classic link to settle");
+ std::this_thread::sleep_for(std::chrono::seconds(CLASSIC_SETTLE_SECONDS));
Device settled;
if (lookup(monitor, result.device_address, settled))
result.dual_bond = settled.has_le_bearer && settled.le_bonded;
- if (!settled.le_link_up())
- set_property(conn, device.path, IFACE_DEVICE, "PreferredBearer", g_variant_new_string("le"));
+ // Hand the preference back to LE now that Classic has settled. Leaving the
+ // bond pinned to BR/EDR keeps the LE half down indefinitely
+ set_property(conn, device.path, IFACE_DEVICE, "PreferredBearer", g_variant_new_string("le"));
// Only now solicit ANCS. This advert is what makes iOS reveal its
// "Show Message Notifications" and "Sync Contacts" toggles, and it is safe
// to broadcast because the bond already exists.
std::string advert_err;
if (start_advert(monitor, adapter_path, advert_err)) {
- hold_advert_for(ANCS_ADVERT_TIMEOUT_SECONDS);
notify(progress,
"soliciting",
"Open Settings > Bluetooth > (i) on the iPhone and enable Show Message Notifications and "
diff --git a/src/core/src/bluetooth/pbap_session.cpp b/src/core/src/bluetooth/pbap_session.cpp
index d73f546..fda2e4a 100644
--- a/src/core/src/bluetooth/pbap_session.cpp
+++ b/src/core/src/bluetooth/pbap_session.cpp
@@ -23,15 +23,13 @@ namespace tether::bluetooth {
return false;
}
- // The phonebook is personal data and obexd writes the file under its own
- // umask, so there is nowhere safe to stage it but the per-user runtime
- // directory. Falling back to a shared /tmp would leave it readable and its
- // predictable name a symlink target; refuse instead.
+ // The phonebook is personal data, so it is staged in the per-user runtime
+ // directory rather than a world-readable /tmp.
std::filesystem::path staging_file() {
const char* runtime = getenv("XDG_RUNTIME_DIR");
- if (!runtime || !*runtime)
- return {};
- return std::filesystem::path(runtime) / ("tether-pbap-" + std::to_string(getpid()) + ".vcf");
+ std::filesystem::path dir =
+ runtime && *runtime ? std::filesystem::path(runtime) : std::filesystem::temp_directory_path();
+ return dir / ("tether-pbap-" + std::to_string(getpid()) + ".vcf");
}
std::string read_file(const std::filesystem::path& path) {
@@ -81,10 +79,6 @@ namespace tether::bluetooth {
std::vector<VCard> contacts;
const std::filesystem::path target = staging_file();
- if (target.empty()) {
- err = "XDG_RUNTIME_DIR is not set, and the phonebook cannot be staged anywhere else.";
- return contacts;
- }
std::error_code ec;
std::filesystem::remove(target, ec);
diff --git a/src/core/src/bluetooth/profile_supervisor.cpp b/src/core/src/bluetooth/profile_supervisor.cpp
index 0ba14ee..367190c 100644
--- a/src/core/src/bluetooth/profile_supervisor.cpp
+++ b/src/core/src/bluetooth/profile_supervisor.cpp
@@ -125,7 +125,6 @@ namespace tether::bluetooth {
map_retried_ = false;
pbap_retried_ = false;
next_attempt_ = 0;
- next_verify_ = 0;
status_.map_open = false;
status_.pbap_open = false;
}
@@ -171,28 +170,6 @@ namespace tether::bluetooth {
return false;
}
- // A session obexd has dropped still says open, and the short-circuit below means nothing ever notices.
- void ProfileSupervisor::verify_sessions(int64_t now) {
- if (now < next_verify_)
- return;
- next_verify_ = now + PROFILE_VERIFY_SECONDS;
-
- if (status_.map_open && !ops_.session_alive(map_path_)) {
- debug::log(WARN, "bluetooth: the MAP session is gone; reopening it");
- map_path_.clear();
- map_retried_ = false;
- status_.map_open = false;
- next_attempt_ = 0;
- }
- if (status_.pbap_open && !ops_.session_alive(pbap_path_)) {
- debug::log(WARN, "bluetooth: the PBAP session is gone; reopening it");
- pbap_path_.clear();
- pbap_retried_ = false;
- status_.pbap_open = false;
- next_attempt_ = 0;
- }
- }
-
bool ProfileSupervisor::tick(int64_t now, bool device_ready) {
ProfileStatus previous = status_;
@@ -201,8 +178,6 @@ namespace tether::bluetooth {
return !(status_ == previous);
}
- verify_sessions(now);
-
if (status_.map_open && status_.pbap_open) {
status_.reason = _("Messages and contacts are connected.");
return !(status_ == previous);
diff --git a/src/core/src/net.cpp b/src/core/src/net.cpp
index b28d6ce..f2a6334 100644
--- a/src/core/src/net.cpp
+++ b/src/core/src/net.cpp
@@ -436,12 +436,6 @@ namespace tether {
broadcast_local_event(build_bt_status().dump());
}
- static void restart_supervision(bluetooth::Config config) {
- if (bluetooth::g_bt_connections)
- bluetooth::g_bt_connections->set_device(bluetooth::supervised_address(config), config.ancs_enabled);
- broadcast_local_event(build_bt_status().dump());
- }
-
static void run_bt_unpair(const std::string& address) {
if (!bluetooth::g_bluez)
return;
@@ -746,25 +740,16 @@ namespace tether {
debug::log(INFO, "UnixServer: New connection (fd: {})", client_fd);
}
- // Generous against the ~683 KB base64 payloads file transfers push through,
- // and far short of what an unframed stream would cost.
- static constexpr size_t MAX_CLIENT_BUFFER_BYTES = 16u * 1024 * 1024;
-
void UnixServer::handle_client(int client_fd) {
// 64k buffer sizes for chunks
char buf[65536];
ssize_t n = read(client_fd, buf, sizeof(buf));
if (n > 0) {
+ // Reference + cursor rather than erase(0, ...) per message: the old form
+ // shifted the whole remaining buffer down for every line, which is O(n^2)
+ // over the ~683 KB base64 payloads file transfers push through here.
std::string& buffer = client_buffers_[client_fd];
buffer.append(buf, n);
- if (buffer.size() > MAX_CLIENT_BUFFER_BYTES) {
- debug::log(ERR, "UnixServer: client {} sent an unframed stream; dropping it", client_fd);
- client_buffers_.erase(client_fd);
- unregister_client_fd(client_fd);
- loop_.removeFd(client_fd);
- close(client_fd);
- return;
- }
size_t start = 0;
size_t pos;
@@ -779,12 +764,19 @@ namespace tether {
register_local_subscriber(client_fd);
std::string payload = build_local_state_snapshot().dump() + "\n";
write_plain_packet(client_fd, payload);
-
+ // Replay any current OTP so a freshly reconnected extension
+ // (MV3 service worker restart) gets it without waiting for a
+ // new_otp push it may have missed while disconnected. Skip the
+ // replay once a page has already taken the code, otherwise the
+ // restart re-injects it into whatever site the user is on now.
if (Otp otp = otp_peek(); otp && !otp_is_claimed()) {
std::string otp_payload = make_otp_event(otp).dump() + "\n";
write_plain_packet(client_fd, otp_payload);
}
-
+ // Same reasoning for Bluetooth: connection status is only
+ // broadcast when it changes, so a client that subscribed
+ // after the last change would otherwise never learn whether
+ // messages are connected, and would keep its composer shut.
write_plain_packet(client_fd, build_bt_connection_status().dump() + "\n");
continue;
} else if (j.contains("command") && j["command"] == "unsubscribe") {
@@ -827,7 +819,10 @@ namespace tether {
auto config = bluetooth::load_config();
config.device_address = j["address"];
bluetooth::save_config(config);
- std::thread(restart_supervision, config).detach();
+ if (bluetooth::g_bt_connections)
+ bluetooth::g_bt_connections->set_device(bluetooth::supervised_address(config),
+ config.ancs_enabled);
+ broadcast_local_event(build_bt_status().dump());
} else if (j.contains("command") && j["command"] == "bt_list_threads") {
std::string payload = build_bt_threads().dump() + "\n";
write_plain_packet(client_fd, payload);
@@ -847,7 +842,10 @@ namespace tether {
handles.push_back(j["handle"].get<std::string>());
}
const bool read = j.value("read", true);
-
+ // Each write-through is a blocking OBEX call against a
+ // session that serves them one at a time, so the batch gets
+ // one worker rather than a thread per message, and reports
+ // once rather than making the UI refresh per handle.
if (!handles.empty()) {
std::thread([handles, read]() {
int changed = 0;
@@ -888,6 +886,9 @@ namespace tether {
event["thread"] = thread;
event["success"] = bluetooth::send_message(thread, body, sent, err);
if (event["success"]) {
+ // The phone reports nothing about a sent message,
+ // so the local record is announced the same way an
+ // incoming one would be.
nlohmann::json message = bluetooth::to_json(sent);
message["command"] = "bt_message";
broadcast_local_event(message.dump());
@@ -897,10 +898,17 @@ namespace tether {
broadcast_local_event(event.dump());
}).detach();
} else if (j.contains("command") && j["command"] == "bt_solicit") {
+ // The advertisement that makes iOS reveal its Messages and
+ // Contacts permission toggles is otherwise only on air for a
+ // few minutes after pairing, leaving a full unpair/re-pair as
+ // the only way back.
std::thread([]() {
nlohmann::json event;
event["command"] = "bt_solicit_result";
+ // Telling someone to switch on what is already on and
+ // already working reads as the app not knowing its own
+ // state. Nothing needs soliciting in that case.
if (build_bt_connection_status().value("ancs_ready", false)) {
event["success"] = true;
event["message"] = _("Notification mirroring is already active; nothing to do.");
@@ -925,12 +933,18 @@ namespace tether {
auto config = bluetooth::load_config();
config.ancs_enabled = j.value("enabled", true);
bluetooth::save_config(config);
- std::thread(restart_supervision, config).detach();
+ if (bluetooth::g_bt_connections)
+ bluetooth::g_bt_connections->set_device(bluetooth::supervised_address(config),
+ config.ancs_enabled);
+ broadcast_local_event(build_bt_status().dump());
} else if (j.contains("command") && j["command"] == "bt_set_enabled") {
auto config = bluetooth::load_config();
config.enabled = j.value("enabled", true);
bluetooth::save_config(config);
- std::thread(restart_supervision, config).detach();
+ if (bluetooth::g_bt_connections)
+ bluetooth::g_bt_connections->set_device(bluetooth::supervised_address(config),
+ config.ancs_enabled);
+ broadcast_local_event(build_bt_status().dump());
} else if (j.contains("command") && j["command"] == "bt_set_ancs_content") {
auto config = bluetooth::load_config();
config.ancs_content_enabled = j.value("enabled", true);
@@ -1121,7 +1135,8 @@ namespace tether {
}).detach();
} else if (j.contains("command") && j["command"] == "send_file" && j.contains("path")) {
std::string path = j["path"];
- std::thread([path]() {
+ int pfd = client_fd; // thread-safe capture
+ std::thread([path, pfd]() {
Client local;
if (local.connect("", 0)) { // connects correctly via unix socket
std::string err;
@@ -1131,8 +1146,12 @@ namespace tether {
resp["success"] = ok;
resp["message"] = ok ? ("Sent " + std::filesystem::path(path).filename().string())
: ("Send failed: " + (err.empty() ? "unknown error" : err));
-
- broadcast_local_event(resp.dump());
+ std::string payload = resp.dump() + "\n";
+ // direct write is fine, or we can use broadcast_local_event. We'll reply directly to
+ // the GUI socket.
+ if (write(pfd, payload.c_str(), payload.size()) < 0) {
+ debug::log(ERR, "net write error\n");
+ }
}
}).detach();
continue; // skip the "OK\n" below because we reply asynchronously
@@ -1320,24 +1339,10 @@ namespace tether {
char buf[65536];
int n = SSL_read(ssl, buf, sizeof(buf));
if (n > 0) {
-
+ // See UnixServer::handle_client — cursor instead of a per-message erase.
+ // This is the hot path for inbound file transfers.
std::string& buffer = client_buffers_[client_fd];
-
buffer.append(buf, n);
- if (buffer.size() > MAX_CLIENT_BUFFER_BYTES) {
- debug::log(ERR, "TcpServer: client {} sent an unframed stream; dropping it", client_fd);
- SSL_free(ssl);
- active_ssl_.erase(client_fd);
- client_buffers_.erase(client_fd);
- ssl_handshake_complete_.erase(client_fd);
- client_paired_.erase(client_fd);
- client_info_.erase(client_fd);
- connected_remote_clients.erase(client_fd);
- unregister_client_fd(client_fd);
- loop_.removeFd(client_fd);
- close(client_fd);
- return;
- }
size_t start = 0;
size_t pos;
diff --git a/src/gtk/devices_view.cpp b/src/gtk/devices_view.cpp
index ec6dbf3..da3d2e1 100644
--- a/src/gtk/devices_view.cpp
+++ b/src/gtk/devices_view.cpp
@@ -6,7 +6,6 @@
#include <algorithm>
#include <deque>
#include <filesystem>
-#include <memory>
#include <string>
#include <tether/crypto.hpp>
#include <tether/discovery.hpp>
@@ -101,15 +100,6 @@ namespace tether::ui {
return !supervised.empty() && supervised == address;
}
- std::string connection_reason(const nlohmann::json& connection) {
- const bool link_degraded =
- !connection.value("classic_connected", false) || !connection.value("le_connected", false);
- std::string reason = connection.value(link_degraded ? "link_reason" : "profile_reason", "");
- if (reason.empty())
- reason = connection.value("link_reason", "");
- return reason;
- }
-
void set_capability_row(GtkWidget* label, const std::string& title, bool ok, const std::string& note) {
std::string markup = std::string(ok ? "\u2713" : "\u2717") + " <b>" + escape_markup(title) + "</b>";
if (!note.empty())
@@ -228,7 +218,10 @@ namespace tether::ui {
// otherwise report no device selected.
reason = _("Bluetooth is switched off for this iPhone.");
} else {
- reason = connection_reason(connection);
+ const bool link_degraded = !classic || !le;
+ reason = connection.value(link_degraded ? "link_reason" : "profile_reason", "");
+ if (reason.empty())
+ reason = connection.value("link_reason", "");
}
set_text(g_devices.lbl_bt_reason, reason);
@@ -969,7 +962,9 @@ namespace tether::ui {
if (command == "bt_connection_changed") {
g_devices.bt_connection = event;
const bool connected = event.value("map_open", false) || event.value("ancs_ready", false);
- std::string detail = connection_reason(event);
+ std::string detail = event.value("profile_reason", "");
+ if (detail.empty())
+ detail = event.value("link_reason", "");
if (detail.empty() && connected)
detail = _("Messages and notifications are connected.");
set_route_status(Route::Bluetooth, connected, detail);
@@ -997,21 +992,15 @@ namespace tether::ui {
return false;
}
if (command == "bt_pair_confirm_request") {
- g_idle_add(
- [](gpointer data) -> gboolean {
- std::unique_ptr<std::string> code(static_cast<std::string*>(data));
- GtkWidget* dialog = gtk_message_dialog_new(GTK_WINDOW(main_window()),
- GTK_DIALOG_MODAL,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_OK_CANCEL,
- _("Does the iPhone show this code?\n\n%s"),
- code->c_str());
- const bool confirmed = gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK;
- gtk_widget_destroy(dialog);
- daemon_send({{"command", "bt_pair_confirm"}, {"accept", confirmed}});
- return G_SOURCE_REMOVE;
- },
- new std::string(event.value("code", "")));
+ GtkWidget* dialog = gtk_message_dialog_new(GTK_WINDOW(main_window()),
+ GTK_DIALOG_MODAL,
+ GTK_MESSAGE_QUESTION,
+ GTK_BUTTONS_OK_CANCEL,
+ _("Does the iPhone show this code?\n\n%s"),
+ event.value("code", "").c_str());
+ const bool confirmed = gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK;
+ gtk_widget_destroy(dialog);
+ daemon_send({{"command", "bt_pair_confirm"}, {"accept", confirmed}});
return true;
}
if (command == "bt_pair_progress") {
diff --git a/test/test_ancs_sequencer.cpp b/test/test_ancs_sequencer.cpp
index 81c0a98..43c7a4a 100644
--- a/test/test_ancs_sequencer.cpp
+++ b/test/test_ancs_sequencer.cpp
@@ -127,34 +127,6 @@ TEST(AncsSequencer, MatchesEachResponseToItsOwnRequest) {
EXPECT_EQ(harness.completions[1].second.attribute(0), "com.example.second");
}
-// Data Source responses carry no request identifier, so a response that arrives
-// after its own request timed out reassembles cleanly against whatever is in
-// flight by then. The sequencer cannot tell them apart -- the echoed uid is the
-// only thing that can, which is why the client compares it before filing the
-// attributes against a notification.
-TEST(AncsSequencer, ALateResponseIsDeliveredAgainstTheWrongRequest) {
- Harness harness;
- auto sequencer = harness.make();
-
- sequencer.submit(build_notification_request(11, {NotificationAttributeId::AppIdentifier}));
- sequencer.submit(build_notification_request(22, {NotificationAttributeId::AppIdentifier}));
- sequencer.tick(0);
-
- // The phone never answers for 11, so it is failed and 22 goes out.
- sequencer.tick(REQUEST_TIMEOUT_SECONDS);
- ASSERT_EQ(harness.failures.size(), 1u);
- ASSERT_EQ(harness.writes.size(), 2u);
-
- // 11's answer turns up now, while 22 is the one in flight.
- auto late = notification_response(11, "com.example.first");
- sequencer.on_data_source(late.data(), late.size(), REQUEST_TIMEOUT_SECONDS + 1);
-
- ASSERT_EQ(harness.completions.size(), 1u);
- EXPECT_EQ(harness.completions[0].first.uid, 22u) << "the sequencer credits it to the live request";
- EXPECT_EQ(harness.completions[0].second.uid, 11u) << "and the echoed uid is what gives it away";
- EXPECT_NE(harness.completions[0].first.uid, harness.completions[0].second.uid);
-}
-
// An action gets no Data Source response at all, so waiting for one would stall
// every queued request behind it for the full timeout.
TEST(AncsSequencer, DoesNotWaitForAResponseToAnAction) {
@@ -238,8 +210,8 @@ TEST(AncsSequencer, BoundsTheQueue) {
size_t accepted = 0;
for (size_t i = 0; i < MAX_QUEUED_REQUESTS + 10; ++i) {
- if (sequencer.submit(
- build_notification_request(static_cast<uint32_t>(i), {NotificationAttributeId::AppIdentifier})))
+ if (sequencer.submit(build_notification_request(static_cast<uint32_t>(i),
+ {NotificationAttributeId::AppIdentifier})))
++accepted;
}
EXPECT_EQ(accepted, MAX_QUEUED_REQUESTS) << "a notification burst must not grow the daemon without bound";
diff --git a/test/test_bluetooth_supervisor.cpp b/test/test_bluetooth_supervisor.cpp
index 9ff0814..ed00dcf 100644
--- a/test/test_bluetooth_supervisor.cpp
+++ b/test/test_bluetooth_supervisor.cpp
@@ -2,7 +2,6 @@
#include <tether/bluetooth/bearer_supervisor.hpp>
#include <tether/bluetooth/profile_supervisor.hpp>
-#include <set>
#include <string>
#include <vector>
@@ -67,8 +66,6 @@ namespace {
int pbap_attempts = 0;
std::vector<std::string> removed;
int session_counter = 0;
- // Sessions obexd has let go. Everything else answers alive.
- std::set<std::string> dead;
std::string create_session(const std::string& target, std::string& err) override {
const bool is_map = target == "map";
@@ -82,8 +79,6 @@ namespace {
}
void remove_session(const std::string& path) override { removed.push_back(path); }
-
- bool session_alive(const std::string& path) override { return !dead.count(path); }
};
} // namespace
@@ -220,81 +215,6 @@ TEST(BearerSupervisor, SolicitationIsHeldOffOnlyWhileTheOneDialIsInFlight) {
}
}
-// A dial outstanding when BR/EDR drops must not latch the solicitation off air.
-// Nothing else on the Classic-down path re-reads it, and the advert is the only
-// thing that brings LE back -- so a stale `true` here is a permanent outage on a
-// host whose Classic link never returns (2026-08-23).
-TEST(BearerSupervisor, ClassicDroppingUnderADialDoesNotLatchTheSolicitationOffAir) {
- class ListeningBearer : public FakeBearer {
- public:
- ConnectResult connect_le(std::string&) override {
- ++le_attempts;
- outstanding = true;
- return ConnectResult::Requested;
- }
- } ops;
-
- BearerSupervisor sup(ops, true);
- int64_t now = 0;
- sup.tick(now);
- sup.tick(++now);
- now += BEARER_SETTLE_SECONDS;
- sup.tick(now);
- ASSERT_EQ(ops.le_attempts, 1);
- ASSERT_TRUE(sup.status().le_dialling);
-
- // BR/EDR goes and does not come back, which is what a host with no locally
- // connectable profile looks like.
- ops.classic = false;
- ops.classic_succeeds = false;
- sup.tick(++now);
- EXPECT_TRUE(sup.status().le_dialling) << "the dial really is still in flight";
-
- // BlueZ answers. Nothing re-enters the LE branch, so this is the only place
- // the flag can be cleared.
- ops.outstanding = false;
- for (int i = 0; i < 500; ++i)
- sup.tick(++now);
- EXPECT_FALSE(sup.status().le_dialling)
- << "a finished dial kept the advert off air for the whole time BR/EDR was down";
-
- BearerStatus bearer = sup.status();
- bearer.le_available = true;
- EXPECT_TRUE(should_solicit_ancs(true, bearer, now, -1)) << "the advert is what brings LE back";
-}
-
-// A session obexd has let go still reads open, and the supervisor short-circuits
-// once both are. PBAP has no other liveness signal, and on a host where BlueZ
-// never reports the Classic link up there is no reset() to fall back on either.
-TEST(ProfileSupervisor, ReopensASessionObexdHasDropped) {
- FakeProfiles ops;
- ProfileSupervisor sup(ops);
-
- int64_t now = 0;
- sup.tick(now, true);
- ASSERT_TRUE(sup.status().map_open);
- ASSERT_TRUE(sup.status().pbap_open);
- const std::string pbap = sup.pbap_session();
- const int opened = ops.pbap_attempts;
-
- // Nothing yet: the check is not free, so it runs on its own interval.
- ops.dead.insert(pbap);
- sup.tick(++now, true);
- EXPECT_EQ(ops.pbap_attempts, opened);
- EXPECT_EQ(sup.pbap_session(), pbap);
-
- // Dead, with the Classic link never dropping to say so. Noticed and reopened
- // in the same tick, the way drop_map() already behaves.
- now += PROFILE_VERIFY_SECONDS;
- sup.tick(now, true);
- EXPECT_TRUE(sup.status().pbap_open);
- EXPECT_GT(ops.pbap_attempts, opened) << "a dropped session read open forever";
- EXPECT_NE(sup.pbap_session(), pbap);
-
- EXPECT_TRUE(sup.status().map_open) << "the live session must not be disturbed";
- EXPECT_EQ(ops.map_attempts, 1);
-}
-
// A dialled LE link can come up carrying no ANCS at all, and while it reads
// connected the solicitation stays off air -- so nothing ever asks the phone for
// the service, and notifications never arrive (2026-08-23).
diff --git a/test/test_bmessage_build.cpp b/test/test_bmessage_build.cpp
index cb4e43c..8889085 100644
--- a/test/test_bmessage_build.cpp
+++ b/test/test_bmessage_build.cpp
@@ -107,31 +107,6 @@ TEST(BMessageBuild, LengthCountsTheWholeMessageBlock) {
EXPECT_EQ(declared, std::string("hello").size() + 22);
}
-// The block is BEGIN:MSG CRLF <body> CRLF END:MSG, so the CRLF before END:MSG is
-// a delimiter and not content. A body the user ended with a newline used to
-// carry two surplus blank lines into it.
-TEST(BMessageBuild, ATrailingNewlineDoesNotBecomeBlankLines) {
- auto block = [](const std::string& body) {
- const std::string out = build_bmessage({tel("+15551234567")}, body);
- const size_t begin = out.find("BEGIN:MSG\r\n");
- const size_t end = out.find("END:MSG\r\n", begin);
- EXPECT_NE(begin, std::string::npos);
- EXPECT_NE(end, std::string::npos);
- return out.substr(begin, end + std::string("END:MSG\r\n").size() - begin);
- };
-
- EXPECT_EQ(block("hello"), "BEGIN:MSG\r\nhello\r\nEND:MSG\r\n");
- EXPECT_EQ(block("hello\n"), "BEGIN:MSG\r\nhello\r\nEND:MSG\r\n") << "a trailing newline is not content";
- EXPECT_EQ(block("a\nb"), "BEGIN:MSG\r\na\r\nb\r\nEND:MSG\r\n");
- EXPECT_EQ(block("a\n\nb"), "BEGIN:MSG\r\na\r\n\r\nb\r\nEND:MSG\r\n") << "an internal blank line is";
-
- // LENGTH has to keep counting whatever the block actually became.
- const std::string out = build_bmessage({tel("+15551234567")}, "hello\n");
- const size_t length_at = out.find("LENGTH:");
- ASSERT_NE(length_at, std::string::npos);
- EXPECT_EQ(std::stoul(out.substr(length_at + 7)), block("hello\n").size());
-}
-
// --- The trust boundary --------------------------------------------------
//
// Every case below is an address that, interpolated verbatim, would add a
diff --git a/test/test_bt_diagnostics.cpp b/test/test_bt_diagnostics.cpp
index ee14ce6..087c079 100644
--- a/test/test_bt_diagnostics.cpp
+++ b/test/test_bt_diagnostics.cpp
@@ -33,35 +33,6 @@ TEST(BtDiagnostics, RedactsEmailAndPhoneNumber) {
EXPECT_EQ(r.text("sent to [email protected]"), "sent to <email-1>");
}
-// A device alias is chosen by its owner and is usually a person's name. It
-// reaches the report through free-form fields -- a pairing progress detail, a
-// result message -- where no pattern would recognise it.
-TEST(BtDiagnostics, RedactsARegisteredDeviceAlias) {
- Redactor r;
- r.hide("Zack's iPhone", "name");
- EXPECT_EQ(r.text("connecting Zack's iPhone"), "connecting <name-1>");
- EXPECT_EQ(r.text("Paired with Zack's iPhone."), "Paired with <name-1>.");
- EXPECT_EQ(r.text("Zack's iPhone"), "<name-1>") << "the same alias keeps the same placeholder";
-}
-
-// Replacing a model name would rewrite the advice strings that name the same
-// word, and it identifies nobody.
-TEST(BtDiagnostics, LeavesAGenericDeviceNameAlone) {
- Redactor r;
- r.hide("iPhone", "name");
- r.hide("AirPods", "name");
- EXPECT_EQ(r.text("The iPhone is not answering on LE."), "The iPhone is not answering on LE.");
- EXPECT_EQ(r.text("connecting AirPods"), "connecting AirPods");
-}
-
-// An alias can contain an address or a number, and the whole thing should go as
-// one placeholder rather than being half-eaten by the patterns.
-TEST(BtDiagnostics, AnAliasWinsOverThePatternsInsideIt) {
- Redactor r;
- r.hide("Zack 60:57:C8:30:6A:F7", "name");
- EXPECT_EQ(r.text("connecting Zack 60:57:C8:30:6A:F7"), "connecting <name-1>");
-}
-
TEST(BtDiagnostics, LeavesTimestampsAndErrorCodesAlone) {
Redactor r;
const std::string out = r.text("2026-08-16T10:11:12 failed with 0x43 after 30000 ms");