[guardian-dev] Sharing encrypted content with other apps
michael at briarproject.org
Tue Jan 28 18:54:28 EST 2014
-----BEGIN PGP SIGNED MESSAGE-----
I've been pondering whether it's possible for an Android app to share
encrypted content - for example, an image stored in a SQLCipher
database - with another app, without first creating an unencrypted
copy of the content on disk.
If we didn't mind creating an unencrypted copy of the content we could
write it to a file, use a FileProvider to get a content URI for the
file, and use an Intent to share the URI with the other app. Can that
process be modified to avoid making a copy of the content?
One possibility would be to create a named pipe with mkfifo(), use a
FileProvider to create a content URI for the pipe, use an Intent to
share the URI with the other app, and then stream the data from
storage to the pipe.
Another possibility would be to use ParcelFileDescriptor.createPipe()
to create a pair of ParcelFileDescriptors, use an Intent to pass the
read descriptor to the other app, and then stream the data from
storage to the write descriptor. But I guess most apps will expect to
obtain content from URIs rather than ParcelFileDescriptors.
Has anyone on the list tried something like this? Any suggestions?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
-----END PGP SIGNATURE-----
More information about the Guardian-dev