CypherpunkArmory / UserLAnd

Main UserLAnd Repository
Other
3.58k stars 393 forks source link

Bug report - Runtime write permissions for external SD Card #630

Open ghost opened 5 years ago

ghost commented 5 years ago

Describe the bug

Since Android 6.0.1 ext.-card files can't be written etc. regardless of whether the app has access permission.

It has to prompt. More context below. Zzz...

Steps to reproduce the behavior:

Device Information

Device: Samsung Galaxy J500M. Android Version: Marshmallow 6.0.1. UserLAnd Version: 2.3.4. Whether the device is rooted: no. Whether the device is running LineageOS: no.

Additional context

What I expected

A prompt for selecting the card to grant app's access at run-time once.

enforce-issue-templates[bot] commented 5 years ago

Hello @hydroper! It looks like you've posted an issue that requires more details for our team to be able to start working on it.

We have created some issue templates to assist you in this process. These issue templates can be found here.

To correctly follow the template, all of the headers from the template must be present in your new issue. The headers for each template are the lines that begin with a '#'. Include the headers, and then provide the data the headers require in the space below that header.

Following these templates will help our team begin work on your issue. We often cannot get started at all without that information, which is why we created this bot to help us out.

Please be as descriptive as possible when posting your issue, including any steps we would need to recreate it. If reproducing your issue requires us to figure out how to reproduce it in the first place, it will marked low priority.

If your issue is not updated to follow a template, we will likely close it within the week.

Thanks for using UserLAnd and for helping us improve it!

lewisdonofrio commented 5 years ago

is this about UserLAnd cause this read liks your just having issues getting to the sd card? I have this ticket https://github.com/CypherpunkArmory/UserLAnd/issues/591 that I'm guessing is what your trying to get to?

ghost commented 5 years ago

Truly since Lollipop (Android 5.1) this SDCard restriction had been introduced.

I got back to 5.1 in this cell phone, rooted it with KingoRoot and it worked! *_*

The ad-hoc solution is to root and, in some cases, use apps like SDCard Fix. I'm so happy, damn.

udgtehsy commented 5 years ago

I can't write to my external sdcard either.

corbinlc commented 5 years ago

Our app has a prompt requesting sdcard access when you try to create a new filesystem. Are you not seeing it and accepting it? Once you have created a filesystem, /sdcard is where you will find your sdcards contents.

corbinlc commented 5 years ago

Specifically, prompt shows up when you create the first filesystem.

ghost commented 5 years ago

He meant the external sd card

corbinlc commented 5 years ago

That is what I mean too. Should work for real or emulated sdcards.

corbinlc commented 5 years ago

So, @hydroper or others, can you try using our app from scratch again and tell us if you see the prompt when you go to create your first filesystem. It should prompt you in a fashion very similar to what you have requested.

ghost commented 5 years ago

Our app has a prompt requesting sdcard access when you try to create a new filesystem.

Though prompts should occur everytime you re-open the UserLAnd app and not once you create a filesystem. QuickEdit works same way here. I think it checks permissions, somehow...

For creating a filesystem in a external SD Card does one need to move the app there too?

m-yosefpor commented 5 years ago

I have the same problem. I can read from and write to internal sdcard located at "/host-rootfs/storage/emulated/0" , and also I can read from external storage located at "/host-rootfs/storage/XXXX-XXXX" (where X is a hexcharacter) but I can not write into that. for example, the following command gives me a permission denied error: $ touch /host-rootfs/storage/xxxx-xxxx/a.txt touch : cannot touch 'a.txt' : Permission denied

$ sudo touch /host-rootfs/storage/xxxx-xxxx/a.txt /usr/bin/touch: cannot touch 'a.txt' : Permision denied

m-yosefpor commented 5 years ago

however I found a good technique here:

https://github.com/CypherpunkArmory/UserLAnd/issues/70#issuecomment-417438201

0W1audio commented 4 years ago

Hello all,

I have two Android phones One is running Android 6.0 and can access the SDCard from within UserLand Debian in root mode with ln -s /host-rootfs/sdcard /

The second one is running Android 8.1.0 and CANNOT access the SDCard from within UserLand Debian in root mode. The same command ln -s /host-rootfs/sdcard / return premission denied

I also tried under root permission (sudo su) to change the repertory rights with chmod -R 777 /host-rootfs and I got : chmod : changing permissions of '/host-rootfs': Read-only file system chmod : cannot read directory '/host-rootfs': Permission denied

While the same command work on Android 6.0

Please help as my Android phone 6.0 has issues and I would like to use my new phone.

NOTE that, I mostly just need read access Best regards, Jean

0W1audio commented 4 years ago

I found a weird way to make it working. I made a copy of my sdcard to the internal memory (I used File Commander app) then, from the command line under root (sudo su) i moved the files to the home directory: cd /sdcard mv Music /home

Now I can play my Music but it is filling the internal memory !

ytrezq commented 4 years ago

@corbinlc used latest beta version from the store today, and I got no prompt at all. I am on 64 buts.

cld71 commented 4 years ago

Running UserLAnd 2.7.0 on a Samsung Galaxy S7. Not able to write to the SD card directly, but am able to write to /storage/sdcard with no problem. Which is the same as SDCard/Android/data/tech.ula/files/storage file.

The only other thing is that unable to execute any shell files from /storage/sdcard, or /storage/internal .