Bug 501241 - Issue with connection between two Android phones on version 1.33.1
Summary: Issue with connection between two Android phones on version 1.33.1
Status: RESOLVED FIXED
Alias: None
Product: kdeconnect
Classification: Applications
Component: android-application (show other bugs)
Version: unspecified
Platform: Android Android 14.x
: NOR normal
Target Milestone: ---
Assignee: Albert Vaca Cintora
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-08 22:11 UTC by Matej
Modified: 2025-03-14 11:44 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Logs created during try connect KDE connect Android phones (277.67 KB, application/zip)
2025-03-09 15:13 UTC, Matej
Details
connection exception (3.93 KB, text/plain)
2025-03-10 10:06 UTC, Albert Vaca Cintora
Details
Logs created during try connect KDE connect Android phones (313.85 KB, application/zip)
2025-03-13 12:42 UTC, Matej
Details
I add log from Android 10 in attachment. (615.62 KB, application/zip)
2025-03-14 11:21 UTC, Matej
Details
Android 10 second log, only one device was visible and connected. Other Android devices was not visible in Android 10. (616.04 KB, application/zip)
2025-03-14 11:32 UTC, Matej
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matej 2025-03-08 22:11:00 UTC
Dear developers.
Can you please repair?

Critical error.
Connection is no possible on version 1.33.1
On version 1.32.11 all work correct.

Testing connection on my phones:
Samsung Galaxy Android 14
Honor with Android 7

Thank you very much
Comment 1 Albert Vaca Cintora 2025-03-09 13:04:48 UTC
I can't reproduce the issue issue, can you provide logs? Here you have a couple options to get them:

- https://developer.android.com/tools/logcat (to access them from your PC over USB, you will need to enable developer mode in your phone)
- https://f-droid.org/en/packages/com.dp.logcatapp/ (to access them from your phone)
Comment 2 Albert Vaca Cintora 2025-03-09 13:05:08 UTC
.
Comment 3 Matej 2025-03-09 15:13:17 UTC
Created attachment 179247 [details]
Logs created during try connect KDE connect Android phones

Thank you very much for your answer, Albert.

I am sorry, I am not programmer, and I created log first time in my life. I am not sure whether it is OK.
I used this guide. 
https://stackoverflow.com/questions/70318755/software-to-show-android-logcat

I am not removed limitations from me terminal (max number of characters). 
If you need, I can create without limitation. 
I  add txt files in the attachment.

Logs created during try connect KDE connect Android phones
Comment 4 Albert Vaca Cintora 2025-03-09 23:18:57 UTC
Hey, thanks for sending those logs, it is what I need but unfortunately there's nothing from KDE Connect there. If you can capture them again, but do it right after opening the KDE Connect app and refreshing a couple times (for it to try to connect) so hopefully you can capture the error. Just from one phone should be enough. Thanks again for your help!
Comment 5 Matej 2025-03-10 09:00:43 UTC
Thank you Albert,
I created file based on Linux Ubuntu and Android USB cable connection.
TXT file is 41 MB. You can find log here on mega.nz cloud
https://mega.nz/file/Nnwm1Q4J#u6UjofwGdtyT8RljU-EjWERHbMYcCa9cFmdRnaC8sSE
It is without terminal characters limitation.

I fully closed KDE connect (closed on background too) and then open again. 
Turn off Wifi connection on short time. (Main time is Wifi turn on, of course)

I used this command: 
adb shell logcat

Is it OK?

Of you have any better command for me terminal (for example with any filter), send me.
Comment 6 Albert Vaca Cintora 2025-03-10 10:06:22 UTC
Created attachment 179256 [details]
connection exception

That's great, I could extract the error (attached).
Comment 7 Albert Vaca Cintora 2025-03-10 10:18:53 UTC
I'm not sure what the exact problem is, but I've tried to implement a fix and built a new version: https://mega.nz/file/XJcHlBCA#EfnEL5Pu8VMPjGsZbKNYUfmH0Nx0GxtTG9230CVmf3w

Can you try it and let me know if it works?
Comment 8 Matej 2025-03-10 12:35:56 UTC
I created this log from Samsung  Android 13 phone and I tried connect with Android 7 phone.
On both phones I was installed version of KDE connect from mega.nz link
Unfortunately, the same issue with connection. Phones was not connected

https://mega.nz/file/9vYBlT6S#j5-ZQQHmQ74XD3CFIWaclcW3pfnukxUDkHZ_hNoGdXY
Comment 9 Albert Vaca Cintora 2025-03-11 16:14:26 UTC
I found and fixed the problem, I'll make a new release now (which might take a couple days to arrive to the stores). Thanks for your help debugging this :D
Comment 10 Albert Vaca Cintora 2025-03-11 16:23:41 UTC
Git commit 69adfbfbc2459c08bd5aebf10c86b953c649af2f by Albert Vaca Cintora.
Committed on 11/03/2025 at 16:14.
Pushed by albertvaka into branch 'master'.

Do the kdeconnect handshake in a new thread

Some Android versions seem to hang if calling sslSocket.getOutputStream()
from within the HandshakeCompleted callback (maybe because calling it in
on a socket that hasn't finished the SSL handshake is supposed to trigger
the SSL handshake).

M  +32   -29   src/org/kde/kdeconnect/Backends/LanBackend/LanLinkProvider.java

https://invent.kde.org/network/kdeconnect-android/-/commit/69adfbfbc2459c08bd5aebf10c86b953c649af2f
Comment 11 Matej 2025-03-12 08:11:57 UTC
Thank you very much, Albert, for your development too :)
Comment 12 Matej 2025-03-13 12:42:05 UTC
Created attachment 179369 [details]
Logs created during try connect KDE connect Android phones

Thank you very much Albert for your work.

I am now tested it. Version 1.33.2 works correct between my Android 13 and Android 14.

Your version from mega.nz work correct between my Android 13 and Android 14 correct too.

But it these two KDE connect versions not work correct between Android 7 and newer versions Android phones
Comment 13 Matej 2025-03-13 12:43:15 UTC
Logs from Android 7 is in attachment in previous comment.
Comment 14 Matej 2025-03-14 11:21:07 UTC
Created attachment 179387 [details]
I add log from Android 10 in attachment.

I add log from Android 10 in attachment.

Thank you very much for repair.
Based my phones, based my testings, latest version works correct on Android versions  13 and 14. Thank you very much for repair!

But on Android 7 and Android 10 not work correct.
Comment 15 Matej 2025-03-14 11:32:51 UTC
Created attachment 179389 [details]
Android 10 second log, only one device was visible and connected. Other Android devices was not visible in Android 10.

Android 10 second log, only one device was visible and connected. Other Android devices was not visible in Android 10.
More info in attachment
Comment 16 Matej 2025-03-14 11:44:17 UTC
After some complications I connected successfully Android 10 With Android 13 and 14.
It is all OK.

Only Android 7 not works correct. Other versions are OK