Is it possible to allow app(s) to write to external storage without root ? - Huawei Mate 9 Questions & Answers

I have a brand new Mate 9 and am happy with it. I even did not root it as I otherwise won't get updates anymore and most things I needed to root for don't require root anymore under Nougat.
Except for one thing (?).
Apps cannot write to the external storage, except the buitin file manager and of course the USB connected MTP from a computer.
Using Airdroid, it prompts when I attempt to write to extSDCard and then I clicked on some prompts in the builtin file manager and after that Airdroid is allowed to write to extSDCard, so that works.
I would like to do the same with other apps, particularly SSHDroid (SSH server) as this is somewhat easier for syncing with rsync for a Mac or Linux computer which does work for internat storage but not for extSDCard.
Is there a possibility to allow it, at least on a per app basis ?
Or with an adb command to write settings as many apps (like Autotools) do for special rights ?
The switch below in 'Developer settings' does not work.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}

I guess an app should be able to properly request and get permissions to write to SDcard (or perform any other action). And it's up to developer to "teach" it.
I use Solid Explorer and it works with external memory perfectly fine after being granted permission to.

Just FYI, FolderSync got an update today which allows it to write properly to the external sdcard, and you can use it to sync over sftp (and I believe it also uses rsync internally).

As I know, the camera app can save pictures to SD card. I also wonder how to have a 3rd-party app write to SD card.

The app has to be specifically coded for the storage API. (API 23+? I don't remember the exact version.) Any app that does this will pop up a dialog box on first access that lets you choose what sd card folders to allow write to. Any app that doesn't support this will fail.

ResonanceZero said:
Just FYI, FolderSync got an update today which allows it to write properly to the external sdcard, and you can use it to sync over sftp (and I believe it also uses rsync internally).
Click to expand...
Click to collapse
But it still messes up the timestamps as another Android problem is that timestamps on both internal and external storage are always set to the copy time and not the original time.

Found the answer myself, after some searching around, but it still doesn't work.
adb shell pm grant berserker.android.apps.sshdroid android.permission.WRITE_EXTERNAL_STORAGE
But writing still fails after force quit the app and restarting it.
Why does this not work ?

Related

[Q] Cant access transformer files on PC

Hi All,
I am struggling to access my transformer files using my PC.
I have used the SDK tools and can get the device ID, so i know that bit works
USB Debugging is on
USB cable is new
I am using ICS Nightlies v24, the latest Gapps and TestyMeh v1.0 kernal
i can access the files in androids file explorer
my issue is odd, i connect my transformer to my pc and i hear the connection tone, it then shows up in my windows explorer (see picture 1). I click on it and it opens (Picture 2). then when i click on any of the files it goes to a blank window, and at the bottom it says "0 files" (Picture 3). if i try to drop a file it says it is going to root of storage and nothing happens (picture 4)
any idea why i cant see them?
1
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
2
3
4
Thanks
Mike
I have same issue (but not that severe). I nailed it down to the .nomedia flags. Recently, the TF is connected to the PC as a media-device, so I think that .nomedia flag will play its role.
If you have the flag in the root --> whole drive is hidden.
If you have the flag in the root of a folder --> whole folder may appears empty. I just remove the flags to see the contents. But then the multimedia apps make pick up all the junks and add them to their library.
Currently I switch to a wireless connection (using some apps like Samba) to get around.
hyperxguy said:
I have same issue (but not that severe). I nailed it down to the .nomedia flags. Recently, the TF is connected to the PC as a media-device, so I think that .nomedia flag will play its role.
If you have the flag in the root --> whole drive is hidden.
If you have the flag in the root of a folder --> whole folder may appears empty. I just remove the flags to see the contents. But then the multimedia apps make pick up all the junks and add them to their library.
Currently I switch to a wireless connection (using some apps like Samba) to get around.
Click to expand...
Click to collapse
Samba seems to allow me to access the internal and external SD card, but it isn't the .nomedia issue. I guess this will work for now, but i would still like to get it sorted..........
thanks anyway, anyone else got an ideas?
Mike
bump

Periodically backup \sdcard partition

I want to every 24 hours backup my \sdcard partition to network attached storage automatically if my phone is in range of my wi-fi signal. There are apps in play store which do that but they are not free. So first thing which I must do, and which I don't know how, is to mount the NAS partition on phone file system. So how to do that?
DTFuser said:
I want to every 24 hours backup my \sdcard partition to network attached storage automatically if my phone is in range of my wi-fi signal. There are apps in play store which do that but they are not free. So first thing which I must do, and which I don't know how, is to mount the NAS partition on phone file system. So how to do that?
Click to expand...
Click to collapse
@rootSU does this and may be able to help you. lol.
Lethargy said:
@rootSU does this and may be able to help you. lol.
Click to expand...
Click to collapse
I trigger it with Tasker, but actually, all the parameters such as at time x, connected to Network Y can be set within FolderSync. FolderSync can do everything that I do, but I choose to use FolderSync as a Tasker Plugin. But yeah FolderSync is all you need.
rootSU said:
I trigger it with Tasker, but actually, all the parameters such as at time x, connected to Network Y can be set within FolderSync. FolderSync can do everything that I do, but I choose to use FolderSync as a Tasker Plugin. But yeah FolderSync is all you need.
Click to expand...
Click to collapse
Maybe I didn't quite good explained what I want. I want to backup my \sdcard to the external disk which is on the same network. I tried FolderSynce and as can I understand they can only do backups to cloud services but not to the network attached storage. Am I correct? Tasker is not a free app, I want to do it without cost since I need to do it for multiple phones.
I planned to do it the same way as I did it with my desktop PC with ubuntu OS. On it every 24 hours cron tab start command: sudo cp -R \locat dir \remote dir on NAS. But to be able to do that I need to mount NAS to the specific phone location. So my question is how to do that, how to mount NAS to the specific phone location llike \mnt\NAS?
DTFuser said:
Am I correct?
Click to expand...
Click to collapse
No. You are incorrect
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
...and as stated, you don't need tasker. You can do everything with folder sync.
Sent from my Nexus 5 using Tapatalk < Yes, I want you to know that I'm using a mobile client

[Q] SD card cannot be detected when browsing as root.

Good day, fellow XDA citizens.
Here's my problem. My phone's external storage cannot be detected by apps when they are browsing as root. See screens:
This is what it looks like when the apps are browsing as root: (i.e. granted su permissions)
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
This is what it looks like when the apps are not browsing as root: (and the way things are supposed to be)
Note that these issues are not limited only to this Script Manager app, but others as well, including Android Tuner, TiB, and the likes (most apps that access the external storage)
I've noticed that fuse in external storage becomes "RO rootfs" when browsing as root, and fuse remains intact for internal storage whether or not it was given su permissions.
I've tried googling around for answers, a few articles and discussions mention fuse but I can't make a certain sense out of them, most likely because I am a scrub on linux usage.
What things can I do to try fix this issue? Any help will be much appreciated.
regards, Ocenyx
SD card not detected
I have Samsung Wave2 GT-s8530. whenever I am installing badadroid on my set whatever the ROM is my external SD card was not detected. it showed 0 MB only. Details of my phone and installation as follows:
Installed at Downloader v5.67
Fat32 is the format of SD card.
Anyone please?
By the way, this phone is running 4.4.2 version of Android. This issue was not present in 4.2.2 before.
To anyone else having this issue,
It seems to be a well-known symptom of Kitkat for MT6582 devices. I'm not certain if this problem exists on any other chip.
While we wait for any official fix for SuperSU app regarding this issue (if any), the only fix I have ever known to have worked is by using KingRoot. I'm aware that many advanced android people always discourage users from installing chinese stuff but it addresses the issue at least. It's much much better than living through this inconvenience.
Regards

No USB Mass Storage (MSC) mode in Android 10??

connecting phone to pc via PTP/MTP or "file transfer" suck because you can't browse full photos without downloading them to local drive first for example.
USB Mass Storage mode doesn't have this deficiency, is there easy way to get it back?
device?
Cubot king kong mini 2
it also happens on other android devices!
You can't bring back
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Modern Android devices use different USB connection protocols, for example MTP what acts a lot like USB mass storage. This because the Android file system had to be accessible from Windows device, it had to be formatted with the FAT file system. Not only does Microsoft have patents it exerts on FAT, FAT is also an older, slower file system without a modern permission system.
An MTP device shows up in Windows Explorer so you can browse and transfer files.
For wireless file transfers, a good choice is AirDroid. It allows you to connect to your Android device over Wi-Fi with just a web browser, moving files back and forth without the necessity of a cable. It will likely be a bit slower, but it can be a life-saver if you’re out and about and didn’t bring the appropriate USB cable. For transferring files from Android to your PC, Portal is also a quick and easy solution.
thanks, I've actually found some ad-free apps on https://playsearch.kaki87.net/
Cubot33 said:
connecting phone to pc via PTP/MTP or "file transfer" suck because you can't browse full photos without downloading them to local drive first for example.
USB Mass Storage mode doesn't have this deficiency, is there easy way to get it back?
Click to expand...
Click to collapse
I suggest using x-plore and using the same network to transfer/view files. Have been using it's wifi share function since 2014 or something.

55GB space missing on SDCard after deleting file

I use Syncthing regularly to backup some things from the phone to my PC and it works rather nicely.
Syncthing - Wikipedia
en.wikipedia.org
However, it often chokes on big files, eg I wanted to copy some kiwix files (aka precompiled wiki) to my SDCard (the other way around which works also very well for small files).
Kiwix - Wikipedia
en.wikipedia.org
Welcome to Kiwix Server
library.kiwix.org
Well, that full wiki has some 99GB and it got stuck. So I stopped Syncthing and deleted the remnant incomplete file... took forever, I got impatient and rebooted my fon.
Ouch, no empty space was recovered - I am missing about 55GiB "emptiness". Remembering vaguely that exfat is windows, I thought to just check it quickly in Win10... except it didn't work (check via properties):
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Can anyone explain this? What would be the proper way to enforce a check and free up my space?
PS: The card is a 512GB from Kingston with read/write above 70MB/s.
AFAIK modern SD-cards support CMD38 ( AKA TRIM ) command.
Check whether the SD-card in question supports CMD38 command and if, then apply it.
More info here:
Quickly Wipe an SD Card with ESP8266
In a previous story, I have written about connecting an SD Card to an ESP8266. During my adventures, I have discovered some interesting…
pawitp.medium.com
jwoegerbauer said:
modern SD-cards support CMD38 ( AKA TRIM ) command
Click to expand...
Click to collapse
Thanks! I would have expected a 512GB card is modern enough but no luck so far:
fstrim: /media/xxx/[email protected]: the discard operation is not supported
So I searched and found two apps:
https://forum.xda-developers.com/t/...ol-of-your-device-nand-chip-trimming.3038240/
https://forum.xda-developers.com/t/...tility-for-android-no-root-necessary.4258765/
Feature set was limited (basically just on and off, cannot select mounts/devices). Tried to set trim at reboot, no luck. Next step was busybox:
~ $ sudo busybox fstrim -v /storage/8549-8438
fstrim: ioctl 0xc0185879 failed: Function not implemented
Yeah, unless there is another idea... I think I just reformat it today (and won't reboot my fon next time so quickly if it occurs again).
PS: When moving all my files from sdcard to pc, something did get triggered and a lost-folder popped up. Unfortunately it was only half of it, instead of 55GB now "only" 34 were missing

Categories

Resources