Dropbox + Sookasa

First off, a heartfelt thank you to the Lit and Lat team for releasing the ios version of Scrivener.

Second, congratulations for a program that is excellent from the get go!

I have a bug to report. It appears that scrivener for ios does not play nice with Sookasa on Dropbox when it comes to syncing. I have a Sookasa folder inside Dropbox – anything that goes into that folder is encrypted by the Sookasa app. Scrivener for ios has no problem creating a project and reading from/writing to it in that directory. And Scrivener for the Mac can read from that directory without any problem.

The problem arises after Scrivener for the Mac updates the project in the Sookasa directory on Dropbox: after that point in time, scrivener for ios cannot open the project (it complains with the message “Invalid Project: the project cannot be opened because it does not contain a valid binder structure file”) whereas scrivener for the mac continues to work with the project in that directory seamlessly.

I checked the forum and did not see anything reported on this, hence my posting.

Looking forward to a fix for this.

Again, congratulations to the team!

I’ll offer the following naive comments. I could be way wrong. There’s too little public information about Sookasa, particuarly about Sookasa for iOS, to be sure. Sorry the following is so verbose.

My guess is that this isn’t a bug, but rather has to do with Sookasa’s implementation on iOS (iPhone, iPad) and iOS’s sandboxing (secured segregation) of files on an application by application basis.

The very limited amount of info I can find about Sookasa, particularly with regard to Sookasa for iOS, seems to suggest that it is focused on single file at a time and that access to Sookasa encrypted files must first be initiated within the Sookasa app (via built-in Open In choice of application). This is different than in Mac OS X or PC Windows, where the Sookasa app/client is presumably permitted to insert itself between DropBox and apps. and/or is allowed access to most all files regardless of associated app.

Issues I would guess are involved:

  • iOS doesn’t allow Sookasa to insert itself between Scrivener and DropBox or between Scrivener and iOS when Scrivener accesses files.
  • On iOS, it seems that Sookasa requires an explicit request from the user, on a file by file basis, to decrypt/access files. The problem is, a Scrivener project isn’t just the .scrivx file inside the project folder, but rather the project folder and all subfolders and numerous files within it. I’m guessing that Sookasa would only decrypt and allow access to just the explicitly requested .scrivx file. So even if one were to launch the Sookasa app and tell it to launch the .scrivx file via its internal Open In feature, the remaining subfolders and numerous other files will likely remain encrypted and inaccessible.

You might try launching the Sookasa app and asking it to open the project’s .scrivx file via Open In using Scrivener, but I’m guessing the most you’ll see is the binder, but not document contents, and that may be accompanied by one or more error/security messages. Scrivener typically has constantly changing numerous files (binder/index, multiple .rtf documents, etc.) open simultaneously.

My guess is that Sookasa gets around the per application sandboxing of files by spinning off an unencrypted temporary copy, which is what actually gets opened by its internal Open In (i.e. made available to the app specified in Open In. And subsequently reencrypting and recopying that temporary copy back into Sookasa’s vault.

You might contact Sookasa’s tech support and ask them if it can handle simultaneously making numerous files in multipe subfolders available to a single iOS app. A parallel would be whether it could do such for something like a database comprised of multiple table and index files (think multi-file oriented apps like dBase, Microsoft Access, SQL, etc. rather than single file oriented apps like Word, Excel, etc.). You might also try creating a small Scrivener project containing at least a few folders and several small/short documents, compressing/zipping that, sending it to them and see what they say or suggest.

A wild guess, given iOS’s per app file segregation, it might be that Sookasa would have to convince DropBox to include a Sookasa component within the DropBox for iOS app, so that it’s activity happens within DropBox, invisible to iOS and Scrivener.

Hope the above is reasonably accurate and of some assistance.

That’s more than I know. I’ll shut up.

Thank you for the detailed explanation.

Here are two things that I did

  1. I created a new project from the iOS app inside the Soakasa directory then added under Draft, under Research, deleted things, changed labels, etc. then synced and exited the project. Then opened it again and everything was fine. I added/deleted/synced/exited a few times and there was no problem that i could see.
  2. I downloaded the Scrivener_iOS-Tutorial.zip from the Lit and Lat website, unzipped it then copied the Tutorial.scriv project into the Sookasa folder. I waited for the sync to complete. When I attempted to open the project from the ios app I got the error message I mentioned above. However, the MAC app continued to be able to open the project from within the Sookasa folder without a problem.

Hopefully, this “uneven” behavior suggests that it is not a difficult problem to address.

Which machine did you do the first part of #2 (download and unzip) on, using what application or utility?

How is Sookasa installed on the Mac? My guess is that you have a Sookasa helper application running on the Mac which monitors everything placed inside your Dropbox folder, encrypting and decrypting data there as required. That’s pure speculation, but I can’t think how else it would work. (Actually, yes, according to their website, that’s exactly what happens.)

This being the case, the problem is that there is no Sookasa helper on iOS to do this. So when you go to open a project from Dropbox on iOS, the project is still decrypted - because Sookasa isn’t there to decrypt it. So Scrivener can’t open it. There is no Dropbox helper running on iOS for Sookasa to integrate with (only a Dropbox browser app you can download). The way apps use Dropbox on iOS is that they have to use the APIs provided by Dropbox to upload and download files. Therefore, the only way for Scrivener to open Sookasa-encrypted files would be for Sookasa to provide APIs that third-party developers could use to decrypt downloaded files and encrypt uploaded files.

All the best,
Keith

I downloaded the zip file on my MAC and unzipped it from within the Finder by double-clicking on it. Nothing special was used.

Hi Keith. Thank you for the information.

I am not sure what you mean by “helper” app – there is a Sookasa app for ios (but I am not sure if it is what you call a “helper”)…

Hi yzrzi,

When you first started using Sookasa, you would have installed it on your computer. If you look at your menu bar, near the clock, you will see a little Sookasa icon. That shows that Sookasa is installed and running on your Mac. If you were to click on that icon and quit Sookasa, you wouldn’t be able to open any encrypted files from Dropbox. Basically, what the Sookasa app does is monitor your file system, so that any time you go to open something from the Dropbox folder, Sookasa (always running in the background on your Mac) intercepts and decrypts the file. When you save something into Dropbox, Sookasa encrypts it. So:

  • Sookasa running in background.
  • You open something from Dropbox.
  • Sookasa sees this and intercepts, grabbing the file, decrypting it, and returning the decrypted version to macOS as it’s opened.
  • Save the file.
  • Sookasa sees this and encrypts it on disk.

None of this happens on iOS. Even if there is a Sookasa app, it cannot do any of the following because of the way Apple has designed the file system on iOS. On the Mac, the files system as you can see in Finder is freely accessible. On iOS, each app is allocated its own segment of the file system, and no other app is allowed access to it. This means that it is not possible for Sookasa to create an app on iOS that can monitor changes to folders used by other apps and encrypt or decrypt them. This is why the files are not being decrypted on iOS.

The only way for the files to be decrypted on iOS would be for Sookasa to create an API that third-party developers could use. So they would have to write code that I could use to call on their systems to decrypt and encrypt files when opened from or saved to the Dropbox folder in Scrivener’s file system on iOS.

I recommend you write to Sookasa about this. If you look at their help pages, they only talk about being able to open files on an iPad by using “Open In” from Sookasa, meaning that there is no way to use Sookasa with Scrivener’s Dropbox integration, because Sookasa has on way of integrating with the Dropbox frameworks that Scrivener uses.

All the best,
Keith

Hi Keith.

Thank you for the detailed explanation. I now understand the complications of accessing Sookasa files and the differences between OS X and iOS.

I will email Sookasa with a request - hopefully, mine will be one of many outstanding requests for exactly the same feature :wink:

Thanks again!