Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue Report]: Android 13: Unable to copy files to protected folder Android/data/org.diasurgical.devilutionx/files #6975

Closed
rootko opened this issue Feb 19, 2024 · 13 comments

Comments

@rootko
Copy link

rootko commented Feb 19, 2024

Operating System

Android

DevilutionX version

1.5.2

Describe

Since Android 13 there's a copy protection of folder /Android/data/*. In other words we're unable to copy *.mpq files where DevilutionX is trying to find them. Would it be possible to implement a search button, so we can navigate app to an accessible folder (e.g. Downloads)?

To Reproduce

  1. install apk
  2. run it, it will say to place diabdat.mpq to Android/data/org.diasurgical.devilutionx/files which is inacessible in Android 13
  3. cry

Expected Behavior

Implement a "browse" button, which will allow user to find the folder where data files are stored.

Additional context

No response

@DakkJaniels
Copy link
Contributor

DakkJaniels commented Feb 19, 2024

Did you try Import Data, or does that not work?
Edit: referring to this: https://github.com/diasurgical/devilutionX/wiki/Extracting-the-.MPQs-from-the-GoG-installer#android

@rootko
Copy link
Author

rootko commented Feb 19, 2024

Thank you, that did it. I was reading this part of the "how to install": https://github.com/diasurgical/devilutionX/blob/master/docs/installing.md which was no longer working.
That part with the importing the files should definitely be mentioned there 😆

@rootko rootko closed this as completed Feb 19, 2024
@StephenCWills
Copy link
Member

The folder is only inaccessible to other apps on the phone, like the file browser app. Importing the files is not necessary if you copy the files from your PC directly to the appropriate location. That's why it's not mentioned in the Installing guide.

@rootko
Copy link
Author

rootko commented Feb 19, 2024

Well I've tried like 5 different file explorers on my Android 13 tablet without root and none had access to /Android/data. Also connection from PC displayed that folder, but it was read only. That's why I believe it might help somebody else if there's a note that "in case you don't have a direct access to that folder, try import data files by long tapping on DevilutionX icon". If it helps just one person, it's worthy doing 😀

@AJenbo
Copy link
Member

AJenbo commented Feb 19, 2024

Try File Manger Plus

Would it be possible to implement a search button, so we can navigate app to an accessible folder (e.g. Downloads)?

No, Google does not permit this.

@StephenCWills
Copy link
Member

Also connection from PC displayed that folder, but it was read only.

According to this, you get read-write access if you use MTP through a PC, and I confirmed it with my phone just now.
https://www.reddit.com/r/Android/comments/wru35i/clearing_up_confusion_about_how_to_access/?rdt=55314

If it helps just one person, it's worthy doing 😀

I don't really agree. We don't want to confuse people by adding more steps than what is really necessary. And if someone can't figure out how to get read-write access using MTP, they can just ask us like you did.

@AJenbo
Copy link
Member

AJenbo commented Feb 20, 2024

The method doesn't work for uses on very old android devices 😕 which is my main reason for not having it there. The extra steps also makes it more likely that you end up with multiple copies of the data

@rootko
Copy link
Author

rootko commented Feb 20, 2024

Ok, maybe at risking of looking stupid - I develop apps for Android and even I didn't know I need to connect to PC in MTP mode to gain write access to /Android/data/. And if I got that part wrong, I'd suspect a lot of less experienced users will fail at this step as well. Especially in the future with the upcoming Android versions, that will be even tighter in the security measures. But on the other hand such users now have an issue they can search for and make it work for them. Anyway, I digress here. I just wanted to thank you all for helping me make it run.

@StephenCWills
Copy link
Member

StephenCWills commented Feb 20, 2024

Ok, maybe at risking of looking stupid - I develop apps for Android and even I didn't know I need to connect to PC in MTP mode to gain write access to /Android/data/. And if I got that part wrong, I'd suspect a lot of less experienced users will fail at this step as well.

My phone connects in "charge-only" mode, and I have to switch it over to "file transfer" which seems pretty obvious to me. Charge-only doesn't give me read-only access, though. In what way did you connect your tablet to your PC to gain read-only access, and how would you switch to MTP? Should we add a step to the instructions for this?

@rootko
Copy link
Author

rootko commented Feb 20, 2024

Exactly - if I chose "file transfer", it mounted /Android/data/ only in read only mode (Android 13). MTP is something you've suggested in that Reddit link, I haven't tried it, because importing data files has sorted that issue for me.

@StephenCWills
Copy link
Member

Exactly - if I chose "file transfer", it mounted /Android/data/ only in read only mode (Android 13). MTP is something you've suggested in that Reddit link, I haven't tried it, because importing data files has sorted that issue for me.

As far as I know, "file transfer" should be all you need to enable MTP. The notification on your device should say, "Connected as a media device". I've tested over the years on Android 11-14, and my tests the other day were all on Android 14. According to the following link, MTP is very likely supported by any device running Android 5+.

https://stackoverflow.com/a/29280357

As such, it's simply unclear what's going on with your device or if there's anything we can change about the instructions to be more generally applicable. You've stated your issue is resolved so I'm not going to ask you to go out of your way to help with this. Maybe you can at least share the make/model of your device so I can do some research on my end.

@DakkJaniels
Copy link
Contributor

I think probably just stating in the Android instructions that the long press is available to import as an option might be sufficient. You won't necessarily know about that feature unless you check the extracting the mpq from gog installation instructions.

@rootko
Copy link
Author

rootko commented Feb 20, 2024

My device is Lenovo Tab P11 Pro (2nd gen), model TB132FU. And the weird thing is that when I tried it again today, it totally mounted /Android/data/ with write permissions. It also worked the first time on my Pixel 8 (Android 14) today when I tried it. So it must've been some kind of my fault or some inconsistent state of my tablet. But yeah, importing the files helped me yesterday, so one more sentence in the "how to" guide cannot hurt. Thanks for your time and effort!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants