DroidFS/README.md

158 lines
7.9 KiB
Markdown
Raw Permalink Normal View History

2020-07-17 16:35:39 +02:00
# DroidFS
2020-09-07 16:32:15 +02:00
DroidFS is an alternative way to use encrypted overlay filesystems on Android that uses its own internal file explorer instead of mounting virtual volumes.
It currently only works with [gocryptfs](https://github.com/rfjakob/gocryptfs) but support for [CryFS](https://github.com/cryfs/cryfs) could be added in the future.
2020-07-21 19:14:55 +02:00
<p align="center">
2021-04-05 18:56:07 +02:00
<img src="https://forge.chapril.org/hardcoresushi/DroidFS/raw/branch/master/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png" height="500">
<img src="https://forge.chapril.org/hardcoresushi/DroidFS/raw/branch/master/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png" height="500">
<img src="https://forge.chapril.org/hardcoresushi/DroidFS/raw/branch/master/fastlane/metadata/android/en-US/images/phoneScreenshots/3.png" height="500">
2020-07-21 19:14:55 +02:00
</p>
2020-07-17 16:35:39 +02:00
# Disclamer
DroidFS is provided "as is", without any warranty of any kind.
2020-09-07 16:32:15 +02:00
It shouldn't be considered as an absolute safe way to store files.
2020-07-17 16:35:39 +02:00
DroidFS cannot protect you from screen recording apps, keyloggers, apk backdooring, compromised root accesses, memory dumps etc.
Do not use this app with volumes containing sensitive data unless you know exactly what you are doing.
# Unsafe features
DroidFS allows you to enable/disable unsafe features to fit your needs between security and comfort.
It is strongly recommended to read the documentation of a feature before enabling it.
2020-08-27 12:00:45 +02:00
<ul>
<li><h4>Allow screenshots:</h4>
Disable the secure flag of DroidFS activities. This will allow you to take screenshots from the app, but will also allow other apps to record the screen while using DroidFS.
Note: apps with root access don't care about this flag: they can take screenshots or record the screen of any app without any permissions.
</li>
2020-10-23 13:43:21 +02:00
<li><h4>Allow opening files with other applications *:</h4>
Decrypt and open file using external apps. These apps could save and send the files thus opened.
2020-08-27 12:00:45 +02:00
</li>
<li><h4>Allow exporting files:</h4>
2020-10-23 13:43:21 +02:00
Decrypt and write file to disk (external storage). Any app with storage permissions could access exported files.
2020-08-27 12:00:45 +02:00
</li>
2020-10-23 13:43:21 +02:00
<li><h4>Allow sharing files via the android share menu *:</h4>
Decrypt and share file with other apps. These apps could save and send the files thus shared.
</li>
<li><h4>Keep volume open when the app goes in background:</h4>
Don't close the volume when you leave the app but keep running it in the background. Anyone going back to the activity could have access to the volume.
2020-08-27 12:00:45 +02:00
</li>
<li><h4>Allow saving password hash using fingerprint:</h4>
2020-10-23 13:43:21 +02:00
Generate an AES-256 GCM key in the Android Keystore (protected by fingerprint authentication), then use it to encrypt the volume password hash and store it to the DroidFS internal storage. This require Android v6.0+. If your device is not encrypted, extracting the encryption key with physical access may be possible.
2020-08-27 12:00:45 +02:00
</li>
</ul>
2020-10-23 13:43:21 +02:00
* Features requiring temporary writing of the plain file to disk (DroidFS internal storage). This file could be read by apps with root access or by physical access if your device is not encrypted.
2020-07-17 16:35:39 +02:00
# Download
2021-06-20 19:18:52 +02:00
<a href="https://f-droid.org/packages/sushi.hardcore.droidfs">
<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png" height="75">
</a>
You can download DroidFS from [F-Droid](https://f-droid.org/packages/sushi.hardcore.droidfs) or from the "Releases" section in the repo.
APKs availables here are signed with my PGP key available on keyservers:
`gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys 007F84120107191E` \
Fingerprint: `BD5621479E7B74D36A405BE8007F84120107191E` \
Email: `Hardcore Sushi <hardcore.sushi@disroot.org>`
2021-06-14 22:14:47 +02:00
To verify APKs, save the PGP-signed message to a file and run `gpg --verify <the file>`. __Don't install any APK if the verification fails !__
If the signature is valid, you can compare the SHA256 checksums with:
```
sha256sum <APK file>
```
2021-06-20 19:18:52 +02:00
__Don't install the APK if the checksums don't match!__
F-Droid APKs should be signed with the F-Droid key. More details [here](https://f-droid.org/docs/Release_Channels_and_Signing_Keys).
# Permissions
DroidFS need some permissions to work properly. Here is why:
<ul>
<li><h4>Read & write access to shared storage:</h4>
Required for creating, opening and modifying volumes and for importing/exporting files to/from volumes.
</li>
<li><h4>Biometric/Fingerprint hardware:</h4>
Required to encrypt/decrypt password hashes using a fingerprint protected key.
</li>
<li><h4>Camera:</h4>
Needed to take photos & videos directly encrypted inside DroidFS. You can deny this permission if you don't want to use it.
</li>
<li><h4>Record audio:</h4>
Required if you want sound on video recorded with DroidFS.
</li>
</ul>
2020-07-17 16:35:39 +02:00
2021-06-07 20:29:31 +02:00
# Limitations
DroidFS use some parts of the original gocryptfs code, which is designed to run on Linux x86 systems: it accesses the underlying file system with file paths and syscalls. However in Android, you can't access other apps files with file paths. Instead, you must use the [ContentProvider](https://developer.android.com/guide/topics/providers/content-providers) API. And obviously, the original gocryptfs code doesn't work with this API. This is why DroidFS can't open volumes provided by other applications, such as cloud storage clients. You can only use DroidFS with volumes located on shared storage or in the app's internal storage (hidden volumes). External storage such as SD cards are only supported in read-only access for now.
2020-08-12 16:14:48 +02:00
# Build
2020-07-17 16:35:39 +02:00
Most of the original gocryptfs code was used as is (written in Go) and compiled to native code. That's why you need [Go](https://golang.org) and the [Android Native Development Kit (NDK)](https://developer.android.com/ndk/) to build DroidFS from source.
2021-06-16 18:23:33 +02:00
2020-07-17 16:35:39 +02:00
#### Install Requirements
- [Android Studio](https://developer.android.com/studio/)
2021-06-16 18:23:33 +02:00
- [Android NDK and CMake](https://developer.android.com/studio/projects/install-ndk) (OpenSSL build fails with NDK versions higher than v22. It should pass with NDK v21.4.7075529 and lower)
2021-03-16 16:33:11 +01:00
- [Go](https://golang.org/doc/install) (on debian: `$ sudo apt-get install golang-go`)
2020-07-17 16:35:39 +02:00
#### Download Sources
```
$ git clone https://github.com/hardcore-sushi/DroidFS.git
```
Download [libgocryptfs](https://forge.chapril.org/hardcoresushi/libgocryptfs):
2020-07-17 16:35:39 +02:00
```
$ cd DroidFS
$ git submodule update --init
```
libgocryptfs needs OpenSSL:
```
$ cd app/libgocryptfs
2021-08-29 13:35:54 +02:00
$ wget https://www.openssl.org/source/openssl-1.1.1l.tar.gz
2021-03-18 18:31:18 +01:00
```
Verify OpenSSL signature:
```
2021-08-29 13:35:54 +02:00
$ wget https://www.openssl.org/source/openssl-1.1.1l.tar.gz.asc
$ gpg --verify openssl-1.1.1l.tar.gz.asc openssl-1.1.1l.tar.gz
2021-03-18 18:31:18 +01:00
```
Continue **ONLY** if the signature is **VALID**.
```
2021-08-29 13:35:54 +02:00
$ tar -xvzf openssl-1.1.1l.tar.gz
2020-07-17 16:35:39 +02:00
```
DroidFS also need [FFmpeg](https://ffmpeg.org) to record encrypted video:
```
$ cd app/ffmpeg
$ git clone --depth=1 https://git.ffmpeg.org/ffmpeg.git
```
2020-07-17 16:35:39 +02:00
#### Build
First, we need to install some dependencies:
```
2021-03-16 16:33:11 +01:00
$ sudo apt-get install libcrypto++-dev libssl-dev pkg-config
```
And also Go dependencies:
```
2021-06-14 22:14:47 +02:00
$ go get golang.org/x/sys/unix golang.org/x/sys/cpu golang.org/x/crypto/hkdf github.com/jacobsa/crypto/siv github.com/rfjakob/eme
```
Then, retrieve your Android NDK installation path, usually someting like "/home/\<user\>/Android/SDK/ndk/\<NDK version\>". We can now build libgocryptfs:
2020-07-17 16:35:39 +02:00
```
$ cd DroidFS/app/libgocryptfs
2021-08-29 13:35:54 +02:00
$ env ANDROID_NDK_HOME="<your ndk path>" OPENSSL_PATH="./openssl-1.1.1l" ./build.sh
2020-07-17 16:35:39 +02:00
```
And also FFmpeg:
```
$ cd app/ffmpeg
$ env ANDROID_NDK_HOME="<your ndk path>" ./build.sh ffmpeg
```
Then, open the DroidFS project with Android Studio. \
If a device (virtual or physical) is connected, just click on "Run". \
2020-07-17 16:35:39 +02:00
If you want to generate a signed APK, you can follow this [post](https://stackoverflow.com/a/28938286).
2020-08-27 12:00:45 +02:00
# Third party code
Thanks to these open source projects that DroidFS uses:
### Modified code:
- [gocryptfs](https://github.com/rfjakob/gocryptfs) to encrypt your data
### Libraries:
- [Cyanea](https://github.com/jaredrummler/Cyanea) to customize UI
- [Glide](https://github.com/bumptech/glide/) to display pictures
- [ExoPlayer](https://github.com/google/ExoPlayer) to play media files