Giter Club home page Giter Club logo

droidfs's Introduction

DroidFS

An alternative way to use encrypted virtual filesystems on Android that uses its own internal file explorer instead of mounting volumes. It currently supports gocryptfs and CryFS.

For mortals: Encrypted storage compatible with already existing softwares.

Support

The creator of DroidFS works as a freelance developer and privacy consultant. I am currently looking for new clients! If you are interested, take a look at the website. Alternatively, you can directly support DroidFS by making a donation.

Thank you so much ❤️.

Disclaimer

DroidFS is provided "as is", without any warranty of any kind. It shouldn't be considered as an absolute safe way to store files. 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.

Features

  • Compatible with original encrypted volume implementations
  • Internal support for video, audio, images, text and PDF files
  • Built-in camera to take on-the-fly encrypted photos and videos
  • Unlocking volumes using fingerprint authentication
  • Volume auto-locking when the app goes in background

For upcoming features, see TODO.md.

Unsafe features

Some available features are considered risky and are therefore disabled by default. It is strongly recommended that you read the following documentation if you wish to activate one of these options.

  • Allow screenshots:

    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.

  • Allow exporting files:

    Decrypt and write file to disk (external storage). Any app with storage permissions could access exported files.
  • Allow sharing files via the android share menu*:

    Decrypt and share file with other apps. These apps could save and send the files thus shared.
  • Allow saving password hash using fingerprint:

    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.
  • Keep volume open when the app goes in background:

    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.
  • Allow opening files with other applications*:

    Decrypt and open file using external apps. These apps could save and send the files thus opened.
  • Expose open volumes*:

    Allow open volumes to be browsed in the system file explorer (DocumentProvider API). Encrypted files can then be selected from other applications, potentially with permanent access. This feature requires "Keep volume open when the app goes in background" to be enabled.
  • Grant write access:

    Files opened with another applications can be modified by them. This applies to both previous unsafe features.

* These features can work in two ways: temporarily writing the plain file to disk (DroidFS internal storage) or sharing it via memory. By default, DroidFS will choose to keep the file only in memory as it's more secure, but will fallback to disk export if the file is too large to be held in memory. This behavior can be changed with the "Export method" parameter in the settings. Please note that some applications require the file to be stored on disk, and therefore do not work with memory-exported files.

Download

You can download DroidFS from F-Droid or from the "Releases" section in this repository.

APKs available here are signed with my PGP key available on keyservers:

gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys AFE384344A45E13A
Fingerprint: B64E FE86 CEE1 D054 F082 1711 AFE3 8434 4A45 E13A
Email: Hardcore Sushi <[email protected]>

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>

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.

Permissions

DroidFS needs some permissions for certain features. However, you are free to deny them if you do not wish to use these features.

  • Read & write access to shared storage:

    Required to access volumes located on shared storage.
  • Biometric/Fingerprint hardware:

    Required to encrypt/decrypt password hashes using a fingerprint protected key.
  • Camera:

    Required to take encrypted photos or videos directly from the app.
  • Record audio:

    Required if you want sound on video recorded with DroidFS.

Limitations

DroidFS works as a wrapper around modified versions of the original encrypted container implementations (libgocryptfs and libcryfs). These programs were designed to run on standard x86 Linux systems: they access the underlying file system with file paths and syscalls. However, on Android, you can't access files from other applications using file paths. Instead, one has to use the ContentProvider API. Obviously, neither Gocryptfs nor CryFS support this API. As a result, DroidFS cannot open volumes provided by other applications (such as cloud storage clients). If you want to synchronize your volumes on a cloud, the cloud application must synchronize the encrypted directory from disk.

Due to Android's storage restrictions, encrypted volumes located on SD cards must be placed under /Android/data/sushi.hardcore.droidfs/ if you want DroidFS to be able to modify them.

Building from source

You can follow the instructions in BUILD.md to build DroidFS from source.

Third party code

Thanks to these open source projects that DroidFS uses:

Modified code:

Borrowed code:

Libraries:

droidfs's People

Contributors

anon7250 avatar atrate avatar cyanwolfg avatar hardcore-sushi avatar muhmmad14333653 avatar solokot avatar symbuzzer avatar torsten-pf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

droidfs's Issues

Freezes when opening large volume

I have a Gocryptfs volume containing over 22,000 files, total size 2.6 GiB. There are a dozen top level directories, and most of the files are about three or four directories deep.

When I open that volume in DroidFS, the app freezes in the browser page. It just shows "Location: /" and "N//A" in the top bar and becomes unresponsive. If I wait until the phone blanks its screen, then when I reawaken it, DroidFS has ceased trying to open the volume, and has returned to the home page with the three buttons, and is responsive again.

I enabled the "Keep volume open when the app goes in background" unsafe feature and tried again. About 9 minutes after opening the volume, DroidFS populated the file browser with all the top level directories in the volume, and I could then successfully navigate the folders and view files. However, this only happened twice. On four other attempts, DroidFS remained frozen on a blank page for up to 30 minutes before I used "Force stop" on the app.

Once the volume was successfully open, there was a delay to close it as well. After pressing OK on the "Warning! Are you sure...?" pop-over dialog, DroidFS froze for about 30 seconds with the dialog still visible, then returned to its home page.

Opening and closing a small Gocryptfs volume that contains about a dozen files works fine, with no freezes or delays.

f-droid

hi , can you please consider adding your app to f-droid , it would have bigger audience and allow us to get auto updates

error when creating files with the same names

inside the container, you can create two files or two folders with the same names but with different case

I can create two files
abc.txt
ABC.txt

this is incorrect from the point of view of the file system.

I ask you to ignore the case and consider two files with the same names - completely the same and forbid creating them.

Files cannot be opened/exported

Environment

Device

  • Android 10, not rooted
  • DroidFS 1.4.0 (release from github)
  • Folder is managed by syncthing
  • Active unsafe features:
    • Allow exporting/decrypting
    • Allow opening files with other applications
    • Allow sharing wfiles via the android share menu
    • Allow saving password hash using fingerprint

File's Source (= where files were encrypted)

  • Linux
  • GoCryptFS v1.8.0

On the host, the same decrypted files are opened.

Other

Files are synced to the phone from the host using syncthing.
Files are gocryptfs'ed on the host using reverse mode

Problem

Files cannot be viewed/exported from DroidFS

Context

Volume is opened w/o issues, files are listed. The timestamps and dates are valid:

droidfs-ls

Attempt to open common file format (jpg, txt) from the application itself causes:

image

The same when file is to be opened using external application: cannot be opened.

Copy of file to the same volume within DroidFS but with a different name leads to a file with a 0-byte size:

2021-01-19_18-48

Any recipe by the way to build an apk using any ready-to-go docker image with NDK to avoid this build-dependency nightmare? :) That would allow to debug the issue first.

How to export files from a volume

Sorry this is a noob question.
I am not finding the way to export encrypted files out of the volume and make them normal files.
Please help me.
Thank you.

Volume's Total size UI issue

Hello!

The total size of the volume does not fit in the info line. The localized string is only 2 characters longer than the original English, which hardly matters. Here is a screenshot from the screen of Xiaomi Mi 9 Lite phone:
Screen size (inches) | 6.39
Resolution | 1080x2340 pixels
Pixels per inch (PPI) | 403
TotalSize-UI-issue

By the way, there is no logo size issue on this screen (#16).

Allow read-write access when opening files with external apps

Hi, the app currently doesn't allow to edit files. Even if we open it with an external app, when we want to save it, we got an error.
Am I doing something wrong ? Or is it just not compatble ?

Thank you for your work, great to see gocryptfs support on android !

missing files and folders

I create a new volume and add the parent folder to the volume and lose all the sub files and sub folders of parent folder data

Folder imports

Could you add an option that makes it possible to import entire folders (recursively) without having to select every single file?

crash when deleting image

Android 9
DroidFS version 1.4.4

The app crashes when attempting to delete an image using the trash can icon while viewing that image. Does not crash when deleting via selecting with long press and then pressing the trash can icon.

Project_04-06_HD.720p_MEDIUM_FR30.mp4

[Feature] Allow mounting volumes with root

A significant improvement would be to allow DroidFS to mount volumes under specified directories, such as /mnt/media_rw or in /storage using root permissions or a Magisk module.

-plaintextnames

I'm trying to open a volume that has been created without obscured file names (created with gocryptfs option: -plaintextnames)
When I can open it with DroidFS it shows as empty.
I suspect this might be because of the missing .diriv file (filename encryption hash)?
Can DroidFS open such volumes? If it's the missing .diriv, is it possible to create an equivalent file for a plain text volume?

Sort menu logic issue

The ascending and descending sorting menu items have a different order of items:
ascending: name, date, size
descending: name, size, date
This is unintuitive.

Version 1.5.0 corrupts new files

Version 1.5.0 spoils newly added files: after a message about supposedly successful addition to the volume, it displays an error "Unable to load file". Files added to the volume by the 1.4.х application open normally in 1.5.0, but new files are unavailable (for exporting from the volume too).

Both the update installation and the clean installation with the creation of a new volume were tried. 100% error reproduction.

OS: MIUI 11 Andoroid 9

screenrecord.mp4

File / folder list ordering

At first I thought some items were not listed but it's because when listing alphabetically, upper case items are shown first, then lower case are shown after (so the order is A..Za..z).
So if you look for something beginning with w, it could be about half way down (if it's upper case) or near the very end (if it's lower case).

It would be more useful (and like every other file listing I know) to sort by letter then case i. e. aA..zZ.

Similarly, folders seem to be included in the list mixed in with files. I realise this may just be personal preference but I am used to seeing folders at the start of the list (some managers have this as an option, most do it automatically in my experience).

Other than these suggestions, thanks for making this great app!

Updating readme to mention reccomended NDK version for building

Hello,

as I've noticed, when attempting build if using some NDK version's (Such as the newer rc's, or even the newest stable 22, it'll error out during the compilation process. The latest version of the NDK I was able to get working was 21.3.6528147. Can you mention the reccomended version, maybe that of what you use to compile it? Sometimes this trial & error can get annoying.

Thank you :)

Support decrypting a folder in cloud storage

Thanks for this app!

I use a gocryptfs in a folder on cloud storage (specifically, Seafile).

On my phone, I have the Seafile app installed, and it created like a "mount" for it, I don't know the exact term, but I can see my Seafile even in a regular file manager, if that makes sense, and I think the files are being downloaded on demand.

Screenshot

image

When I click on "Open Volume" in DroidFS and click on the folder icon to select a folder, on the left I see my device and the Seafile mount, I can explore it, navigate inside and select it like so:

Screenshot

image

Once I press "Use this folder", the following two things happen:

  1. I get a dialog saying "Warning! DroidFS can't write on removable SD cards. You will only have read-only access to the volumes therein."
  2. The volume path is not filled, it's still empty, so I can't even open it for read-only access

Do you think it would be possible to support cloud storage? I think this would open a lot more use-cases for this app.

Unable to retrieve the selected path on removable media

OS: Android 10
Device: Moto G5+
Platform: ARM64
DroidFS version: 1.5.2

Cannot select a path on removable 8GB exFAT flash drive connected via USB OTG. Attempting to choose the volume path on the flash drive shows "Error: Failed to retrieve the selected path".

go cannot find main module?

Hello,

OS: Kubuntu 21.04
Go Version: 1.16.5
NDK Version: 21.4.7075529
Latest version of Android Studio Stable

when attempting to build DroidFS from any release tag of v1.4.5 & higher, then last command according to readme when being run take a few minutes and displays error:

make[1]: Leaving directory '/home/dhammel/Android/Project/DroidFS/app/libgocryptfs/openssl-1.1.1k'
go: cannot find main module, but found .git/config in /home/dhammel/Android/Project/DroidFS
to create a module there, run:
cd ../.. && go mod init
Done.

it seems as if the go build command, nearly the last step of the build.sh script, seem to cause this error and I can't seem to find out why. libgocrypfs.so, doesn't get built because of this.

I followed all directions of readme, so i have all the needed go modules, libgocrypfs submodule is included, openssl...

Build release tag v1.4.4 or below works, anything higher yields this error.

Big logo UI issue

Hello!

On phones with not very large screens, the logo takes up too much space, pushing the main menu into the scrolling area. For example, a screenshot of the Xiaomi Redmi 5 phone is shown. Characteristics of its screen:
Size | 5.7 inches, 83.8 cm2 (~75.9% screen-to-body ratio)
Resolution | 720 x 1440 pixels, 18:9 ratio (~282 ppi density)
BigLogo-UI-issue

Unable to view some images

OS: Android 10
Device: OnePlus 6
Platform: ARM64
DroidFS version: 1.6.0

This happens only when trying to view images bigger than 5MB, it just shows a black screen. I managed to record some logs when opening one of said images.

logcat_10-22-2021_04-47-44.txt

backup of encrypted data

now you can export files in an unencrypted type from a hidden volume. it's not safe. I ask you to make a backup function when all the data is packed in a zip archive in encrypted form.

that is, it is a simple data packaging in a zip archive with the name: containerName_date_time.zip

you can also implement data recovery from a backup from a zip archive.

Feature Request - Support XChaCha20-Ploy1305

gocryptfs v2.2.0 was released 5 days ago.

With it came the ability to use XChaCha20 instead of AES-GCM to boost performance on devices without AES hardware.

Having this as an option in DroidFS would be pretty terrific.

Related: If there is still some interest in supporting cryfs in DroidFS, cryfs from version 0.11.0 uses XChaCha20 as default as well.

Rename option does not work on android 5.1.1 (lollipop)

Hello,
So I created a volume in the Android/data/sushi.hardcore.droidfs directory on the sd card. The problem is that whenever I try to rename anything, a file or a folder it always shows "Error Failed to rename file/folder". The same thing happens to volumes created inside the internal storage too. This happens in a device running android 5.1.1. I tested the app on another device running android 11, this does not occur on that in either locations. The version I am using is the latest v1.7.0, downloaded from github releases.

[BUG] App crash with Portuguese translation

Description

If the system language is set to Portuguese (or Brazilian Portuguese), the app crashes when trying to open app settings or open container.

Steps to reproduce

  1. Set system language to Portuguese (or Brazilian Portuguese)
  2. Open App Settings

Advanced volume lock control

now it is possible for the container to remain open when switching to another application. but there is no lock function if the screen is locked or after a certain amount of inactivity.

Entering the password immediately for selected one container

most often you need to run the program and open the container. I ask you to implement the function when, when the program starts, a password entry window opens immediately for a specifically selected one container. it's easier and faster this way.

information when recording a video

now, when recording a video, there is no information about how much time has been recorded and there is no information about the size of the file. I ask you to add to the screen the time how much time is recorded and what is the file size.

useful and necessary information on the screen is very good

I can't open the settings if the volume is open

I ask you to make it possible to open the application settings when the encrypted volume is open. you can't do this now, you need to close the volume and only then you can get into the settings

[Feature request] Use without storage permission

As the app can use app storage, "hidden volume", Allow the app to bypass the "Permission denied" dialog.

Alternatively, use SAF(Storage Access Framework) to allow restricted access to a specific folder instead of all storage

Add thumbnails for pictures and videos

Hello,

I think it would be nice to have thumbnails for pictures and videos in files browser.
While this kind of files does not always have a talkative filename, for now they are a bit difficult to manage because we have to open each to figure out which one it is.

Thanks and congratulations for this nice project !

move the open container button

after entering the password, you need to click on the open button, but the button is closed by part of the keyboard. I ask you to move the button above so that it is convenient to press open

fs

Extract files in background

It would be great if this could become a background process that sits in the notification tray. Extra points for a progress bar!

LAN access?

Is it possible to open a SMB server URL with this?

Question

  1. Can I Use Other File Explorer?
  2. Non Root Yes?
  3. What Is Caveats When I Use DroidFS?

Bug in light mode

v1.7.0 If the dark mode is not switched on, the writing can no longer be read because it then has the same color as the background. No matter what design.
Android 11 Samsung german

Crash on start

Version 1.4.5 from F-Droid.
Device Info:
Android build version: G930W8VLS8CTI1
Android release version: 8.0.0
Android SDK version: 26
Android build ID: R16NW.G930W8VLS8CTI1
Device brand: samsung
Device manufacturer: samsung
Device name: heroltebmc
Device model: SM-G930W8
Device product name: heroltebmc
Device hardware name: samsungexynos8890
ABIs: [arm64-v8a, armeabi-v7a, armeabi]
ABIs (32bit): [armeabi-v7a, armeabi]
ABIs (64bit): [arm64-v8a]
System language: en-US

FATAL EXCEPTION: main
Process: sushi.hardcore.droidfs, PID: 12642
java.lang.RuntimeException: Canvas: trying to draw too large(134468880bytes) bitmap.
	at android.view.DisplayListCanvas.throwIfCannotDraw(DisplayListCanvas.java:229)
	at android.view.RecordingCanvas.drawBitmap(RecordingCanvas.java:97)
	at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:529)
	at android.widget.ImageView.onDraw(ImageView.java:1367)
	at android.view.View.draw(View.java:20373)
	at android.view.View.updateDisplayListIfDirty(View.java:19318)
	at android.view.View.draw(View.java:20096)
	at android.view.ViewGroup.drawChild(ViewGroup.java:4421)
	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4207)
	at android.view.View.updateDisplayListIfDirty(View.java:19309)
	at android.view.View.draw(View.java:20096)
	at android.view.ViewGroup.drawChild(ViewGroup.java:4421)
	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4207)
	at android.view.View.updateDisplayListIfDirty(View.java:19309)
	at android.view.View.draw(View.java:20096)
	at android.view.ViewGroup.drawChild(ViewGroup.java:4421)
	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4207)
	at android.view.View.updateDisplayListIfDirty(View.java:19309)
	at android.view.View.draw(View.java:20096)
	at android.view.ViewGroup.drawChild(ViewGroup.java:4421)
	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4207)
	at android.view.View.updateDisplayListIfDirty(View.java:19309)
	at android.view.View.draw(View.java:20096)
	at android.view.ViewGroup.drawChild(ViewGroup.java:4421)
	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4207)
	at android.view.View.updateDisplayListIfDirty(View.java:19309)
	at android.view.View.draw(View.java:20096)
	at android.view.ViewGroup.drawChild(ViewGroup.java:4421)
	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4207)
	at android.view.View.draw(View.java:20376)
	at com.android.internal.policy.DecorView.draw(DecorView.java:980)
	at android.view.View.updateDisplayListIfDirty(View.java:19318)
	at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:686)
	at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:692)
	at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:800)
	at android.view.ViewRootImpl.draw(ViewRootImpl.java:3496)
	at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3283)
	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2818)
	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1780)
	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7827)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911)
	at android.view.Choreographer.doCallbacks(Choreographer.java:723)
	at android.view.Choreographer.doFrame(Choreographer.java:658)
	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
	at android.os.Handler.handleCallback(Handler.java:789)
	at android.os.Handler.dispatchMessage(Handler.java:98)
	at android.os.Looper.loop(Looper.java:164)
	at android.app.ActivityThread.main(ActivityThread.java:6944)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)

mount request

mounting to the filesystem would be nice if you have root on your device.

Thanks...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.