Open lollilol opened 1 month ago
@lollilol
android apps without root access and permission granted
MANAGE_EXTERNAL_STORAGE
can only access/sdcard/
While that's true, I'm not sure it's that simple.
Looking at the latest KDEConnect Android app, I see the Filesystem Expose preferences seem to have vanished again, so you can no longer configure multiple shared storage locations.
In the past, after giving filesystem access permission, you'd be able to select one or more device locations to share, and they'd be exposed with the pathnames the user set. For example, here's the kdeconect.sftp
packet that comes back from my older phone still running a version of the app with filesystem-selection preferences:
{
"id": 1715569869701,
"type": "kdeconnect.sftp",
"body": {
"ip": "L.M.N.O",
"port": 1739,
"user": "kdeconnect",
"password": "XXXXXXXXX",
"path": "/",
"multiPaths": [
"/primary",
"/primary/DCIM"
],
"pathNames": [
"primary",
"DCIM"
]
}
}
...Now, that never worked very well, and it looks like it's gone again. The latest version of the app has no filesystem-expose preferences, and when it's activated and GSConnect tries to mount, this is the packet that comes back instead:
{
"id": 1715570673060,
"type": "kdeconnect.sftp",
"body": {
"ip": "L.M.N.O",
"port": 1739,
"user": "kdeconnect",
"password": "XXXXXXXX",
"path": "/storage/emulated/0",
"multiPaths": [
"/storage/emulated/0"
],
"pathNames": [
"Internal storage"
]
}
}
Point being, I don't think there's a simple mapping. Your device is probably responding with a packet that includes:
"path": "/sdcard",
"multiPaths": [
"/sdcard"
],
"pathNames": [
"Internal storage"
]
We likely need to start picking up that "path"
from the packet (which always used to be "/"
, AFAICT, so it was hardcoded), and using it in the connection. But it'll likely be different for every device, so hardcoding it to /sdcard
is as wrong as hardcoding it to /
.
(If you could confirm that the kdeconnect.sftp
packet includes /sdcard
as the path
on your phone, by doing a Generate Support Log collection, that'd be a big help.)
@lollilol I've updated your branch to be in sync with main
, so if you're going to make any changes locally be sure to first do a git pull
to pick up the remote changes.
We'll likely need to get rid of the Mount submenu, as well — it used to be, the contents of /
were just a list of the configured share locations, so it was a relatively short list. But if the mount is going to go directly into the user's storage, there's no benefit in showing the entire directory listing as a submenu of GSConnect's device menu.
That'll mean eliminating the UnmountSection
of (what was) the submenu, and promoting the Unmount action up to replace "Mount" in the device menu, instead of it being replaced with the submenu.
Yeah, this is the kdeconnect-android commit that switched over to using MANAGE_EXTERNAL_STORAGE
, and made the path
value no longer hardcoded to /
on their end.
android apps without root access and permission granted
MANAGE_EXTERNAL_STORAGE
can only access/sdcard/
when trying to access![image](https://github.com/GSConnect/gnome-shell-extension-gsconnect/assets/38194372/e90d7893-12d5-402e-bff7-4c6b9c05665e)
sftp://192.168.178.21:1739/
this error appears:after appending![image](https://github.com/GSConnect/gnome-shell-extension-gsconnect/assets/38194372/ce5b559e-c564-4ab9-aed9-b36eaccf1eba)
/sdcard/
to the sftp uri, i was able to successfully connect: