2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-31 22:25:08 +00:00

Compare commits

..

2 Commits

Author SHA1 Message Date
Albert Vaca Cintora
7394b861d2 WIP: Open settings when permissions have been denied twice 2023-08-24 01:43:58 +02:00
Albert Vaca Cintora
8a4da371c8 Request notifications permission so we can target Android 13 2023-08-23 18:55:08 +02:00
48 changed files with 162 additions and 253 deletions

View File

@@ -8,8 +8,9 @@ SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:versionCode="12800"
android:versionName="1.28.0">
package="org.kde.kdeconnect_tp"
android:versionCode="12701"
android:versionName="1.27.1">
<uses-feature
android:name="android.hardware.telephony"

View File

@@ -38,7 +38,7 @@ fun String.runCommand(
android {
namespace = "org.kde.kdeconnect_tp"
compileSdk = 34
compileSdk = 33
defaultConfig {
minSdk = 21
targetSdk = 33
@@ -50,7 +50,7 @@ android {
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.3"
kotlinCompilerExtensionVersion = "1.5.1"
}
compileOptions {
@@ -154,7 +154,7 @@ dependencies {
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.ui.tooling.preview)
implementation(libs.androidx.activity.compose)
implementation(libs.accompanist.themeadapter.material3) // TODO: Remove deprecated library https://google.github.io/accompanist/themeadapter-material3/
implementation(libs.accompanist.themeadapter.material3)
implementation(libs.androidx.constraintlayout.compose)
implementation(libs.androidx.compose.ui.tooling.preview)

View File

@@ -11,10 +11,4 @@ KDE Connect poskytuje sadu vlastností pro vzájemnou integraci vašich zaříze
Prosím pamatujte, že pro správnou funkci této aplikace je nutné abyste na vašem počítači měli nainstalován KDE Connect a udržovali jej aktuální zde i na Androidu.
Informace o citlivých oprávněních:
* Oprávnění přístupnosti: Nutné pro příjem vstupu z jiného zařízení aby mohlo ovládat váš telefon Android pokud používáte vlastnost Vzdálený vstup.
* Oprávnění o poloze na pozadí: Je potřebné pro rozpoznání, ke které síti WiFi jste připojeni, pokud používáte funkci Důvěryhodné sítě.
KDE Connect nikdy neposílá KDE ani nikomu jinému jakékoliv informace. KDE Connect odesílá data z jednoho zařízení druhému přímo přes místní síť, nikdy přes internet, a výhradně s použitím koncového šifrování.
Tato aplikace je součástí Open Source projektu a existuje jenom díky přispěvatelům. Zdrojové soubory naleznete na webových stránkách.

View File

@@ -1 +1 @@
KDE Connect integruje váš chytrý telefon a počítač
KDE Connect propojuje váš mobilní telefon a počítač

View File

@@ -1,12 +0,0 @@
1.28:
* Improved connection reliability.
1.27:
* Added back the mouse receiver plugin.
1.26:
* Allow having different widgets for diferent devices.
* Add stats about network packets sent and received.
* Add the option to cancel a pairing request after sending it.
* Fix device name set initially not being human-friendly.
* Rewrite some of the internals to improve performance.

View File

@@ -1,8 +1,8 @@
[versions]
accompanistThemeadapterMaterial3 = "0.32.0"
accompanistThemeadapterMaterial3 = "0.31.0-alpha"
activityCompose = "1.7.2"
androidDesugarJdkLibs = "2.0.3"
androidGradlePlugin = "8.1.1"
androidGradlePlugin = "8.1.0"
androidSmsmms = "kdeconnect-1-21-0"
appcompat = "1.6.1"
bcpkixJdk15on = "1.70"
@@ -14,12 +14,12 @@ constraintlayoutCompose = "1.0.1"
coreKtx = "1.10.1"
disklrucache = "2.0.2"
documentfile = "1.0.1"
gradle = "8.1.1"
gradle = "8.1.0"
gridlayout = "1.0.0"
jsonassert = "1.5.1"
junit = "4.13.2"
dependencyLicenseReport = "1.16"
kotlin = "1.9.10"
kotlin = "1.9.0"
kotlinxCoroutinesCore = "1.7.1"
lifecycleExtensions = "2.2.0"
lifecycleRuntimeKtx = "2.6.1"
@@ -30,13 +30,13 @@ media = "1.6.0"
minaCore = "2.0.19"
mockitoCore = "3.12.4"
powermockModuleJunit4 = "2.0.0"
preferenceKtx = "1.2.1"
preferenceKtx = "1.2.0"
reactiveStreams = "1.0.4"
recyclerview = "1.3.1"
rxjava = "2.2.21"
sshdCore = "0.14.0"
swiperefreshlayout = "1.1.0"
uiToolingPreview = "1.5.1"
uiToolingPreview = "1.4.3"
univocityParsers = "2.9.1"
[libraries]

View File

@@ -5,7 +5,7 @@ msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-07-30 00:45+0000\n"
"PO-Revision-Date: 2023-08-07 16:43+0200\n"
"PO-Revision-Date: 2023-06-07 14:10+0200\n"
"Last-Translator: Vit Pelcak <vit@pelcak.org>\n"
"Language-Team: Czech <kde-i18n-doc@kde.org>\n"
"Language: cs\n"
@@ -13,8 +13,30 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
"X-Generator: Lokalize 23.04.3\n"
"X-Generator: Lokalize 23.04.1\n"
#, fuzzy
#| msgid ""
#| "KDE Connect provides a set of features to integrate your workflow across "
#| "devices:\n"
#| "\n"
#| "- Shared clipboard: copy and paste between your devices.\n"
#| "- Share files and URLs to your computer from any app.\n"
#| "- Get notifications for incoming calls and SMS messages on your PC.\n"
#| "- Virtual touchpad: Use your phone screen as your computer's touchpad.\n"
#| "- Notifications sync: Read your Android notifications from the desktop.\n"
#| "- Multimedia remote control: Use your phone as a remote for Linux media "
#| "players.\n"
#| "- WiFi connection: no USB wire or bluetooth needed.\n"
#| "- End-to-end TLS encryption: your information is safe.\n"
#| "\n"
#| "Please note you will need to install KDE Connect on your computer for "
#| "this app to work, and keep the desktop version up-to-date with the "
#| "Android version for the latest features to work.\n"
#| "\n"
#| "This app is part of an open source project and it exists thanks to all "
#| "the people who contributed to it. Visit the website to grab the source "
#| "code."
msgid ""
"KDE Connect provides a set of features to integrate your workflow across "
"devices:\n"
@@ -64,15 +86,5 @@ msgstr ""
"vašem počítači měli nainstalován KDE Connect a udržovali jej aktuální zde i "
"na Androidu.\n"
"\n"
"Informace o citlivých oprávněních:\n"
"* Oprávnění přístupnosti: Nutné pro příjem vstupu z jiného zařízení aby "
"mohlo ovládat váš telefon Android pokud používáte vlastnost Vzdálený vstup.\n"
"* Oprávnění o poloze na pozadí: Je potřebné pro rozpoznání, ke které síti "
"WiFi jste připojeni, pokud používáte funkci Důvěryhodné sítě.\n"
"\n"
"KDE Connect nikdy neposílá KDE ani nikomu jinému jakékoliv informace. KDE "
"Connect odesílá data z jednoho zařízení druhému přímo přes místní síť, nikdy "
"přes internet, a výhradně s použitím koncového šifrování.\n"
"\n"
"Tato aplikace je součástí Open Source projektu a existuje jenom díky "
"přispěvatelům. Zdrojové soubory naleznete na webových stránkách.\n"
"přispěvatelům. Zdrojové soubory naleznete na webových stránkách."

View File

@@ -5,7 +5,7 @@ msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-06-07 00:47+0000\n"
"PO-Revision-Date: 2023-07-27 14:30+0200\n"
"PO-Revision-Date: 2023-06-07 14:11+0200\n"
"Last-Translator: Vit Pelcak <vit@pelcak.org>\n"
"Language-Team: Czech <kde-i18n-doc@kde.org>\n"
"Language: cs\n"
@@ -13,7 +13,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
"X-Generator: Lokalize 23.04.3\n"
"X-Generator: Lokalize 23.04.1\n"
msgid "KDE Connect integrates your smartphone and computer"
msgstr "KDE Connect integruje váš chytrý telefon a počítač"
msgstr "KDE Connect propojuje váš mobilní telefon a počítač"

View File

@@ -10,10 +10,10 @@ msgstr ""
"PO-Revision-Date: 2023-07-15 14:30+0200\n"
"Last-Translator: Karl Ove Hufthammer <karl@huftis.org>\n"
"Language-Team: Norwegian Nynorsk <l10n-no@lister.huftis.org>\n"
"Language: nn\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: nn\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Lokalize 23.04.3\n"
"X-Environment: kde\n"

View File

@@ -4,7 +4,7 @@ msgstr ""
"Project-Id-Version: kdeorg\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-07-30 00:45+0000\n"
"PO-Revision-Date: 2023-09-02 02:56\n"
"PO-Revision-Date: 2023-08-02 12:40\n"
"Last-Translator: \n"
"Language-Team: Chinese Simplified\n"
"Language: zh_CN\n"

View File

@@ -4,7 +4,7 @@ msgstr ""
"Project-Id-Version: kdeorg\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-06-07 00:47+0000\n"
"PO-Revision-Date: 2023-09-02 02:56\n"
"PO-Revision-Date: 2023-08-02 12:40\n"
"Last-Translator: \n"
"Language-Team: Chinese Simplified\n"
"Language: zh_CN\n"

View File

@@ -12,7 +12,6 @@ SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:clickable="false"
android:focusable="false"
android:drawablePadding="8dp"
android:paddingTop="16dp"
android:paddingBottom="12dp"

View File

@@ -23,7 +23,6 @@
<FrameLayout
android:id="@+id/container"
android:descendantFocusability="afterDescendants"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>

View File

@@ -9,8 +9,6 @@ SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:descendantFocusability="afterDescendants"
android:focusable="false"
android:layout_height="match_parent"
tools:context="org.kde.kdeconnect.UserInterface.DeviceFragment">
@@ -28,7 +26,6 @@ SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted
<androidx.core.widget.NestedScrollView
android:id="@+id/device_view"
android:descendantFocusability="afterDescendants"
android:layout_width="match_parent"
android:layout_height="match_parent">

View File

@@ -24,8 +24,6 @@ SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted
<FrameLayout
android:id="@+id/container"
android:descendantFocusability="afterDescendants"
android:focusable="false"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"

View File

@@ -19,7 +19,6 @@ SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted
android:layout_height="match_parent"
android:addStatesFromChildren="true"
android:divider="@null"
android:descendantFocusability="afterDescendants"
android:dividerHeight="12dp"
android:orientation="vertical"
tools:listitem="@layout/list_card_entry"

View File

@@ -26,8 +26,6 @@ SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="12dp"
android:clickable="false"
android:focusable="false"
card_view:cardUseCompatPadding="true">
<LinearLayout

View File

@@ -12,7 +12,6 @@ SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:clickable="false"
android:focusable="false"
android:drawablePadding="8dp"
android:paddingTop="16dp"
android:paddingBottom="12dp"

View File

@@ -16,7 +16,6 @@ SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted
android:paddingRight="16dp"
android:text="@string/pairing_description"
android:clickable="false"
android:focusable="false"
android:background="@android:color/transparent"
>

View File

@@ -183,7 +183,6 @@
<item>1 минута</item>
<item>2 минути</item>
</string-array>
<string name="mpris_notifications_explanation">Разрешението за нотификации е необходимо, за да се показват отдалечени медии в чекмеджето за известия</string>
<string name="mpris_notification_settings_title">Показване на известие за управление на медиите</string>
<string name="mpris_notification_settings_summary">Разрешаване на управлението на медийните плейъри, без да отваряте KDE Connect</string>
<string name="share_to">Споделяне към...</string>
@@ -253,7 +252,6 @@
<string name="optional_permission_explanation">Трябва да предоставите допълнителни разрешения, за да активирате всички функции</string>
<string name="plugins_need_optional_permission">Някои плъгини имат деактивирани функции поради липса на разрешение (докоснете за повече информация):</string>
<string name="share_optional_permission_explanation">За да получавате файлове, трябва да разрешите достъпа до хранилището</string>
<string name="share_notifications_explanation">За да виждате напредъка при изпращане и получаване на файлове, трябва да разрешите известия</string>
<string name="telepathy_permission_explanation">За да четете и записвате SMS от работния плот, трябва да дадете разрешение за SMS</string>
<string name="telephony_permission_explanation">За да виждате телефонни обаждания на работния плот, трябва да дадете разрешение за телефонни обаждания дневници и състояние на телефона</string>
<string name="telephony_optional_permission_explanation">За да видите име на контакт вместо телефонен номер, трябва да дадете достъп до контактите на телефона</string>
@@ -399,8 +397,4 @@
<string name="send_clipboard">Изпращане на клипборд</string>
<string name="tap_to_execute">Докоснете, за да се изпълни</string>
<string name="plugin_stats">Данни на приставки</string>
<string name="enable_udp_broadcast">Активиране на откриване на устройства чрез UDP</string>
<string name="receive_notifications_permission_explanation">Известията трябва са разрешени, за да може да се получават от други устройства</string>
<string name="findmyphone_notifications_explanation">Разрешение за известия е необходимо, за да може телефонът да звъни, когато приложението е във фонов режим</string>
<string name="no_notifications">Известията са деактивирани, няма да получавате известия за входящи двойки.</string>
</resources>

View File

@@ -183,7 +183,6 @@
<item>1 minut</item>
<item>2 minuts</item>
</string-array>
<string name="mpris_notifications_explanation">Cal el permís de notificacions per a mostrar els elements multimèdia remots al calaix de notificacions</string>
<string name="mpris_notification_settings_title">Mostra les notificacions dels reproductors</string>
<string name="mpris_notification_settings_summary">Permet controlar els reproductors multimèdia sense obrir el KDE Connect</string>
<string name="share_to">Comparteix amb…</string>
@@ -253,7 +252,6 @@
<string name="optional_permission_explanation">Us caldrà atorgar permisos extres per a accedir a totes les característiques</string>
<string name="plugins_need_optional_permission">Alguns connectors tenen característiques desactivades per la falta de permís (toqueu per a més informació):</string>
<string name="share_optional_permission_explanation">Per a rebre fitxers cal permetre l\'accés a l\'emmagatzematge</string>
<string name="share_notifications_explanation">Per a veure el progrés en enviar i rebre fitxers, heu de permetre les notificacions</string>
<string name="telepathy_permission_explanation">Per a llegir i escriure SMS des de l\'escriptori, haureu de donar permís als SMS</string>
<string name="telephony_permission_explanation">Per a veure les trucades telefòniques des de l\'escriptori, haureu de donar permís d\'accés al registre de trucades telefòniques i a l\'estat del telèfon</string>
<string name="telephony_optional_permission_explanation">Per a veure un nom de contacte en comptes d\'un número de telèfon, haureu de donar permís als contactes del telèfon</string>
@@ -399,8 +397,4 @@
<string name="send_clipboard">Envia el porta-retalls</string>
<string name="tap_to_execute">Toqueu per a executar</string>
<string name="plugin_stats">Estadístiques del connector</string>
<string name="enable_udp_broadcast">Activa el descobriment UDP de dispositius</string>
<string name="receive_notifications_permission_explanation">Cal permetre que les notificacions es rebin des d\'altres dispositius</string>
<string name="findmyphone_notifications_explanation">Cal el permís de notificacions perquè el telèfon pugui sonar quan l\'aplicació estigui en segon pla</string>
<string name="no_notifications">Les notificacions estan desactivades, no rebreu notificacions entrants d\'emparellament.</string>
</resources>

View File

@@ -331,7 +331,7 @@
<string name="empty_trusted_networks_list_text">Nepřidali jste žádné důvěryhodné sítě</string>
<string name="allow_all_networks_text">Povolit všechny</string>
<string name="location_permission_needed_title">Získán přístup</string>
<string name="location_permission_needed_desc">KDE Connect vyžaduje oprávnění o poloze na pozadí aby poznal WiFi, ke které jste připojeni i když je aplikace samotná na pozadí. To je kvůli tomu, že názvy sítí WiFi okolo vás by mohly být použity pro nalezení vaší polohy i když to není to, co KDE Connect dělá.</string>
<string name="location_permission_needed_desc">KDE Connect vyžaduje oprávnění o umístění na pozadí aby poznal WiFi, ke které jste připojeni i když je aplikace samotná na pozadí. To je kvůli tomu, že názvy sítí WiFi okolo vás by mohly být použity pro nalezení vaší polohy i když to není to, co KDE Connect dělá.</string>
<string name="clipboard_android_x_incompat">Android 10 odstranit přístup ke schránce pro všechny aplikace. Tento modul bude zakázán.</string>
<string name="mpris_open_url">Pokračovat v přehrávání zde</string>
<string name="cant_open_url">Nelze otevřít URL pro pokračování v přehrávání</string>

View File

@@ -183,7 +183,6 @@
<item>1 minuto</item>
<item>2 minutos</item>
</string-array>
<string name="mpris_notifications_explanation">Se necesita el permiso de notificaciones para mostrar los medios remotos en el panel de notificaciones</string>
<string name="mpris_notification_settings_title">Mostrar notificación del control de medios</string>
<string name="mpris_notification_settings_summary">Permite controlar sus reproductores de medios sin abrir KDE Connect</string>
<string name="share_to">Compartir con...</string>
@@ -253,7 +252,6 @@
<string name="optional_permission_explanation">Debe otorgar permisos extra para activar todas las funciones</string>
<string name="plugins_need_optional_permission">Algunos complementos tienen funcionalidades desactivadas por falta de permisos (pulse para más información):</string>
<string name="share_optional_permission_explanation">Para recibir archivos necesita permitir el acceso a almacenamiento</string>
<string name="share_notifications_explanation">Para ver el progreso al enviar y recibir archivos necesita activar las notificaciones</string>
<string name="telepathy_permission_explanation">Para leer y escribir SMS desde su escritorio, necesita dar permisos para SMS</string>
<string name="telephony_permission_explanation">Para ver las llamadas telefónicas en el escritorio, necesita dar permisos al registro de llamadas telefónicas y al estado del teléfono</string>
<string name="telephony_optional_permission_explanation">Para ver el nombre de un contacto en lugar de un número telefónico, necesita dar acceso a los contactos de su teléfono</string>
@@ -399,8 +397,4 @@
<string name="send_clipboard">Enviar al portapapeles</string>
<string name="tap_to_execute">Pulse para ejecutar</string>
<string name="plugin_stats">Estadísticas del complemento</string>
<string name="enable_udp_broadcast">Activar descubrimiento de dispositivos por UDP</string>
<string name="receive_notifications_permission_explanation">Las notificaciones tienen que estar activadas para recibirlas desde otros dispositivos</string>
<string name="findmyphone_notifications_explanation">Se necesita el permiso de notificaciones para que el teléfono pueda sonar cuando la aplicación está en segundo plano</string>
<string name="no_notifications">Las notificaciones están desactivadas, no recibirá notificaciones de vinculación entrantes.</string>
</resources>

View File

@@ -183,7 +183,6 @@
<item>minutu 1</item>
<item>2 minutu</item>
</string-array>
<string name="mpris_notifications_explanation">Urruneko euskarria jakinarazpen tiraderan erakusteko jakinarazpen-baimena behar da</string>
<string name="mpris_notification_settings_title">Erakutsi euskarri kontrolaren jakinarazpena</string>
<string name="mpris_notification_settings_summary">Utzi zure euskarri-jotzaileak kontrolatzen KDE Connect ireki gabe</string>
<string name="share_to">Partekatu honekin...</string>
@@ -253,7 +252,6 @@
<string name="optional_permission_explanation">Baimen gehiago eman behar dituzu funtzio guztiak gaitzeko</string>
<string name="plugins_need_optional_permission">Plugin batzuek desgaitutako eginbideak dituzte baimenak faltan dituztelako (tak egin informazio gehiagorako):</string>
<string name="share_optional_permission_explanation">Fitxategiak jasotzeko biltegiratze sarbidea baimendu behar duzu</string>
<string name="share_notifications_explanation">Fitxategiak bidaltzean eta jasotzean aurrerapena ikusteko, jakinarazpenak baimendu behar dituzu</string>
<string name="telepathy_permission_explanation">SMSak zure mahaigainetik bidali ahal izateko, SMSak erabiltzeko baimena eman behar duzu</string>
<string name="telephony_permission_explanation">Telefono deiak zure mahaigainetik ikusteko, telefono deien egunkarira eta telefonoaren egoerara baimena eman behar duzu</string>
<string name="telephony_optional_permission_explanation">Telefono zenbakiaren ordez kontaktuaren izena ikusteko telefonoko kontaktuak atzitzeko baimena eman behar duzu</string>
@@ -399,8 +397,4 @@
<string name="send_clipboard">Bidali arbelekoa</string>
<string name="tap_to_execute">Tak egin exekutatzeko</string>
<string name="plugin_stats">Pluginaren estatistikak</string>
<string name="enable_udp_broadcast">Gaitu UDP bidez gailua aurkitzea</string>
<string name="receive_notifications_permission_explanation">Jakinarazpenak baimendu behar dira beste gailuetatik haiek jasotzeko</string>
<string name="findmyphone_notifications_explanation">Aplikazioa atzeko planoan dagoenean telefonoak jo dezan jakinarazpen-baimena behar da</string>
<string name="no_notifications">Jakinarazpenak ezgaituta daude, ez duzu jasoko parekatzeko sarrerako jakinarazpenik.</string>
</resources>

View File

@@ -97,7 +97,6 @@
<string name="pref_plugin_mousepad_send_keystrokes">Envoyez comme appuis de touches</string>
<string name="mouse_receiver_plugin_description">Recevoir les mouvements de la souri distante</string>
<string name="mouse_receiver_plugin_name">Récepteur de souris</string>
<string name="mouse_receiver_no_permissions">Pour recevoir des entrées tactiles à distance, vous devez accorder des autorisations daccessibilité pour contrôler entièrement votre périphérique</string>
<string name="view_status_title">État</string>
<string name="battery_status_format">Batterie : %d %%</string>
<string name="battery_status_low_format">Batterie : %d %% Batterie faible</string>

View File

@@ -183,7 +183,6 @@
<item>1 minuto</item>
<item>2 minutos</item>
</string-array>
<string name="mpris_notifications_explanation">Necesítase o permiso de notificacións para amosar medios remotos no caixón de notificacións.</string>
<string name="mpris_notification_settings_title">Amosar a notificación de control de reprodución.</string>
<string name="mpris_notification_settings_summary">Permitir controlar os reprodutores sen abrir KDE Connect</string>
<string name="share_to">Compartir con…</string>
@@ -253,7 +252,6 @@
<string name="optional_permission_explanation">Ten que conceder permisos adicionais para activar todas as funcións.</string>
<string name="plugins_need_optional_permission">Algúns complementos teñen funcionalidades desactivadas por mor dunha falta de permisos (toque para máis información):</string>
<string name="share_optional_permission_explanation">Para recibir ficheiros ten que permitir acceder ao almacenamento</string>
<string name="share_notifications_explanation">Para ver o progreso ao enviar ou recibir ficheiros ten que permitir notificacións.</string>
<string name="telepathy_permission_explanation">Para ler e escribir SMS desde o escritorio ten que dar permiso de SMS.</string>
<string name="telephony_permission_explanation">Para ver as chamadas de teléfono no escritorio ten que dar permiso aos rexistros de chamadas telefónicas e ao estado do teléfono</string>
<string name="telephony_optional_permission_explanation">Para ver o nome dun contacto en vez dun número de teléfono ten que dar acceso aos contactos do teléfono.</string>
@@ -377,7 +375,7 @@
<string name="rise_up">Ir ao principio</string>
<string name="rise_down">Ir ao final</string>
<string name="click_here_to_type">Toque aquí para escribir</string>
<string name="clear_compose">Baleirar</string>
<string name="clear_compose">Borrar</string>
<string name="send_compose">Enviar</string>
<string name="compose_send_title">Preparar un envío</string>
<string name="open_compose_send">Escribir texto</string>
@@ -399,8 +397,4 @@
<string name="send_clipboard">Enviar o portapapeis</string>
<string name="tap_to_execute">Toque para executar</string>
<string name="plugin_stats">Estatísticas do complemento</string>
<string name="enable_udp_broadcast">Activar o descubrimento de dispositivos UDP.</string>
<string name="receive_notifications_permission_explanation">Debe permitir notificacións para recibilas doutros dispositivos.</string>
<string name="findmyphone_notifications_explanation">Necesita o permiso de notificacións para que o teléfono poda soar cando a aplicación está en segundo plano.</string>
<string name="no_notifications">As notificacións están desactivadas, non recibirá notificacións entrantes de emparellamento.</string>
</resources>

View File

@@ -397,5 +397,4 @@
<string name="send_clipboard">Invia gli appunti</string>
<string name="tap_to_execute">Tocca per eseguire</string>
<string name="plugin_stats">Statistiche delle estensioni</string>
<string name="enable_udp_broadcast">Abilita rilevamento UDP dei dispositivi</string>
</resources>

View File

@@ -183,7 +183,6 @@
<item>1 minuut</item>
<item>2 minuten</item>
</string-array>
<string name="mpris_notifications_explanation">Het recht op meldingen is nodig om media op afstand te tonen in de meldingenschuiflade</string>
<string name="mpris_notification_settings_title">Mediabesturingsmelding tonen</string>
<string name="mpris_notification_settings_summary">Staat besturing van uw mediaspelers toe zonder KDE Connect te openen</string>
<string name="share_to">Delen met...</string>
@@ -253,7 +252,6 @@
<string name="optional_permission_explanation">U moet toestemming geven om alle functies in te schakelen</string>
<string name="plugins_need_optional_permission">Sommige plug-ins hebben functies uitgeschakeld vanwege ontbrekende toestemming (tik voor meer informatie):</string>
<string name="share_optional_permission_explanation">Om bestanden te ontvangen die u nodig hebt voor toegang tot opslag</string>
<string name="share_notifications_explanation">Om de voortgang te zien bij verzenden en ontvangen van bestanden moet u meldingen toestaan</string>
<string name="telepathy_permission_explanation">Om een SMS te lezen of te schrijven vanaf uw bureaublad moet u toestemming geven tot SMS</string>
<string name="telephony_permission_explanation">Om telefoonoproepen te zien op het bureaublad moet u toestemming geven tot telefoonoproeplogs en telefoonstatus</string>
<string name="telephony_optional_permission_explanation">Om een naam van een contactpersoon te zien in plaats van een telefoonnummer moet u toegang geven tot de contacten in uw telefoon</string>
@@ -399,8 +397,4 @@
<string name="send_clipboard">Klembord verzenden</string>
<string name="tap_to_execute">Tik om uit te voeren</string>
<string name="plugin_stats">Plug-in-statistieken</string>
<string name="enable_udp_broadcast">Ontdekken van UDP-apparaat inschakelen</string>
<string name="receive_notifications_permission_explanation">Meldingen moeten toegestaan worden om ze te ontvangen van andere apparaten</string>
<string name="findmyphone_notifications_explanation">Het recht op meldingen is nodig zodat de telefoon af kan gaan wanneer de toepassing in de achtergrond is</string>
<string name="no_notifications">Meldingen zijn uitgeschakeld, u zult inkomende paringmeldingen ontvangen.</string>
</resources>

View File

@@ -199,7 +199,6 @@
<item>1 minuta</item>
<item>2 minuti</item>
</string-array>
<string name="mpris_notifications_explanation">Dovoljenje za obvestila je potrebno za prikaz oddaljenih medijev v predalu za obvestila</string>
<string name="mpris_notification_settings_title">Pokaži obvestilo o nadzoru medija</string>
<string name="mpris_notification_settings_summary">Dovoli nadzor nad predvajalniki medijev, ne da bi odprli KDE Connect</string>
<string name="share_to">Deli z…</string>
@@ -269,7 +268,6 @@
<string name="optional_permission_explanation">Če želite omogočiti vse funkcije, morate podeliti dodatna dovoljenja</string>
<string name="plugins_need_optional_permission">Nekateri vtičniki imajo funkcije onemogočene zaradi pomanjkanja dovoljenj (tapnite za več informacij):</string>
<string name="share_optional_permission_explanation">Če želite prejemati datoteke, morate dovoliti dostop do hrambe</string>
<string name="share_notifications_explanation">Če želite videti napredek pri pošiljanju in prejemanju datotek, morate omogočiti obvestila</string>
<string name="telepathy_permission_explanation">Če želite brati in pisati SMS z namizja, morate izdati dovoljenje za SMS</string>
<string name="telephony_permission_explanation">Če želite videti telefonske klice na namizju, morate dati dovoljenje za dnevnike klicev in stanje telefona</string>
<string name="telephony_optional_permission_explanation">Če želite namesto telefonske številke videti ime stika, morate omogočiti dostop do stikov telefona</string>
@@ -415,8 +413,4 @@
<string name="send_clipboard">Pošlji odložišče</string>
<string name="tap_to_execute">Tapkajte za izvedbo</string>
<string name="plugin_stats">Stanje vtičnikov</string>
<string name="enable_udp_broadcast">Omogoči odkrivanje naprav UDP</string>
<string name="receive_notifications_permission_explanation">Morate imeti dovoljenje za obvestila, če jih želite sprejemati iz drugih naprav</string>
<string name="findmyphone_notifications_explanation">Potrebno je dovoljenje za obvestila, da lahko telefon zazvoni, ko je aplikacija v ozadju</string>
<string name="no_notifications">Obvestila so onemogočena, ne boste prejemali obvestil o dohodnih parih.</string>
</resources>

View File

@@ -183,7 +183,6 @@
<item>1 minut</item>
<item>2 minuter</item>
</string-array>
<string name="mpris_notifications_explanation">Underrättelserättigheter krävs för att visa fjärrmedia i underrättelselådan</string>
<string name="mpris_notification_settings_title">Visa underrättelser om mediastyrning</string>
<string name="mpris_notification_settings_summary">Tillåt att styra mediaspelare utan att KDE-anslut öppnas</string>
<string name="share_to">Dela med…</string>
@@ -253,7 +252,6 @@
<string name="optional_permission_explanation">Du måste ge extra rättigheter för att aktivera alla funktioner</string>
<string name="plugins_need_optional_permission">Vissa insticksprogram har inaktiverade funktioner på grund av att rättigheter saknas (rör för mer information):</string>
<string name="share_optional_permission_explanation">För att ta emot filer måste du tillåta lagringsåtkomst</string>
<string name="share_notifications_explanation">För att se förlopp när filer skickas och tas emot måste underrättelser tillåtas</string>
<string name="telepathy_permission_explanation">För att läsa och skriva SMS från skrivbordet måste du ge rättigheter för SMS</string>
<string name="telephony_permission_explanation">För att se telefonsamtal på skrivbordet måste du ge rättigheter för telefonsamtalsloggar och telefontillstånd</string>
<string name="telephony_optional_permission_explanation">För att se ett kontaktnamn istället för ett telefonnummer måste du ge tillgång till telefonens kontakter</string>
@@ -399,8 +397,4 @@
<string name="send_clipboard">Skicka klippbord</string>
<string name="tap_to_execute">Rör för att köra</string>
<string name="plugin_stats">Insticksprogramstatistik</string>
<string name="enable_udp_broadcast">Aktivera UDP-enhetsupptäckt</string>
<string name="receive_notifications_permission_explanation">Underrättelser måste vara tillåtna för att kunna ta emot dem från andra apparater</string>
<string name="findmyphone_notifications_explanation">Underrättelserättigheter krävs så att telefonen kan ringa när programmet är i bakgrunden</string>
<string name="no_notifications">Underrättelser är inaktiverade, så en underrättelse om inkommande begäran att para ihop inte tas emot.</string>
</resources>

View File

@@ -183,7 +183,6 @@
<item>1 dakika</item>
<item>2 dakika</item>
</string-array>
<string name="mpris_notifications_explanation">Bildirim izni, bildirim çekmecesinde uzak konum ortamını göstermek için gereklidir</string>
<string name="mpris_notification_settings_title">Ortam denetim bildirimini göster</string>
<string name="mpris_notification_settings_summary">KDE Bağlan\'ı açmadan ortam oynatıcılarınızı denetlemenize izin verin</string>
<string name="share_to">Paylaş…</string>
@@ -253,7 +252,6 @@
<string name="optional_permission_explanation">Tüm işlevleri etkinleştirmek için daha fazla yetkiye gereksiniminiz var</string>
<string name="plugins_need_optional_permission">Bazı eklentilerin özellikleri, izin yetersizliğinden kapalı gelmektedir (daha fazla bilgi için dokunun):</string>
<string name="share_optional_permission_explanation">Dosyalar almak için depolama erişimini etkinleştirmelisiniz</string>
<string name="share_notifications_explanation">Dosyalar alırken ve gönderirken ilerlemeyi görmek için bildirimlere izin vermeniz gerekir</string>
<string name="telepathy_permission_explanation">Masaüstünde SMS yazma ve okuma yapmak için SMS izni gereklidir</string>
<string name="telephony_permission_explanation">Masaüstünde telefon görüşmelerini görmek için telefon görüşmesi kayıtlarına ve telefon durumuna izin vermeniz gerekir</string>
<string name="telephony_optional_permission_explanation">Telefon numarası yerine kişi adı görebilmek için telefonun kişilerine erişim gereklidir</string>
@@ -271,7 +269,7 @@
<string name="addcommand_explanation">Kayıtlı komut yok</string>
<string name="addcommand_explanation2">KDE Bağlan Sistem Ayarlarında yeni komutlar ekleyebilirsiniz</string>
<string name="add_command_description">Masaüstüne komut ekleyebilirsiniz</string>
<string name="pref_plugin_mprisreceiver">Ortam Oynatıcısı Denetimi</string>
<string name="pref_plugin_mprisreceiver">Ortam Oynatıcı Denetimi</string>
<string name="pref_plugin_mprisreceiver_desc">Telefonunuzun ortam oynatıcılarını başka bir aygıttan denetleyin</string>
<string name="notification_channel_default">Diğer bildirimler</string>
<string name="notification_channel_persistent">Kalıcı gösterge</string>
@@ -399,8 +397,4 @@
<string name="send_clipboard">Pano gönder</string>
<string name="tap_to_execute">Yürütmek için dokun</string>
<string name="plugin_stats">Eklenti istatistikleri</string>
<string name="enable_udp_broadcast">UDP aygıt keşfini etkinleştir</string>
<string name="receive_notifications_permission_explanation">Başka aygıtlardan gelen bildirimleri alabilmek için bildirimlere izin verilmesi gereklidir</string>
<string name="findmyphone_notifications_explanation">Uygulama arka plandayken telefonun çalabilmesi için bildirim izni gereklidir</string>
<string name="no_notifications">Bildirimler devre dışı; herhangi bir gelen eş bildirimi almayacaksınız.</string>
</resources>

View File

@@ -199,7 +199,6 @@
<item>1 хвилина</item>
<item>2 хвилини</item>
</string-array>
<string name="mpris_notifications_explanation">Для показу віддалених носіїв даних на панелі сповіщень потрібні права доступу до сповіщень</string>
<string name="mpris_notification_settings_title">Показувати сповіщення щодо керування відтворенням</string>
<string name="mpris_notification_settings_summary">Уможливлює керування відтворенням мультимедійних даних без відкриття KDE Connect</string>
<string name="share_to">Використовувати спільно з…</string>
@@ -269,7 +268,6 @@
<string name="optional_permission_explanation">Щоб уможливити використання усіх функцій, вам слід надати програмі додаткові права доступу</string>
<string name="plugins_need_optional_permission">Можливості деяких додатків вимкнено, оскільки програмі не вистачає прав доступу (натисніть, щоб дізнатися більше):</string>
<string name="share_optional_permission_explanation">Для отримання файлів вам слід дозволити доступ до сховища даних</string>
<string name="share_notifications_explanation">Для перегляду поступу надсилання та отримання файлів вам слід уможливити показ сповіщень</string>
<string name="telepathy_permission_explanation">Щоб читати і писати SMS з вашого робочого комп’ютера, вам слід надати програмі доступ до SMS</string>
<string name="telephony_permission_explanation">Щоб переглядати дзвінки з робочого комп’ютера, вам слід надати програмі доступ до журналу дзвінків та стану телефону</string>
<string name="telephony_optional_permission_explanation">Щоб бачити ім’я контакту замість номеру телефону, вам слід надати програмі доступ до записів контактів на телефоні</string>
@@ -415,8 +413,4 @@
<string name="send_clipboard">Надіслати вміст буфера</string>
<string name="tap_to_execute">Торкніться, щоб виконати</string>
<string name="plugin_stats">Статистика щодо додатків</string>
<string name="enable_udp_broadcast">Увімкнути виявлення пристроїв UDP</string>
<string name="receive_notifications_permission_explanation">Для отримання сповіщень з інших пристроїв має бути уможливлено показ сповіщень</string>
<string name="findmyphone_notifications_explanation">Для уможливлення дзвінків, коли програма перебуває у фоновому режимі, потрібні права доступу до сповіщень</string>
<string name="no_notifications">Показ сповіщень вимкнено, ви не отримуватимете сповіщень щодо вхідних запитів на пов\'язування пристроїв.</string>
</resources>

View File

@@ -65,7 +65,7 @@
<string-array name="mousepad_tap_entries">
<item>左键点击</item>
<item>右键点击</item>
<item>中键点击</item>
<item>键点击</item>
<item>无操作</item>
</string-array>
<string-array name="mousepad_sensitivity_entries">
@@ -389,5 +389,4 @@
<string name="send_clipboard">发送剪贴板</string>
<string name="tap_to_execute">轻触执行</string>
<string name="plugin_stats">插件状态</string>
<string name="enable_udp_broadcast">启用 UPnP 设备发现</string>
</resources>

View File

@@ -6,10 +6,7 @@
package org.kde.kdeconnect.Backends;
import android.net.Network;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import java.util.concurrent.CopyOnWriteArrayList;
@@ -52,7 +49,7 @@ public abstract class BaseLinkProvider {
public abstract void onStart();
public abstract void onStop();
public abstract void onNetworkChange(@Nullable Network network);
public abstract void onNetworkChange();
public abstract String getName();
}

View File

@@ -14,13 +14,10 @@ import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.Network;
import android.os.Parcelable;
import android.util.Base64;
import android.util.Log;
import androidx.annotation.Nullable;
import org.apache.commons.io.IOUtils;
import org.kde.kdeconnect.Backends.BaseLinkProvider;
import org.kde.kdeconnect.Device;
@@ -110,7 +107,7 @@ public class BluetoothLinkProvider extends BaseLinkProvider {
}
@Override
public void onNetworkChange(@Nullable Network network) {
public void onNetworkChange() {
onStop();
onStart();
}

View File

@@ -8,12 +8,9 @@ package org.kde.kdeconnect.Backends.LanBackend;
import android.content.Context;
import android.content.SharedPreferences;
import android.net.Network;
import android.os.Build;
import android.preference.PreferenceManager;
import android.util.Log;
import androidx.annotation.Nullable;
import androidx.annotation.WorkerThread;
import org.json.JSONException;
@@ -72,7 +69,7 @@ public class LanLinkProvider extends BaseLinkProvider {
private final Context context;
private final HashMap<String, LanLink> visibleDevices = new HashMap<>(); // Links by device id
private final HashMap<String, LanLink> visibleDevices = new HashMap<>(); //Links by device id
final ConcurrentHashMap<String, Long> lastConnectionTime = new ConcurrentHashMap<>();
@@ -300,7 +297,7 @@ public class LanLinkProvider extends BaseLinkProvider {
});
} catch (IOException e) {
Log.e("LanLinkProvider", "UdpReceive exception", e);
onNetworkChange(null); // Trigger a UDP broadcast to try to get them to connect to us instead
onNetworkChange(); // Trigger a UDP broadcast to try to get them to connect to us instead
}
}
Log.w("UdpListener", "Stopping UDP listener");
@@ -354,7 +351,12 @@ public class LanLinkProvider extends BaseLinkProvider {
throw new RuntimeException("This should not be reachable");
}
private void broadcastUdpIdentityPacket(@Nullable Network network) {
private void broadcastUdpIdentityPacket() {
if (System.currentTimeMillis() < lastBroadcast + delayBetweenBroadcasts) {
Log.i("LanLinkProvider", "broadcastUdpPacket: relax cowboy");
return;
}
lastBroadcast = System.currentTimeMillis();
ThreadHelper.execute(() -> {
List<String> ipStringList = CustomDevicesActivity
@@ -379,12 +381,12 @@ public class LanLinkProvider extends BaseLinkProvider {
return;
}
sendUdpIdentityPacket(ipList, network);
sendUdpIdentityPacket(ipList);
});
}
@WorkerThread
public void sendUdpIdentityPacket(List<InetAddress> ipList, @Nullable Network network) {
public void sendUdpIdentityPacket(List<InetAddress> ipList) {
if (tcpServer == null || !tcpServer.isBound()) {
Log.i("LanLinkProvider", "Won't broadcast UDP packet if TCP socket is not ready yet");
return;
@@ -405,14 +407,6 @@ public class LanLinkProvider extends BaseLinkProvider {
DatagramSocket socket;
try {
socket = new DatagramSocket();
if (network != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1) {
try {
network.bindSocket(socket);
} catch (IOException e) {
Log.w("LanLinkProvider", "Couldn't bind socket to the network");
e.printStackTrace();
}
}
socket.setReuseAddress(true);
socket.setBroadcast(true);
} catch (SocketException e) {
@@ -442,19 +436,13 @@ public class LanLinkProvider extends BaseLinkProvider {
setupUdpListener();
setupTcpListener();
broadcastUdpIdentityPacket(null);
broadcastUdpIdentityPacket();
}
}
@Override
public void onNetworkChange(@Nullable Network network) {
if (System.currentTimeMillis() < lastBroadcast + delayBetweenBroadcasts) {
Log.i("LanLinkProvider", "onNetworkChange: relax cowboy");
return;
}
lastBroadcast = System.currentTimeMillis();
broadcastUdpIdentityPacket(network);
public void onNetworkChange() {
broadcastUdpIdentityPacket();
}
@Override

View File

@@ -7,9 +7,6 @@
package org.kde.kdeconnect.Backends.LoopbackBackend;
import android.content.Context;
import android.net.Network;
import androidx.annotation.Nullable;
import org.kde.kdeconnect.Backends.BaseLinkProvider;
@@ -23,7 +20,7 @@ public class LoopbackLinkProvider extends BaseLinkProvider {
@Override
public void onStart() {
onNetworkChange(null);
onNetworkChange();
}
@Override
@@ -31,7 +28,7 @@ public class LoopbackLinkProvider extends BaseLinkProvider {
}
@Override
public void onNetworkChange(@Nullable Network network) {
public void onNetworkChange() {
LoopbackLink link = new LoopbackLink(context, this);
onConnectionReceived(link);
}

View File

@@ -25,7 +25,6 @@ import android.os.IBinder;
import android.text.TextUtils;
import android.util.Log;
import androidx.annotation.Nullable;
import androidx.core.app.NotificationCompat;
import androidx.core.content.ContextCompat;
import androidx.lifecycle.LiveData;
@@ -33,6 +32,7 @@ import androidx.lifecycle.MutableLiveData;
import org.kde.kdeconnect.Backends.BaseLinkProvider;
import org.kde.kdeconnect.Backends.LanBackend.LanLinkProvider;
import org.kde.kdeconnect.Backends.LoopbackBackend.LoopbackLinkProvider;
import org.kde.kdeconnect.Helpers.NotificationHelper;
import org.kde.kdeconnect.Plugins.ClibpoardPlugin.ClipboardFloatingActivity;
import org.kde.kdeconnect.Plugins.RunCommandPlugin.RunCommandActivity;
@@ -81,18 +81,18 @@ public class BackgroundService extends Service {
private void registerLinkProviders() {
linkProviders.add(new LanLinkProvider(this));
// linkProviders.add(new LoopbackLinkProvider(this));
linkProviders.add(new LoopbackLinkProvider(this));
// linkProviders.add(new BluetoothLinkProvider(this));
}
public void onNetworkChange(@Nullable Network network) {
public void onNetworkChange() {
if (!initialized) {
Log.d("KDE/BackgroundService", "ignoring onNetworkChange called before the service is initialized");
return;
}
Log.d("KDE/BackgroundService", "onNetworkChange");
for (BaseLinkProvider a : linkProviders) {
a.onNetworkChange(network);
a.onNetworkChange();
}
}
@@ -131,13 +131,11 @@ public class BackgroundService extends Service {
cm.registerNetworkCallback(networkRequestBuilder.build(), new ConnectivityManager.NetworkCallback() {
@Override
public void onAvailable(Network network) {
Log.i("BackgroundService", "Valid network available");
connectedToNonCellularNetwork.postValue(true);
onNetworkChange(network);
onNetworkChange();
}
@Override
public void onLost(Network network) {
Log.i("BackgroundService", "Valid network lost");
connectedToNonCellularNetwork.postValue(false);
}
});
@@ -270,6 +268,14 @@ public class BackgroundService extends Service {
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
Log.d("KDE/BackgroundService", "onStartCommand");
postForegroundNotification();
if (intent != null && intent.getBooleanExtra("refresh", false)) {
onNetworkChange();
}
return Service.START_STICKY;
}
public void postForegroundNotification() {
if (NotificationHelper.isPersistentNotificationEnabled(this)) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
startForeground(FOREGROUND_NOTIFICATION_ID, createForegroundNotification(), ServiceInfo.FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE);
@@ -277,10 +283,6 @@ public class BackgroundService extends Service {
startForeground(FOREGROUND_NOTIFICATION_ID, createForegroundNotification());
}
}
if (intent != null && intent.getBooleanExtra("refresh", false)) {
onNetworkChange(null);
}
return Service.START_STICKY;
}
public static void Start(Context context) {

View File

@@ -1,58 +0,0 @@
/*
* SPDX-FileCopyrightText: 2023 Albert Vaca Cintora <albertvaka@gmail.com>
*
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
*/
package org.kde.kdeconnect.Helpers
import java.net.Inet4Address
import java.net.InetAddress
import java.net.NetworkInterface
import java.net.SocketException
object NetworkHelper {
//Prefer IPv4 over IPv6, because sshfs doesn't seem to like IPv6
// Anything with rmnet is related to cellular connections or USB
// tethering mechanisms. See:
//
// https://android.googlesource.com/kernel/msm/+/android-msm-flo-3.4-kitkat-mr1/Documentation/usb/gadget_rmnet.txt
//
// If we run across an interface that has this, we can safely
// ignore it. In fact, it's much safer to do. If we don't, we
// might get invalid IP adddresses out of it.
@JvmStatic
val localIpAddress: InetAddress?
get() {
var ip6: InetAddress? = null
try {
for (intf in NetworkInterface.getNetworkInterfaces()) {
// Anything with rmnet is related to cellular connections or USB
// tethering mechanisms. See:
//
// https://android.googlesource.com/kernel/msm/+/android-msm-flo-3.4-kitkat-mr1/Documentation/usb/gadget_rmnet.txt
//
// If we run across an interface that has this, we can safely
// ignore it. In fact, it's much safer to do. If we don't, we
// might get invalid IP adddresses out of it.
if (intf.displayName.contains("rmnet")) {
continue
}
val enumIpAddr = intf.inetAddresses
while (enumIpAddr.hasMoreElements()) {
val inetAddress = enumIpAddr.nextElement()
if (!inetAddress.isLoopbackAddress) {
ip6 =
if (inetAddress is Inet4Address) { //Prefer IPv4 over IPv6, because sshfs doesn't seem to like IPv6
return inetAddress
} else {
inetAddress
}
}
}
}
} catch (ignored: SocketException) {
}
return ip6
}
}

View File

@@ -42,12 +42,7 @@ public class KdeConnectBroadcastReceiver extends BroadcastReceiver {
BackgroundService.ForceRefreshConnections(context);
break;
case Intent.ACTION_SCREEN_ON:
try {
BackgroundService.ForceRefreshConnections(context);
} catch (IllegalStateException e) { // To catch ForegroundServiceStartNotAllowedException
Log.w("BroadcastReceiver", "Couldn't start the foreground service.");
e.printStackTrace();
}
BackgroundService.ForceRefreshConnections(context);
break;
default:
Log.i("BroadcastReceiver", "Ignoring broadcast event: " + intent.getAction());

View File

@@ -20,7 +20,6 @@ import androidx.annotation.NonNull;
import org.json.JSONException;
import org.json.JSONObject;
import org.kde.kdeconnect.Helpers.NetworkHelper;
import org.kde.kdeconnect.NetworkPacket;
import org.kde.kdeconnect.Plugins.Plugin;
import org.kde.kdeconnect.Plugins.PluginFactory;
@@ -148,7 +147,7 @@ public class SftpPlugin extends Plugin implements SharedPreferences.OnSharedPref
NetworkPacket np2 = new NetworkPacket(PACKET_TYPE_SFTP);
np2.set("ip", NetworkHelper.getLocalIpAddress().getHostAddress());
np2.set("ip", server.getLocalIpAddress()); // for backwards compatibility
np2.set("port", server.getPort());
np2.set("user", SimpleSftpServer.USER);
np2.set("password", server.getPassword());

View File

@@ -26,12 +26,17 @@ import org.kde.kdeconnect.Helpers.RandomHelper;
import org.kde.kdeconnect.Helpers.SecurityHelpers.RsaHelper;
import java.io.IOException;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.security.GeneralSecurityException;
import java.security.KeyPair;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.util.Arrays;
import java.util.Collections;
import java.util.Enumeration;
import java.util.List;
class SimpleSftpServer {
@@ -140,6 +145,39 @@ class SimpleSftpServer {
return port;
}
String getLocalIpAddress() {
String ip6 = null;
try {
for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements(); ) {
NetworkInterface intf = en.nextElement();
// Anything with rmnet is related to cellular connections or USB
// tethering mechanisms. See:
//
// https://android.googlesource.com/kernel/msm/+/android-msm-flo-3.4-kitkat-mr1/Documentation/usb/gadget_rmnet.txt
//
// If we run across an interface that has this, we can safely
// ignore it. In fact, it's much safer to do. If we don't, we
// might get invalid IP adddresses out of it.
if (intf.getDisplayName().contains("rmnet")) continue;
for (Enumeration<InetAddress> enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements(); ) {
InetAddress inetAddress = enumIpAddr.nextElement();
if (!inetAddress.isLoopbackAddress()) {
String address = inetAddress.getHostAddress();
if (inetAddress instanceof Inet4Address) { //Prefer IPv4 over IPv6, because sshfs doesn't seem to like IPv6
return address;
} else {
ip6 = address;
}
}
}
}
} catch (SocketException ignored) {
}
return ip6;
}
public boolean isInitialized() {
return initialized;
}

View File

@@ -30,8 +30,6 @@ public class SectionItem implements ListAdapter.Item {
//Make it not selectable
binding.getRoot().setOnClickListener(null);
binding.getRoot().setOnLongClickListener(null);
binding.getRoot().setFocusable(false);
binding.getRoot().setClickable(false);
binding.listItemCategoryText.setText(title);

View File

@@ -329,7 +329,7 @@ class MainActivity : AppCompatActivity(), OnSharedPreferenceChangeListener {
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
when {
requestCode == RESULT_NEEDS_RELOAD -> {
KdeConnect.getInstance().devices.values.forEach(Device::reloadPluginsFromSettings)
KdeConnect.getInstance().getDevice(mCurrentDevice)?.reloadPluginsFromSettings()
}
requestCode == STORAGE_LOCATION_CONFIGURED && resultCode == RESULT_OK && data != null -> {
val uri = data.data
@@ -363,11 +363,11 @@ class MainActivity : AppCompatActivity(), OnSharedPreferenceChangeListener {
}
//New permission granted, reload plugins
KdeConnect.getInstance().devices.values.forEach(Device::reloadPluginsFromSettings)
KdeConnect.getInstance().getDevice(mCurrentDevice)?.reloadPluginsFromSettings()
}
}
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String?) {
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String) {
if (DeviceHelper.KEY_DEVICE_NAME_PREFERENCE == key) {
mNavViewDeviceName.text = DeviceHelper.getDeviceName(this)
BackgroundService.ForceRefreshConnections(this) //Re-send our identity packet

View File

@@ -6,7 +6,13 @@
package org.kde.kdeconnect.UserInterface;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Bundle;
import android.provider.Settings;
import androidx.annotation.Nullable;
import androidx.core.app.ActivityCompat;
@@ -14,6 +20,7 @@ import androidx.core.app.ActivityCompat;
import org.kde.kdeconnect_tp.R;
public class PermissionsAlertDialogFragment extends AlertDialogFragment {
private static final String KEY_PERMANENTLY_DENIED_PREFERENCES = "permanently_denied_permissions";
private static final String KEY_PERMISSIONS = "Permissions";
private static final String KEY_REQUEST_CODE = "RequestCode";
@@ -23,6 +30,18 @@ public class PermissionsAlertDialogFragment extends AlertDialogFragment {
public PermissionsAlertDialogFragment() {
}
public static void PermissionsDenied(Activity activity, String[] permissions) {
for (String permission : permissions) {
if (!ActivityCompat.shouldShowRequestPermissionRationale(activity, permission)) {
// The user selected "don't show again" or denied the permission twice, so the
// system permission dialog won't show again. We want to remember this to open the
// app preferences instead the next time
SharedPreferences prefs = activity.getSharedPreferences(KEY_PERMANENTLY_DENIED_PREFERENCES, Context.MODE_PRIVATE);
prefs.edit().putBoolean(permission, true).apply();
}
}
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -36,11 +55,28 @@ public class PermissionsAlertDialogFragment extends AlertDialogFragment {
permissions = args.getStringArray(KEY_PERMISSIONS);
requestCode = args.getInt(KEY_REQUEST_CODE, 0);
setCallback(new Callback() {
@Override
public void onPositiveButtonClicked() {
SharedPreferences prefs = getContext().getSharedPreferences(KEY_PERMANENTLY_DENIED_PREFERENCES, Context.MODE_PRIVATE);
boolean permanentlyDenied = false;
for (String permission : permissions) {
if (prefs.getBoolean(permission, false)) {
permanentlyDenied = true;
break;
}
}
if (permanentlyDenied) {
Intent intent = new Intent();
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
Uri uri = Uri.fromParts("package", getContext().getPackageName(), null);
intent.setData(uri);
startActivity(intent);
} else {
ActivityCompat.requestPermissions(requireActivity(), permissions, requestCode);
}
}
});
}

View File

@@ -150,7 +150,7 @@ public class PluginSettingsActivity
finish();
}
public String getSettingsDeviceId() { // Weird name because Activity also has a getDeviceId()
public String getDeviceId() {
return deviceId;
}
}

View File

@@ -82,7 +82,7 @@ public class PluginSettingsFragment extends PreferenceFragmentCompat {
}
public String getDeviceId() {
return ((PluginSettingsActivity)requireActivity()).getSettingsDeviceId();
return ((PluginSettingsActivity)requireActivity()).getDeviceId();
}
}

View File

@@ -37,8 +37,6 @@ import org.kde.kdeconnect_tp.R;
public class SettingsFragment extends PreferenceFragmentCompat {
public static final String KEY_APP_THEME = "theme_pref";
private EditTextPreference renameDevice;
@NonNull
@@ -92,7 +90,7 @@ public class SettingsFragment extends PreferenceFragmentCompat {
// Theme Selector
ListPreference themeSelector = new ListPreference(context);
themeSelector.setKey(KEY_APP_THEME);
themeSelector.setKey("theme_pref");
themeSelector.setTitle(R.string.theme_dialog_title);
themeSelector.setDialogTitle(R.string.theme_dialog_title);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
@@ -180,5 +178,7 @@ public class SettingsFragment extends PreferenceFragmentCompat {
screen.addPreference(moreSettingsText);
setPreferenceScreen(screen);
}
}