We have moved to a new Sailfish OS Forum. Please start new discussions there.
17

[solved] Proper way to let android apps write to SD card in SFOS 2?

asked 2015-12-25 15:21:17 +0300

martin gravatar image

updated 2016-11-16 10:53:19 +0300

jiit gravatar image

I know there are a lot of questions and answers on this already. However, most of these are for older versions of sailfish, or only work in special cases (like BTFRS formatted cards). I have no idea, which of these solutions is still working with the current version of sailfish. And I am also looking for a solution that works without BTRFS, as this seems unnecessarily complicated. I have a 64 GB ext4 formatted µSD card. I already tried this solution. I had to make some changes to the script to make it work, such as replacing "blkid" by "/sbin/blkid". The mount worked as intended, however android apps still cannot write to the SD card.

Can anyone help me in my confusion? Which is the simplest way to let android apps write to the SD card, that works independent of the filesystem used (or at least with not BTRFS filesystems)?

edit retag flag offensive close delete

2 Answers

Sort by » oldest newest most voted
1

answered 2016-11-14 21:11:12 +0300

GermanJollaUser1 gravatar image

As many of us noticed writing to sd card from android doesn't work as /media/sdcard is read only from Alien Dalvik's perspective.

Looking at the mount line I found that dmask and fmask are set to 0022. In the mount-sd.sh script in /usr/sbin this is not mentioned, so it seems to be default.

I overrode it by changing the following in /usr/sbin/mount-sd.sh

< MOUNT_OPTS="dirsync,noatime,users"
---
> MOUNT_OPTS="dirsync,noatime,users,dmask=0000,fmask=0000"

After executing

mount-sd remove  mmcblk1p1
mount-sd add  mmcblk1p1

I have write access to /media/sdcard from Alien Dalvik!!

I know I open the sd card for potential security threats but I'm looking to a better solutions. Any hints are welcome. Propably restricting access for all and just allow it for the group?

edit flag offensive delete publish link more

Comments

I need think about this in more detail but how about to add a fresh mountpoint that would contain only one specific folder on the sd scard - kind of an enabled shared folder.

Kaiserpinguin ( 2018-11-19 01:41:49 +0300 )edit
2

answered 2016-01-19 17:07:17 +0300

Fellfrosch gravatar image

Well I think the new update gives the answer...

edit flag offensive delete publish link more

Comments

1

That's good news, let's hope it really works. I will wait until the update becomes available for everyone to check it.

martin ( 2016-01-19 19:02:45 +0300 )edit
1

Did you do something special to be able to write? I still get a "Permission denied", like 2 years ago :/

Sthocs ( 2016-01-20 02:49:38 +0300 )edit
1

I still can't get any access to the sd card from my android apps - someone else?

elastic ( 2016-01-20 18:33:26 +0300 )edit
1

Jolla just edited the release notes which now say

Fixed an issue where Android applications (such as file managers) could not access path /media/sdcard

So I still think that the fix was only to mount the SD card at a later time so that Android apps can see it, but that it's still read only. Could @Fellfrosch or the people that have upvoted and accepted the answer confirm if they have managed to write on the SD from Android apps?

Sthocs ( 2016-01-22 11:26:53 +0300 )edit
1

It's indeed a little weird. I just posted that because I've read the release notes. I use chemist's solution on my Jollas. So I've tested it AFTER making the post. The read and write capabilities a definitely not yet the way they should.

Fellfrosch ( 2016-01-25 11:11:43 +0300 )edit
Login/Signup to Answer

Question tools

Follow
11 followers

Stats

Asked: 2015-12-25 15:21:17 +0300

Seen: 1,302 times

Last updated: Nov 14 '16