android icon indicating copy to clipboard operation
android copied to clipboard

Opening files in microsoft apps still just read only

Open SailReal opened this issue 5 years ago • 20 comments

Basic Info

I'm running Cryptomator in version: 1.4.0-beta2

Description

As https://github.com/cryptomator/cryptomator-android/issues/15 is implemented, opening files in Microsoft apps like Word or Excel is still read only. You can find more information in this post: https://github.com/cryptomator/cryptomator-android/issues/15#issuecomment-507798932

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 avatar Jul 02 '19 18:07 SailReal

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
  • ...

SailReal avatar Jul 23 '19 22:07 SailReal

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

151058580845 avatar Sep 11 '20 01:09 151058580845

@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.

SailReal avatar Sep 11 '20 07:09 SailReal

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.

MJegorovas avatar Mar 14 '21 11:03 MJegorovas

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 avatar Feb 25 '22 11:02 SailReal

We finally made it :tada:

Peek 2022-02-27 01-15

SailReal avatar Feb 27 '22 00:02 SailReal

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

LearningAsIGo71 avatar Jul 11 '22 00:07 LearningAsIGo71

The workaround described in https://github.com/cryptomator/android/issues/150#issuecomment-1050753104= + https://github.com/cryptomator/android/issues/150#issuecomment-1052842469= 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 :thinking:~~

We found the cause^^ and will ship it ASAP

SailReal avatar Jul 11 '22 15:07 SailReal

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.

SailReal avatar Jul 12 '22 11:07 SailReal

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.

LearningAsIGo71 avatar Jul 28 '22 16:07 LearningAsIGo71

@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.

SailReal avatar Jul 29 '22 07:07 SailReal

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!

LearningAsIGo71 avatar Jul 29 '22 12:07 LearningAsIGo71

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?

ondrejsv avatar Aug 07 '22 14:08 ondrejsv

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

SailReal avatar Aug 10 '22 11:08 SailReal

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 avatar Sep 17 '22 03:09 LearningAsIGo71

Btw, I am running version 1.8.0 SNAPSHOT DEBUG

LearningAsIGo71 avatar Sep 17 '22 22:09 LearningAsIGo71

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 avatar Sep 22 '22 03:09 LearningAsIGo71

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

LearningAsIGo71 avatar Sep 23 '22 16:09 LearningAsIGo71

@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 https://github.com/cryptomator/android/issues/150#issuecomment-1181657748 it works:

https://user-images.githubusercontent.com/1786772/193795663-4ca3eafb-4f1a-4c4a-8b6a-abc99b8e5689.mp4

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

SailReal avatar Oct 04 '22 10:10 SailReal

I'm using the same version: 16.0.15629.20092

LearningAsIGo71 avatar Oct 09 '22 21:10 LearningAsIGo71

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

Stoner60 avatar Jan 29 '23 11:01 Stoner60

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 avatar Mar 12 '23 15:03 SailReal

The Android app of cryptomator is very costly. When are you planning to reduce the price? Or do we have any discount code please?

Okiedokie7 avatar Mar 31 '23 02:03 Okiedokie7

@Okiedokie7 As you may have noticed, your comment on this issue here is completely off topic.

SailReal avatar Mar 31 '23 10:03 SailReal