Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose open volumes - HOW #246

Open
kulitnov852 opened this issue Oct 20, 2023 · 20 comments
Open

Expose open volumes - HOW #246

kulitnov852 opened this issue Oct 20, 2023 · 20 comments

Comments

@kulitnov852
Copy link

The Expose open volumes seems to a feature that could well be useful to me. I can't seem to use it.

If I understand correctly, I can access an encrypted volume from my file explorer.

@hardcore-sushi
Copy link
Owner

Volumes need to be opened in DroidFS first. If the feature is enabled, they will be visible in the stock Android file manager. Please note that this feature requires "Keep volume open when the app goes in background" to be enabled as well.

@kulitnov852
Copy link
Author

Unfortunately, it still doesn't work.
Do I need to show how I did this (or maybe someone will show me the process).

@hardcore-sushi
Copy link
Owner

Yes please show a recording of how you do it.

@uChoh5fe
Copy link

uChoh5fe commented Oct 24, 2023

Hi, sorry when I hijack this issue, but I have a similar problem. After opening the volume, I try to open the content with an external app (Keepass@Android Offline). But it fails with the attached error message. Any hints?
screenshot_droidkeepass
all security risks are enabled
Screenshot_20231024-130013

also tested with KessPassDX, same error :-(
Android 9 Phone

@hardcore-sushi
Copy link
Owner

@uChoh5fe Which DroidFS version do you use? I cannot reproduce your issue. What's your kernel version? Can you record your logcat?

@uChoh5fe
Copy link

uChoh5fe commented Oct 24, 2023

DroidFS verson: 2.1.3
Kernel is: 4.4.153-perf+ (Nokia8)
For logcat I used: ANDROID_LOG_TAGS="AndroidRuntime:D KP2A:D SurfaceFlinger:D ActivityManager:D ViewRootImpl:D *:S"
droidfs.log.gz

HTH and thanks for the app and support :-)

EDIT: By the way last working version for me was v2.0.2

@hardcore-sushi
Copy link
Owner

Thank you. Here are the relevant log lines:

10-24 15:01:32.659 23114 23156 D KP2A    : Java.IO.FileNotFoundException: Failed opening content provider: content://sushi.hardcore.droidfs.temporary_provider/6d8677d0-6f77-4ca4-91d7-cf40761fee6d
10-24 15:01:32.659 23114 23156 D KP2A    :   at Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualObjectMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x0008e] in <6fb1725a77344b3e81b15cb69a959b5c>:0 
10-24 15:01:32.659 23114 23156 D KP2A    :   at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeNonvirtualObjectMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0002f] in <6fb1725a77344b3e81b15cb69a959b5c>:0 
10-24 15:01:32.659 23114 23156 D KP2A    :   at Android.Content.ContentResolver.OpenInputStream (Android.Net.Uri uri) [0x00031] in <e74dcf35373743e2bbf871ba34f3d1e2>:0 
10-24 15:01:32.659 23114 23156 D KP2A    :   at keepass2android.Io.AndroidContentStorage.OpenFileForRead (KeePassLib.Serialization.IOConnectionInfo ioc) [0x00035] in <cb5c45a7246849888dd27a4c332b73d6>:0 
10-24 15:01:32.659 23114 23156 D KP2A    :   at keepass2android.PasswordActivity.PreloadDbFile () [0x0004c] in <42803614ceb34f06b4991af4821ce2b2>:0 
10-24 15:01:32.659 23114 23156 D KP2A    :   at System.Threading.Tasks.Task`1[TResult].InnerInvoke () [0x0000f] in <8c1f40060880450f83bb90f0629b1667>:0 
10-24 15:01:32.659 23114 23156 D KP2A    :   at System.Threading.Tasks.Task.Execute () [0x00000] in <8c1f40060880450f83bb90f0629b1667>:0 
10-24 15:01:32.659 23114 23156 D KP2A    :   --- End of managed Java.IO.FileNotFoundException stack trace ---
10-24 15:01:32.659 23114 23156 D KP2A    : java.io.FileNotFoundException: Failed opening content provider: content://sushi.hardcore.droidfs.temporary_provider/6d8677d0-6f77-4ca4-91d7-cf40761fee6d
10-24 15:01:32.659 23114 23156 D KP2A    : 	at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1500)
10-24 15:01:32.659 23114 23156 D KP2A    : 	at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1297)
10-24 15:01:32.659 23114 23156 D KP2A    : 	at android.content.ContentResolver.openInputStream(ContentResolver.java:1017)
10-24 15:01:32.681 23114 23114 D KP2A    : OnFinish message: Ein Fehler ist aufgetreten: Failed opening content provider: content://sushi.hardcore.droidfs.temporary_provider/6d8677d0-6f77-4ca4-91d7-cf40761fee6d

It says it failed to open the content provider, but unfortunately does not say why.

Does this bug also occur with other applications? If so, does this also happen when the file is exported to disk? (It's triggered automatically with large enough files)

@mpacaud
Copy link

mpacaud commented Oct 24, 2023

Hello! Thank you for this free app. I have just installed it and, unfortunately, the "Expose open volumes" seems to not work either in any of the explorers installed despite most of the unsafe options enabled.
Are the Gocryptfs' folders supposed to appear such as mounted USB keys in explorers ?
I'm on an updated Galaxy S22.

@hardcore-sushi
Copy link
Owner

@mpacaud Volumes will not appear in most file browsers. They are not storage devices like USB sticks or SD cards. They should appear alongside cloud storage locations and other application-provided directories in the stock android file explorer. A simple way to check that it's working is to pick a file on your system from within an application (for example, when you want to send an attachment). Open DroidFS volumes should then be visible in the file explorer drawer.

@uChoh5fe
Copy link

Hi @hardcore-sushi

Does this bug also occur with other applications? If so, does this also happen when the file is exported to disk? (It's triggered automatically with large enough files)

Unfortunately yes, I have tried with hexviewer (logcat below). If I export the file everything is fine. BTW I also don't see any "droidfs" volume in the std file explorer.

But has mentioned above, with v2.0.2 it works fine for me.

droidfs_hexviewer.log.gz

@hardcore-sushi
Copy link
Owner

What's your ROM? I see this line in both logs, but I don't know what it means:

10-25 09:22:40.938  1411  4567 W ActivityManager: unstableProviderDied: caller 10059 says ContentProviderConnection{478ad16/sushi.hardcore.droidfs/.content_providers.TemporaryFileProvider->24001:fr.ralala.hexviewer/u0a59 s0/1 u1/2 +10ms} died, but we don't agree

If I export the file everything is fine.

No I mean when you click on "Open with external app" but the file is large enough for DroidFS to choose to export it to disk rather than to memory. Try with a 1 or 2GB file. You will see an "Exporting to disk..." dialog.

I also don't see any "droidfs" volume in the std file explorer.

OK disable the "Expose open volume" feature and open the android file explorer. Then force close it and clear its cache. Next, start a logcat capture, re-enable the feature in DroidFS, open a volume, and re-open the android file explorer. If volumes still don't appear, please send the logcat.

@kulitnov852
Copy link
Author

Here is how I proceeded
https://disk.yandex.com/i/S34UeAV76BtXTQ

@hardcore-sushi
Copy link
Owner

@kulitnov852 You are not using the stock android file explorer. The package name is com.android.documentsui.

On the DroidFS home screen, click on the + button as if you were creating a new volume. Then click on the folder icon on the right to select a path. Then open the file manager drawer by clicking on the hamburger menu in the top left-hand corner. You should see open DroidFS volumes below the text "Open from".

@kulitnov852
Copy link
Author

This way, or
https://disk.yandex.com/i/8JKYsl8Ene6rcw

@uChoh5fe
Copy link

What's your ROM? I see this line in both logs, but I don't know what it means:

Stock Nokia ROM

No I mean when you click on "Open with external app" but the file is large enough for DroidFS to choose to export it to disk rather than to memory. Try with a 1 or 2GB file. You will see an "Exporting to disk..." dialog.

Not tested.

I also don't see any "droidfs" volume in the std file explorer.

OK disable the "Expose open volume" feature and open the android file explorer. Then force close it and clear its cache. Next, start a logcat capture, re-enable the feature in DroidFS, open a volume, and re-open the android file explorer. If volumes still don't appear, please send the logcat.

Ok, if I use the mentioned way to browse filesystem I found a "/storage/..." folder, this seems to works. But why the other apps not recognizing this folder/content?

@kulitnov852
Copy link
Author

This way, or https://disk.yandex.com/i/8JKYsl8Ene6rcw

That's how it's supposed to work.
No way to mount the volumes in another file manager.
At first, I thought that we could use our volumes (decrypted and mounted) pretty much like a usb/a memory card.

@hardcore-sushi
Copy link
Owner

Not tested.

You should test 🙂 If it works, it would means the problem comes from the memory exporting process.

But why the other apps not recognizing this folder/content?

That's how the Android SAF API works. However, some file managers (such as Material files) allow to browse DroidFS volumes by adding them as external storage locations.

@kulitnov852
Copy link
Author

Thanks
It works in Material Files .

@uChoh5fe
Copy link

Hi @hardcore-sushi,
sorry that I can not give more debug infos anymore. I switched to a pixel 7a, there it worked out of the box :-)

So, for me the case is closed.

@hardcore-sushi
Copy link
Owner

I switched to a pixel 7a, there it worked out of the box :-)

Great! So I'd be led to believe that it comes from Nokia's ROM. It would be useful if anybody else could try to reproduce the bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants