pacien / tincapp

Android binding and user interface for the tinc mesh VPN daemon.
https://tincapp.euxane.net
GNU General Public License v3.0
164 stars 30 forks source link

/sdcard/Android/data inaccessible on Android 13 #128

Open platise opened 4 months ago

platise commented 4 months ago

I am struggling to edit files on Android 13:

adb: can read but no write permissions, cannot go to adb root unless I root the phone
usb storage mode, can only read
ssh server: same, ready only

Could you return the ftp feature that was removed not that long ago: v0.38 -- 2023-07-30

make configuration files and logs accessible in the user-accessible storage
(in USB storage mode). The embedded FTP server has been removed
pacien commented 3 months ago

Hi,

The embedded FTP server was removed because it has maintainability, security and reliability issues.

I'm currently investigating other ways to expose the configuration files more reliably on all devices, since the shared directory doesn't seem to be accessible on all vendor variants of Android.

In the meantime, you can still download an older version of the app, containing the embedded FTP server here: https://tincapp.pacien.org/downloads/tincapp.0.37.apk

I might re-introduce it in later versions if I cannot find another way. However I'd like to avoid that for the reasons explained above.

StenSoft commented 2 months ago

Could you allow saving network configuration directory as a ZIP file or updating network configuration directory from a ZIP file?

pacien commented 2 months ago

Yes, I'm considering adding config dir ZIP import/export as a fallback. I'm currently busy with other things and trying to satisfy new requirements from Google Play… Patches are always welcome!

pacien commented 1 week ago

Release v0.41 now makes the config and log directories available to the stock file manager and other editor apps. Please test :)

rwky commented 1 day ago

When upgrading to 0.41 via the play store all existing configurations are missing from the UI. If I connect via adb they're still in /storage/emulated/0/Android/data/org.pacien.tincapp/files/networks which I can download with adb pull /storage/emulated/0/Android/data/org.pacien.tincapp/files/networks . then push to the Download folder in the file system using adb push networks /storage/emulated/0/Download and then using the file manager UI move the networks to the tinc networks folder.

It would be nice if on upgrade the files are migrated or have some warning about it.

pacien commented 1 day ago

Quoting Rowan (2024-10-04 22:32:19)

When upgrading to 0.41 via the play store all existing configurations are missing from the UI. If I connect via adb they're still in /storage/emulated/0/Android/data/org.pacien.tincapp/files/networks which I can download with adb pull /storage/emulated/0/Android/data/org.pacien.tincapp/files/networks . then push to the Download folder in the file system using adb push networks /storage/emulated/0/Download and then using the file manager UI move the networks to the tinc networks folder.

It would be nice if on upgrade the files are migrated or have some warning about it.

That's what is supposed to happen: the files should have been moved automatically when upgrading.

Do you see any error message in the app's log file regarding automatic configuration location migration?

rwky commented 1 day ago

Here's the logs

20:40:24.611 [main] INFO  org.pacien.tincapp.context.App - Starting tinc app 0.41 (release build), running on REL (14)
20:40:24.639 [main] INFO  o.p.tincapp.context.StorageMigrator - Migrating files present in old configuration directory at /storage/emulated/0/Android/data/org.pacien.tincapp/files to /data/user/0/org.pacien.tincapp/files
20:40:24.642 [main] WARN  o.p.tincapp.context.StorageMigrator - Could not complete configuration directory migration: /storage/emulated/0/Android/data/org.pacien.tincapp/files/rList -> /data/user/0/org.pacien.tincapp/files/rList: The destination file already exists.
20:40:24.646 [main] INFO  o.p.tincapp.context.StorageMigrator - Clearing old cache directory at /storage/emulated/0/Android/data/org.pacien.tincapp/cache
22:01:31.661 [main] INFO  org.pacien.tincapp.context.App - Starting tinc app 0.41 (release build), running on REL (14)
22:01:31.934 [main] INFO  o.p.tincapp.context.StorageMigrator - Migrating files present in old configuration directory at /storage/emulated/0/Android/data/org.pacien.tincapp/files to /data/user/0/org.pacien.tincapp/files
22:01:31.936 [main] WARN  o.p.tincapp.context.StorageMigrator - Could not complete configuration directory migration: /storage/emulated/0/Android/data/org.pacien.tincapp/files/rList -> /data/user/0/org.pacien.tincapp/files/rList: The destination file already exists.
22:01:43.631 [main] INFO  org.pacien.tincapp.context.App - Starting tinc app 0.41 (release build), running on REL (14)
22:01:43.637 [main] INFO  o.p.tincapp.context.StorageMigrator - Migrating files present in old configuration directory at /storage/emulated/0/Android/data/org.pacien.tincapp/files to /data/user/0/org.pacien.tincapp/files
22:01:43.639 [main] WARN  o.p.tincapp.context.StorageMigrator - Could not complete configuration directory migration: /storage/emulated/0/Android/data/org.pacien.tincapp/files/rList -> /data/user/0/org.pacien.tincapp/files/rList: The destination file already exists.

I've done this on two devices so far the same thing happened on both

pacien commented 1 day ago

Quoting Rowan (2024-10-04 23:11:54)

/data/user/0/org.pacien.tincapp/files/rList: The destination file already exists.

Thank you for sharing the log; Seems like some system file made the whole automatic migration process fail. I've just released a new version (v0.42) which should fix that.

StenSoft commented 1 day ago

I can confirm that v0.41 works for me and I can edit the configuration files on my phone. Thanks!