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

UnauthorizedAccessException for system folders on Mac OS #66

Open
hippogamesunity opened this issue May 26, 2022 · 14 comments
Open

UnauthorizedAccessException for system folders on Mac OS #66

hippogamesunity opened this issue May 26, 2022 · 14 comments
Labels

Comments

@hippogamesunity
Copy link

hippogamesunity commented May 26, 2022

Description of the bug

Hi! I'm testing the plugin on Mac OS and there is an issue with UnauthorizedAccessException when writing to the Root drive.
The situation is:

  • the app can list system drives and open files
  • the app can't write to Root or Root/Users (UnauthorizedAccessException)
  • when I'm trying to move files to Root or Root/Users with Finder, it's asks for a user password (so I think it's considered as secured pathes)

Showing this exception to users blocks me from passing the App Store review, so I'm looking for a workarounds to hide drives or hide inaccessible locations maybe.
image

Reproduction steps

  • save any file to the Root drive on Mac OS

Platform specs

Any Unity, any Mac

Additional info

The app asks for permissions to Documents when starting the first time.

@hippogamesunity
Copy link
Author

image

@yasirkula
Copy link
Owner

First thing I could think of is, every time the path changes, we check for write access in that directory and if we don't have access, disable the Save button. I'll probably give it a shot sometime soon.

@hippogamesunity
Copy link
Author

Thanks for your reply! Here is another screenshot from the app store reviewer team.
image

@yasirkula
Copy link
Owner

What seems to be the issue in this screenshot?

@hippogamesunity
Copy link
Author

I mean the error may occur not only for the Root drive, but for others as well.

Btw I've found code to comment to hide drives (as a workaround).

@hippogamesunity
Copy link
Author

Another similar exception when listing files (not saving as before).
image

@hippogamesunity
Copy link
Author

hippogamesunity commented May 28, 2022

All previous errors were from an old x64 Mac.
On the latest Mac OS the plugin doesn't work at all due to sandbox, all pathes are incorrect (like Documents and Desktop).
image

@yasirkula
Copy link
Owner

Thanks again for the feedback! I didn't know about sandboxing, will google it while working on a bugfix for this issue.

@hippogamesunity
Copy link
Author

As you see, these paths are similar to iOS, so I can suggest Mac sandboxing is similar to iOS. BTW you can't send an app to review without adding the Sandbox capability in Xcode. At the same time, even with this feature enabled, you can't test a sandboxed app by running from Xcode. It gets really sandboxed only after downloaded from the App Store. Also I'm noob in Mac OS)

@hippogamesunity
Copy link
Author

Sorry to bothering you, but I'm trying to provide as much info as I have. Thanks!

@manituan
Copy link

manituan commented Jul 10, 2023

Hi, we're facing this issue in our project and I'm wondering if you're still planning on fixing this issue. Thanks.

@yasirkula
Copy link
Owner

My schedule unfortunately won't allow me to fix this issue soon. I'm planning to work on this at some point but not soon.

@yasirkula
Copy link
Owner

@hippogamesunity @manituan If I were to add a "Browse..." button that allows the user to pick a directory using Mac's native file picker (upon completion, user will be able to browse that folder's contents using SimpleFileBrowser), do you think App Store Review team would object with the reason "if you're gonna show the native dialog anyways, then do everything with the native dialog; why show a uGUI dialog and native dialog together"?

I'd personally prefer the native dialog over uGUI dialog but there are already several native file browser plugins and some users would prefer showing their customized uGUI dialog (e.g. to display a World Space file browser). In any case, the solution will be either a fully native dialog experience or a combination of native+uGUI dialogs as I've described in my first paragraph.

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

No branches or pull requests

3 participants