Troubleshoot SD-card access issue
Andy Holmes
andrew.g.r.holmes at gmail.com
Wed Apr 18 20:18:58 UTC 2018
> Still looking for an open source ssh server for Android to verify how they handle it internally.
Here's one that looks like it uses SAF: https://github.com/wolpi/prim-ftpd
> But I am 120% sure that if on Android we use the native methods (SAF) then it works fine...
Probably using SAF would work better, but it would require raising the
minimum SDK to 19, which is something Albert et al. usually prefer to
avoid. Although if you wrote up a proof of concept that would probably
go a long way.
If the only problem is with .android_secure or unwritable files, it
would probably be a lot less work just to add an exception clause that
would exclude those in SimpleSftpServer.java.
> we just need to report then back in some kde connect JSON what to display in Dolphin.
Dolphin just opens the local directory where sshfs mounts the remote
device; no additional communication regarding the remote files is sent
via kdeconnect.sftp.* packets, and certainly not to Dolphin directly.
The only directories explicitly sent in the JSON packet are really
just convenience "shortcuts" relative to the mount point.
I'll sign off from the thread from here on, since I've reached the
limit of what I understand of this issue, but best of luck it's always
good see more people interested in the project!
On Wed, Apr 18, 2018 at 12:12 PM, <karl-heinz-1950 at web.de> wrote:
>
>> My understanding of .android_secure is that it's used to store files
>> from another place in the internal storage (eg, App2SD) and shouldn't
>> be accessed by way of the SD card at all.
>
> First of all be careful with the term internal storage, an SD card in Android terms can be internal storage. Internal refers to "internal for the app / cannot be accessed by other apps". Saying that I would most likely agree that others don't have access to that folder. So hiding this folder is fine for me, or showing it with permission denied as well. At the moment is simply behaves wrong, it doesn't show any files on the _same_ level as .android_secure, so I don't even want to look into .android_secure. This is due because sshd reports that .android_secure is not a file and then doesn't continue on the rest of the entries (on the same level as .android_secure). Which is a bug in sshd I would claim, but the version in kde connect is 6 years old.
>
>> Investigating how other
>> android apps handle sftp/ssh servers, and .android_secure
>> specifically, would probably be a good place to start.
>
> Full Ack. That is what I tried to do. I took a look in some open source file managers. They don't try Linux OS access like sshd / kde connect tries, but use the official Android APIs (SAF) and thus don't have a problem with it. Still looking for an open source ssh server for Android to verify how they handle it internally. Closed source ssh server seem to handle it okay - showing permission denied.
>
>> > If neither works, then I would assume that doing this via ssh is the wrong way.
>>
>> I'm not sure using a different protocol could solve the local
>> filesystem problem.
>
> protocol like smb? You are probably right. But I am 120% sure that if on Android we use the native methods (SAF) then it works fine, we just need to report then back in some kde connect JSON what to display in Dolphin. Not sure if that would be an issue on the KDE end. If a KDE dev says that this is done in a jiffy, then I would opt for this. I don't want to modify the sources of sshd and the more I look into it I believe it won't lead to a solution. It is not only that an empty SD card is shown, but as well that you cannot write to the SD card.
>
More information about the KDEConnect
mailing list