Bug 402102 - Unable to send files from smartphone to desktop
Summary: Unable to send files from smartphone to desktop
Status: RESOLVED FIXED
Alias: None
Product: kdeconnect
Classification: Applications
Component: common (show other bugs)
Version: 1.3.3
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Albert Vaca Cintora
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-13 17:53 UTC by Francisco Gonzalez
Modified: 2018-12-15 02:32 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Francisco Gonzalez 2018-12-13 17:53:44 UTC
SUMMARY
This only happens with one smartphone (XIAOMI A2) with Android One
version 8.1.0 and kdeconnectd. 


It is not possible to send files from the smartphone to the desktop.
The notification system also do not work due to the same problem (it tries
to download the icon file and the job never finishes nor produce an error).

The problem appears when running "filetranferjob.cpp" code:

<code>
if (m_origin->bytesAvailable())
  startTransfer();
connect(m_origin.data(), &QIODevice::readyRead, this,
          &FileTransferJob::startTransfer);
bytesAvailabe are 0
and FileTransferJob::startTransfer is never called.

With gsconnect both file transfer and indications works as expected.
I have also tried Kde-Neon with the same result.
I have also tried the git kdeconnect version on the desktop.


STEPS TO REPRODUCE
1. In the androidsmartphone app press send file 
2. Choose one file (do not matter the size or type).


OBSERVED RESULT
. After some time the smartphone report that the file could not be sent. The kde desktop shows the file downloading "forever".
With gnome and gsconnect the file is transfered correctly.

EXPECTED RESULT
The file is already transfered.

SOFTWARE/OS VERSIONS
Windows: 
MacOS: 
Linux/KDE Plasma: Archlinux with kde desktop updated
(available in About System)
KDE Plasma Version: 5.14.4
KDE Frameworks Version: 5.53
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Francisco Gonzalez 2018-12-15 00:51:15 UTC
The problem seems to be with the id of the phone. The id it sends is not the same as the CN (common name) of the SSL certificate that the smartphone sends.
When kdeconnect tries to open a QSslSocket to download the file the connection fails with the error: "The host name did not match any of the valid hosts for this certificate", so the file can not be downloaded.
I have tested other phones and de "id" and CN are the same.
How is it possible to be different on this phone?
Comment 2 Francisco Gonzalez 2018-12-15 01:03:02 UTC
This is the datagram received on UDP channel before pairing:
kdeconnect.core: Datagram  {"id":1544834411076,"type":"kdeconnect.identity","body":{"deviceId":"c3bedee7133dbc3a","deviceName":"gzmorell@mia2","protocolVersion":7,"deviceType":"phone","incomingCapabilities":["kdeconnect.sms.request_conversations","kdeconnect.telephony.request_mute","kdeconnect.telephony.request","kdeconnect.mpris","kdeconnect.notification","kdeconnect.sms.request_conversation","kdeconnect.findmyphone.request","kdeconnect.ping","kdeconnect.systemvolume","kdeconnect.notification.reply","kdeconnect.share.request","kdeconnect.sftp.request","kdeconnect.notification.request","kdeconnect.mousepad.request","kdeconnect.contacts.request_vcards_by_uid","kdeconnect.sms.request","kdeconnect.runcommand","kdeconnect.battery.request","kdeconnect.clipboard","kdeconnect.contacts.request_all_uids_timestamps"],"outgoingCapabilities":["kdeconnect.sms.messages","kdeconnect.telephony","kdeconnect.notification","kdeconnect.contacts.response_uids_timestamps","kdeconnect.findmyphone.request","kdeconnect.ping","kdeconnect.mousepad.keyboardstate","kdeconnect.share.request","kdeconnect.contacts.response_vcards","kdeconnect.notification.request","kdeconnect.mousepad.echo","kdeconnect.mousepad.request","kdeconnect.sftp","kdeconnect.runcommand.request","kdeconnect.mpris.request","kdeconnect.systemvolume.request","kdeconnect.battery","kdeconnect.clipboard"],"tcpPort":1716}}

And this is the certificate of the smartphone:

"Certificate:\n
    Data:\n
        Version: 3 (0x2)\n
        Serial Number: 1 (0x1)\n
        Signature Algorithm: sha256WithRSAEncryption\n
        Issuer: CN=ef03bd23be35246a, OU=KDE Connect, O=KDE\n
        Validity\n
            Not Before: Sep 11 10:30:35 2016 GMT\n
            Not After : Sep 11 10:30:35 2026 GMT\n
        Subject: CN=ef03bd23be35246a, OU=KDE Connect, O=KDE\n
        Subject Public Key Info:\n
            Public Key Algorithm: rsaEncryption\n
                RSA Public-Key: (2048 bit)\n
                Modulus:\n
                    00:98:68:eb:b7:f2:47:23:a6:43:1e:c8:a8:e9:5b:\n
                    64:89:95:0f:71:d3:6f:35:75:bd:bf:80:53:bd:12:\n
                    b0:1b:be:50:c4:a6:d7:ea:35:4a:19:c2:8d:16:a5:\n
                    6e:57:a3:7c:3a:92:b8:46:39:6e:4b:1c:d4:07:6c:\n
                    74:a2:a2:93:77:82:51:44:86:8c:be:f8:b2:f3:c3:\n
                    aa:ac:f4:50:a1:a0:67:54:31:7b:8a:b1:ec:97:0e:\n
                    68:e0:cc:29:6c:e6:1b:87:d8:4a:a6:d5:3d:78:75:\n
                    f7:ac:6c:66:8c:a0:75:1e:d1:29:68:c2:f4:c7:39:\n
                    47:9f:b9:f7:08:2a:ca:ec:96:27:91:80:78:64:d4:\n
                    82:b3:08:6a:ca:f4:52:95:ce:1b:da:96:20:82:58:\n
                    89:db:47:f3:4b:44:95:7d:75:1b:59:19:79:34:d7:\n
                    00:e4:29:1f:f6:27:65:c6:bf:2d:71:46:ed:7e:d2:\n
                    01:43:9c:52:cf:19:6d:90:c8:92:98:79:c3:d2:25:\n
                    88:da:41:db:8e:24:5f:12:8d:6f:8b:a7:e6:5d:65:\n
                    ce:7b:06:39:12:58:c8:c9:ef:7e:b3:f8:5d:15:bd:\n
                    72:97:ca:36:f0:17:1c:bd:14:be:a1:77:20:26:81:\n
                    da:3d:f9:d0:ec:6d:22:fa:e3:97:03:f5:5f:b9:03:\n
                    dd:1f\n
                Exponent: 65537 (0x10001)\n
    Signature Algorithm: sha256WithRSAEncryption\n
         8a:2e:11:7d:1c:d1:1c:f0:56:c1:50:3c:56:71:47:33:6a:70:\n
         f2:f8:49:54:d2:f2:8e:dd:0e:d0:ec:c4:ff:6a:b3:29:d8:7e:\n
         f8:c1:6c:31:01:b1:ba:09:3c:f6:cb:bf:e3:8e:48:16:86:6c:\n
         77:26:3e:7b:10:73:aa:25:50:a1:9c:5d:3b:32:b6:d5:c7:3a:\n
         23:b8:52:46:c5:d3:52:5e:d9:58:85:af:e1:2e:7f:9e:18:32:\n
         b4:c8:86:da:db:35:fd:bf:36:89:bc:21:d6:a3:81:ca:93:b1:\n
         a1:47:43:81:d1:29:72:69:b8:e4:65:37:97:6c:a1:ba:c0:73:\n
         23:2b:2d:78:41:6f:00:d7:50:b0:4c:6b:0a:22:d9:64:22:53:\n
         69:ca:dc:57:20:68:4d:96:a1:5f:a1:92:1f:5a:92:16:a8:14:\n
         48:62:17:40:75:ec:d4:3f:7e:0a:a1:ec:30:c1:2c:06:c8:9b:\n
         d6:8b:fe:d0:cc:4d:dd:d7:ce:61:5f:b5:6e:71:61:b6:96:8f:\n
         32:96:66:b1:11:30:31:17:b6:2e:07:9f:48:12:57:76:a1:9a:\n
         3a:70:0a:d6:2a:2d:2c:fe:ca:64:a5:c4:64:ab:42:dd:d0:d1:\n
         2e:0c:cb:a8:b3:47:30:b1:c3:40:a7:33:6f:11:11:54:9d:58:\n
         eb:ca:3d:8b\n

The "deviceId":"c3bedee7133dbc3a"
The CN=ef03bd23be35246a
Comment 3 Simon Redman 2018-12-15 01:16:40 UTC
Did you do anything strange while setting this phone up? For instance, did you restore KDE Connect from a backup or similar?

Have you tried clearing the app data on the Android? Does this resolve the problem?
Comment 4 Francisco Gonzalez 2018-12-15 02:32:12 UTC
Ok problem solved. Android was restoring settings from the auto-save feature.
The settings were from an old phone.
To solve the issue I have disabled the auto restore settings from auto-save.
Removing the app, cache and data were not enough, as Android will recover
the data from your account if the featue is enabled.