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

Opening files in microsoft apps still just read only #150

Closed
SailReal opened this issue Jul 2, 2019 · 24 comments
Closed

Opening files in microsoft apps still just read only #150

SailReal opened this issue Jul 2, 2019 · 24 comments
Labels
state:blocked Waiting for upstream bugfixes state:confirmed We are able to reproduce the reported behavior type:upstream-bug Something isn't working in upstream
Milestone

Comments

@SailReal
Copy link
Member

SailReal commented Jul 2, 2019

Basic Info

I'm running Cryptomator in version: 1.4.0-beta2

Description

As #15 is implemented, opening files in Microsoft apps like Word or Excel is still read only. You can find more information in this post: #15 (comment)

Unfortunately, there isn't a workaround to share with MS apps using a ContentProvider from the app internal storage a file with write access.
They have to fix that because there isn't any suitable workaround. Please stay tuned.

@SailReal SailReal added state:confirmed We are able to reproduce the reported behavior type:upstream-bug Something isn't working in upstream state:blocked Waiting for upstream bugfixes labels Jul 2, 2019
@SailReal SailReal added this to the Backlog milestone Jul 2, 2019
@SailReal
Copy link
Member Author

SailReal commented Jul 23, 2019

This is kind of a technical documentation what is working and what not.
Working:

  • file://storage/emulated/0/Android/data/org.cryptomator/cache/decrypted/hallo.docx (extern)
  • content://org.cryptomator.fileprovider/external_files/Android/data/org.cryptomator/cache/decrypted/hallo.docx (extern)

Not working:

  • file://data/user/0/data/org.cryptomator/cache/decrypted/decrypted/hallo.docx (intern)
  • content://org.cryptomator.fileprovider/decrypted/hallo.docx (intern)
  • files with the old ms format like .doc in general

Conclusion: Microsoft apps have currently problems to access files shared to them with write permissions in internal storage.
Only if the files are shared from public storage, they are able to open it with write access. Since for security reasons we will not store our files in external storage (almost every app would have access to them) so that they can be opened correctly by MS apps, there is currently no workaround.

Other apps like the Nextcloud app have the same problem: If you change in the storage location to the internal storage (/data/user/0/...) all files are read only using the MS apps. Changing back to a public location like (/storage/emulated/0/...), all files can opened by MS apps with write permissions.
Other apps like Amaze File explorer uses also the public directory and no FileProvider.

Other apps which are facing the same issue:

  • Planmaker HD and TextMaker HD
  • ...

@151058580845
Copy link

Hava you solved this problem,Now I have the same problem as you

@SailReal
Copy link
Member Author

@151058580845 no, unfortunately not. There is no solution to the problem known to me except the one already mentioned, although this is rather a workaround than a solution.

@MJegorovas
Copy link

Hi SailReal, I stumbled into this problem and was looking at your proposed workaround. As I understand working uri is from Context.getExternalCacheDir() call right? If so how do you get the content uri from that like in the next one? Because from testing FileProvider does not create uri value like presented one.

@SailReal
Copy link
Member Author

As Microsoft is not willing to fix its applications, we need to provide the following workaround: We should provide an option in the settings that, when enabled, creates the shared Office file (.xlsx, .docx, full list) in the public, world-readable location so that Office applications can open it with write permission. We need to inform the user in a dialog about the consequences of this setting if they enable it.

Since I'm not aware of other apps having this problem, I don't think we should provide a solution like Nextcloud where you can generally switch between shared file locations, since I think it's too easy to change this unintentionally, with the result that any flashlight app (of course with too many permissions) can access the open Vault files.

@SailReal
Copy link
Member Author

We finally made it 🎉

Peek 2022-02-27 01-15

@SailReal SailReal modified the milestones: Backlog, 1.8.0 Feb 27, 2022
@SailReal SailReal modified the milestones: 1.8.0, 1.9.0 Jun 4, 2022
@LearningAsIGo71
Copy link

What estimate when 1.9 will be released on F-Droid?

@SailReal
Copy link
Member Author

SailReal commented Jul 11, 2022

The workaround described in #150 (comment) + #150 (comment) and implemented in a feature branch has not yet been published because we discovered another problem during further tests: The Microsoft Office apps like Word require that already opened files needs to be available or needs to have the same name when a file is opened. But that means we can not remove the public readable version after writing it back to the cloud, otherwise e.g. Word will show errors during opening and we didn't found a workaround for this problem yet 🤔

We found the cause^^ and will ship it ASAP

@SailReal
Copy link
Member Author

If you want, you can test a debug version of Cryptomator including this workaround for Microsoft files. You can install this version next to the existing one, it is a completely different app.

In the Cryptomator settings, in the "Advanced Settings" section, you can find the option. Also "Keep unlocked" is probably useful in this combination.

To install it, download this file, verify the SHA256 of it
4fff2169933f2641c85ca8c93e067fcb30c387c6e5ac3ea1d9fa8c73d8ecadbd, unzip it, copy it to your device and install it by clicking on the file using your file manager.

We are very excited about your feedback.

@LearningAsIGo71
Copy link

Well I finally got the debug version, checked the hash, changed the Advanced Settings and didn't see any difference---all docs were still read only. Even though it appeared Cryptomator restarted upon enabling "Workaround opening MS files" nothing began working until I locked and unlocked the vault. Now both MS Excel and MS Word on Android are able to edit and save as normal! If this continues to prove to be a stable workaround it will be a real blessing. I was thankful Collabra Office was able to work as a temporary measure, but it is so clunky and jerky to operate (even on my new Pixel 5a) that it is great to be back to the much more polished and functional MS apps.

@SailReal
Copy link
Member Author

@LearningAsIGo71 thanks for the feedback. Did I understand correctly that the vaults were not locked when you enabled the "Workaround opening MS files" and Cryptomator got intentionally restarted by design?

I'm glad it works on your device and I'm curious to hear further feedback after some use.

@LearningAsIGo71
Copy link

I just tried recreating my previous steps, but it didn't seem to behave the same this time around.

With the vault unlocked I went to Settings, selected enabled "Keep unlocked" and then enabled "Workaround opening MS files" and selected "Activate" at the prompt. Upon selecting Activate it returned me to the main vault screen with the vault locked. Upon going back into the vault I was able to open MS docs and edit them as normal. So I am not sure why the first time around I had to relock and reopen the vault before I could properly edit and save MS docs. I plan to post an update if anything changes. Thanks again for the Workaround!

@ondrejsv
Copy link

ondrejsv commented Aug 7, 2022

Hi @SailReal, how can we test the debug version if we bought Cryptomator directly from the Google Play and therefore are not having any licence code?

@SailReal
Copy link
Member Author

@ondrejsv Drop me a direct message at https://community.cryptomator.org/u/sailreal/ or send an email to support@cryptomator.org

@LearningAsIGo71
Copy link

LearningAsIGo71 commented Sep 17, 2022

I successfully used the "Workaround opening MS files" in Cryptomator Beta on my Android device to open and edit MS Excel and MS Word docs for over a month and a half, but suddenly I cannot even open MS Word or Excel files in Crypto Beta!

I have tried clearing data and cache to no avail.

I can still open the files in the vault via Crypto Android stable version and on my desktop and laptop.

I see the Workaround has still not been implemented for the stable version and I would really like to regain the ability to open and edit MS files on my phone once again.

Any suggestions?

@LearningAsIGo71
Copy link

Btw, I am running version 1.8.0 SNAPSHOT DEBUG

@LearningAsIGo71
Copy link

Every time I would go to open a MS Word or Excel file in Cryptomator Beta I get "Can't open file. Sorry, something went wrong and [filename] can't open." I tried uninstalling and reinstalling Excel to no avail. I then uninstalled and reinstalled the beta version and it was able to open an Excel file before I enabled the Workaround. However, after I enabled the Workaround I got the same "Can't open file..." message before.

@LearningAsIGo71
Copy link

Well after a week of waiting for a response I have decided to go back to using the clunky, but functional Collabora Office.

@SailReal
Copy link
Member Author

SailReal commented Oct 4, 2022

@LearningAsIGo71 I just tried to reproduce the problem with latest Word and Excel in version 1.0.1 (16.0.15629.20092). On my device with the APK published here #150 (comment) it works:

device-2022-10-04-122043.mp4

What version of Excel do you have installed on your device?

@LearningAsIGo71
Copy link

I'm using the same version: 16.0.15629.20092

@SailReal SailReal modified the milestones: 1.9.0, 1.8.0 Jan 3, 2023
@Stoner60
Copy link

Hi, I installed the beta 1.8.0. Until now, no issues with microsoft edit.

@SailReal
Copy link
Member Author

Due to #479 we had to release an update very quickly (on Wednesday we knew what it was, Thursday the version went out as beta). We didn't want to release another 1.7.x, so we finalized 1.8.0 and released it as Beta2. But since it has to go very quickly, we left this Office workaround out. But with 1.8.0-Beta2 everything looks fine, we will finally release 1.8.0 tomorrow.
We can then simply release smaller updates again, so we will publish the Office workaround in the next (few) weeks, maybe even in a few days.

@SailReal SailReal modified the milestones: 1.8.0, 1.9.0 Mar 12, 2023
@Okiedokie7

This comment was marked as off-topic.

@SailReal

This comment was marked as off-topic.

@SailReal SailReal modified the milestones: 1.9.0, 1.10.0 Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:blocked Waiting for upstream bugfixes state:confirmed We are able to reproduce the reported behavior type:upstream-bug Something isn't working in upstream
Projects
None yet
Development

No branches or pull requests

7 participants