Troubleshoot SD-card access issue

Andy Holmes andrew.g.r.holmes at gmail.com
Sun Apr 15 19:52:32 UTC 2018


I'm not quite sure which debugger you're referring to, or what exactly
you mean by entry point, but here's a rundown of what happens:

1) Desktop sends 'startBrowsing' packet as described above
2) Android app receives packet:
    https://github.com/KDE/kdeconnect-android/blob/master/src/org/kde/kdeconnect/Plugins/SftpPlugin/SftpPlugin.java#L67
    a) if the server has not already started, it is started, a
password is generated and a port opened:
        https://github.com/KDE/kdeconnect-android/blob/master/src/org/kde/kdeconnect/Plugins/SftpPlugin/SimpleSftpServer.java#L104
    b) Plugin reads password/port from server (regardless of whether
this is the first request) into the packet:
        https://github.com/KDE/kdeconnect-android/blob/master/src/org/kde/kdeconnect/Plugins/SftpPlugin/SftpPlugin.java#L72-L75
    c) Paths are determined and attached to the packet:
        https://github.com/KDE/kdeconnect-android/blob/master/src/org/kde/kdeconnect/Plugins/SftpPlugin/SftpPlugin.java#L84-L122
    d) Android app sends response packet to Desktop:
        https://github.com/KDE/kdeconnect-android/blob/master/src/org/kde/kdeconnect/Plugins/SftpPlugin/SftpPlugin.java#L124
3) Desktop receives response packet:
    https://github.com/KDE/kdeconnect-kde/blob/master/plugins/sftp/sftpplugin.cpp#L128-L151

And so on...I'm a bit unclear on exactly what you're asking, but you
can follow the process fairly easily (I don't even know C++ or Java
myself). Basically the Desktop tells the Android app it wants to
browse. The android app start a ssh server and responds with the
connect information. The desktop starts a sshfs process using that
information, and that's it.

As far as the SSH server goes it should all be in:

https://github.com/KDE/kdeconnect-android/blob/master/src/org/kde/kdeconnect/Plugins/SftpPlugin/SimpleSftpServer.java

Regards,
Andy

On Sun, Apr 15, 2018 at 10:45 AM,  <karl-heinz-1950 at web.de> wrote:
> Thanks, a good start.
>
>> Question 2: I am looking for the piece of code which is executed first on the phone when I click on that device in Dolphin. I assume it is somewhere in the Apache sshd. In other words, who is the first person touching that JSON?
>
>> Packet being handled (after being routed to the plugin):
>> https://github.com/KDE/kdeconnect-android/blob/master/src/org/kde/kdeconnect/Plugins/SftpPlugin/SftpPlugin.java#L65
>
> You refer to method onPacketReceived. If I haven't made a mistake I would claim that the onPacketReceived method is only called when I click the very first time in Dolphin on the device. When I navigate back to my home drive (or any other PC local drive) and then go back to the phone device in Dolphin I don't see that onPacketReceived is being called again. I see in the debugger that all kind of other code is being executed, so the second time the directories are being displayed in Dolphin it is not taken from some local cache in KDE.
>
> I assume that means there must be an earlier entry point in the android app. Should the kde connect app receive the same JSON message with startBrowsing true in the second access?
>
>


More information about the KDEConnect mailing list