Git Product home page Git Product logo

cifs-documents-provider's People

Contributors

poussinou avatar pvagner avatar rebelliousx avatar wa2c avatar yanceychiew 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

cifs-documents-provider's Issues

"Connection failed" when connecting to nas with SMB2 - no apparent activity

This may be a duplicate of #8, but I didn't want to hijack it.

I originally had SMB1 for my NAS - but was able to update it via a plug in.

I can browse the shares as anonymous (to avoid possible password mishaps)

smbclient -L //192.168.1.15 -U "%"
	Sharename       Type      Comment
	---------       ----      -------
	IPC$            IPC       IPC Service (nas)
	video           Disk      
	photos          Disk      
	music           Disk            
SMB1 disabled -- no workgroup available

I can see on the nas's SMB logs that activity is occurring. If I do password authentication I also see that in the log (eg NT_STATUS_WRONG_PASSWORD or succeeded). So I'm convinced the NAS is responding OK.

However when I configure a connection in CIFS Documents Provider:

  • using IP address for host
  • using anonymous (also using username)
  • with or without "folder" selected.
  • (all the rest empty or default)
    I get the toast notification Connection failed.

There's no indication of SMBD activity in the nas's SMB logs, so it feels like no connection was attempted.

I tried to download the APK you referenced, but it returns a 404.

Do I understand #8 correctly - is the current version of CIFS provided refusing to talk to SMB2 devices? Is that what the extra APK was?

Build for Lower Android Versions 6.0+

Comparing to Android Samba Client which was available on Android 6.0.
It would be a great if it was able to compile for Android 6 instead of requiring 8.0

Target would be Amazon Firestick.
App was even published on Amazon Appstore Store, but cannot install due to version of Android (Fire OS 6/Android 7.1 in my case)

Fire OS 5: Based on Android 5.1 (Lollipop, API level 22)
Fire OS 6: Based on Android 7.1 (Nougat, API level 25)
Fire OS 7: Based on Android 9 (Pie, API level 28)

Most Firesticks are running Fire OS 6, so minimum here would be 7.1
Ideally Fire OS 5 would also be supported.

Is this even possible ?

v1.4.0 Regression. Opening large files fails.

I have issues with v1.4.0 reading large files. Specifically, when I open disc images of GameCube console in Dolphin Emulator! The game loads for a second or two, then the emulator gives error messages that it can't read a range of sectors of the disc. Other emulators might not show error messages but silently fails to load the game after the initial load of the first second, such as AetherSX2 and DuckStation (PSX and PS2 emulators).

In v1.3.2 it works fine! No errors or loading issues whatsoever.

I suspect that it is related to the new read buffer code that was added after v1.3.2.
It is possibly similar to #20

On unrelated Issue:
I also hope that @wa2c would give #17 another thought. It would be a boon to the emulators for Android. I can't believe Android doesn't have built in SMB feature. It is even more complicated with SAF and Android 11 storage restrictions. Storing games in the internal storage of the phone or Android TV is becoming really tough. I prefer to have all my games saved in a NAS drive and load them on demand when I need them.

Finding share in Word

Hello,

This may be a misunderstanding on my part, but I thought that I would see a connected device in other Android apps?

I created an SMB connection in CDP. I have Use As Local Storage selected and I have rebooted.

When I open MS Word for Android, I cannot see the device, folder or files anywhere.

Have I missed a step?

Thanks.

Bryan Hunt

Error "Server does not support 128bit keys"

I have SMB2.0 server.
This app has no problems with connecting to my server, while your app throws "Server does not support 128bit keys" error.
Can you support this situation? (I'm not able to change my SMB server as it is closed software)
error

almost all write operations fail (rename, copy file *content*). But delete works. Create folder works

I have strange problem almost making CIFS Documents Provider for write operations misbehaving.

Reading from share is OK. Creating Folder on share is OK. Deleting files & folders is OK

But renaming files &folders fails. And copying files creates zero bytes long files.

(For completeness, copying from share to phone is OK). Even coping from Ghost commander (source: local file, destination : SAF) creates zero byte files.

I tested against two smb servers - I assume not a server problem . From other locations I can fully read-write-delete acccess the shares , without credentials.
I tested anonymous access or with credentials.

I do not suspect the cifs-backend related code, but the saf-backend android related code.

Version 1.4.0. , LineageOS 11

Crashes when recording video to the provided location

Describe the bug
Recording video using the Open Camera app to the selected location on a CIFS share provided by this app works fine when taking pictures but crashes instantly when tapping the record button.

To Reproduce
Steps to reproduce the behavior:

  1. Add a CIFS storage location provided by this app
  2. Install and open the Open Camera app
  3. Under the "More camera controls..." settings, turn on "Storage Access Framework" and select the CIFS location from step 1.
  4. Back out of settings, change to video mode and tap the record button.

Expected behavior
Video is recorded successfully and written to the CIFS share.

CIFS Documents Provider

  • App Versin: 2.0.2
  • Connection Settings
    • Storage Type: SMB2,3(JCIFS-NG)
    • Authantication: Anonymous
    • Safe Data Taransfer: no
  • App Settings
    • Show notification when opening files: no
    • Use as local storage: no

App installed device (please complete the following information):

  • OS: Android 14
  • Device: Pixel 7a
  • Client App: Open Camera

Server (please complete the following information):

Additional context
Recording video works using the "Storage Access Framework" to locations from other providers, including Termux.

When I use SMBJ rename method is failed.

I think this
com.wa2c.android.cifsdocumentsprovider.data.storage.smbj.SmbjClient#renameFile paramer is wrong.
And openFile should use AccessMask.GENERIC_ALL, could rename file.

Bad Shared URI design

This app has bad URI design.

  1. Connection A
  • Host: 192.168.0.1
  • Folder: test
  • SMB URI = smb://192.168.0.1/test/
  • Shared URI = content://com.wa2c.android.cifsdocumentsprovider.documents/tree/192.168.0.1%2Ftest%2F
  1. Connection B
  • Host: 192.168.0.1
  • Folder: test/app
  • URI = smb://192.168.0.1/test/app/
  • content://com.wa2c.android.cifsdocumentsprovider.documents/tree/192.168.0.1%2Ftest%2Fapp%2F

If you select a file "smb://192.168.0.1/test/app/file.txt", this app can't know which setting to use.
(Beacause of shared URI is content://com.wa2c.android.cifsdocumentsprovider.documents/tree/192.168.0.1%2Ftest%2Fapp%2Ffile.txt)

Correct URL design

Separate connection and selected path with ":" (%3A).

  1. Connection A
    Shared URI = content://com.wa2c.android.cifsdocumentsprovider.documents/tree/192.168.0.1%2Ftest%3Aapp%2Ffile.txt

  2. Connection B
    Shared URI = content://com.wa2c.android.cifsdocumentsprovider.documents/tree/192.168.0.1%2Ftest%2Fapp%3Afile.txt

Unable to set an initial folder when using ActionOpenDocumentTree

Hello,
I'm trying to support cifs document provider in my photo viewer app. Now I am having a problem that I can't solve so I hope someone can help here.

Intent i = new Intent(Intent.ActionOpenDocumentTree); i.PutExtra("android.content.extra.SHOW_ADVANCED", true); i.PutExtra("android.content.extra.FANCY", true); i.PutExtra("android.content.extra.SHOW_FILESIZE", true); if (curi != "") { Android.Net.Uri AU = Android.Net.Uri.Parse(curi); i.PutExtra(DocumentsContract.ExtraInitialUri, AU); } i.AddFlags(ActivityFlags.GrantReadUriPermission | ActivityFlags.GrantWriteUriPermission); StartActivityForResult(i, SELECT_FOLDER_REQUEST);

When I add this i.PutExtra(DocumentsContract.ExtraInitialUri, AU); I can make the folder picker to start at specified folder (content uri)
The above code worked for both external storage and removable storage.

But when I use the same code with CIFS document provider it is not effective. is there anything I did wrong?

an example of initial_uri that worked: AU = {content://com.android.externalstorage.documents/tree/05AD-1C45%3A/document/05AD-1C45%3AAPP}

Cryptographic APIs misuses

I'm a PhD student interested in finding security vulnerabilities in open source projects.

We found a total of 32 warnings (indicating potential vulnerabilities) when running the CogniCrypt static analyzer (*) on CIFS Documents Provider (or its library dependencies). We documented each one of these issues in private gists for the sake of confidentiality (non-disclosure).

Can you please let us know whether we can share these gists with you? We are eager to evaluate the perception of developers (e.g. severity of these warnings) and improve CIFS Documents Provider's security, and the quality of the reports of static analysis tools.

(*) https://github.com/CROSSINGTUD/CryptoAnalysis

Can't connect to ksmbd server

I'm using ksmbd as smb server on an openwrt device

This is ksmbd's config

[global]
        netbios name = kvvm
        server string = Ksmbd on OpenWrt
        workgroup = WORKGROUP
        interfaces = br-lan
        bind interfaces only = no
        ipc timeout = 20
        deadtime = 15
        map to guest = Bad User
        smb2 max read = 64K
        smb2 max write = 64K
        smb2 max trans = 64K
        cache read buffers = no
        cache trans buffers = no

######### Dynamic written config options #########

[music]
        path = /opt
        valid users = kvvm
        create mask = 0666
        directory mask = 0777
        read only = no
        guest ok = no

Windows 10 explorer and X-plore filemanager on Android both went well with this setup, but CIFS proveder never worked for it, simply toasting connection failed.

Also I tried toggling "Allow legacy (insecure) protocols/authentication." option in ksmbd, but didn't help.

Screenshot_20211203-115149

Likely there are some compatibility issues, please have a look at this problem.

CIFS process gets terminated randomly.

I am creating this issue for the records and also create a PR #53 will fix this issue.

During tests, if an application is using CIFS Document Provider for a long time, Android OS can kill the process without a warning. Causing the running programs that depend on CIFS Document Provider to be running to fail Sometimes they crash, sometimes they display error messages. For me, it happens while playing some PS2 and PSP games since the disc images are large, they need continuous reading all the time of the disc image, unlike small ROM files which can be read and loaded into RAM for retro system.

I discovered during my tests why I get "Disc read errors" randomly while playing games in the emulators, the Android OS kills the CIFS Document Provider process while the emulator is still reading the ISO file. Not cool, I tried to give CIFS Document Provider "Unrestricted Power Usage" to prevent Android OS from killing the process and that did not help.

I noticed this by coincidence that I didn't get read disc errors while having CIFS Document Provider window open on Windows 11 using WSA at the same time playing some games on PPSSPP on another window (for about an hour). But once I closed the CIFS window, within 2 minutes I got disc read error.

But what I did to fix this, I added a permanent running foreground service that tells Android to leave CIFS Document Provider process alone. Of course, for the foreground service to work, unfortunately there will be a notification displayed in the status bar.

I created a fix for this, and I was able to play for few hours (multiple times on multiple phones) without any issues at all (before, I would get disc read errors due to process being killed within 2-15 minutes maximum).

Where is the local storage folder?

I've just installed this app on a Pixel 3a (Android 12) and I've managed to mount the smb share without issues. I have tested it like this:

  1. Create a new email on gmail.
  2. Attach a document.
  3. Select "Open From" (three bars menu).
  4. Chose CIFS Documents Provider.

When I chose it, it shows the IP address of my NAS and when I tap on it, I get access to the files that I previously configured on the app.

My problem is that I'm trying to figure out where is the local folder in my device. I thought the point of this app was to mount an SMB share on a local folder of your choosing, but there is no option to select a local folder, even though I have ticked "Use as local folder" box and rebooted. Does the app create one folder inside my phone with that share? And if that is the case, where is it?

Smart Audiobook Player/ Listen Audiobook player - root folder error.

Hello, I wanted to utilize this provider to access audiobooks on my NAS via SMB.

I successfully added the share, and the connection functions properly. I can browse files and folders using several apps. However, when attempting to designate the share as the root folder for audiobooks in "Smart Audiobook Player," I encounter an error message: "Please select a subfolder, not the entire storage."

I experimented by creating the SMB share one level above and then choosing the subfolder from the share, but this didn't resolve the issue.

I also tried "Listen Audiobook Player," which doesn't display any errors but still cannot set the root folder.

For your reference, I am using unrooted Android 13 device.

Here is the screen record of error I face:
Screen Record

"Access is denied" with Windows 8.1

Hello.

I set up shared folder on windows without password. When I'm trying to connect to my PC from your app it show "access is denied error", it doesn't show folders too. I also check "anonymous" mark - still doesn't work.
Total Commander's LAN plugin doesn't have this issue. It looks like it uses Guest account to login, however when I use this in CIFS documents provider it gives me thies error: "IPC signing is enforced, but no signing is available"

Just a quick question about the saf provider

is it possible for a client program to connect/communicate to cifs documents provider without using the system documentsui picker? because there is no picker in most of the android tv... thanks.

Can read but not write data

Unknown issue for me that only happens if I'm using cifs-documents-provider:

Read Files/Folders = YES
Create Files/Folders = YES (but only 0 byte files can be created)
Rename Files/Folder = YES
Delete Files/Folders = YES
Write/Modify Files = NO! (only happen with cifs-documents-provider. Access any other way is working fine)

I tried with 2 different Samba shares. One shared from Windows, another shared from Debian and both are the same way.

Both of my samba shares I can access from other apps and write files just fine. I can mount them in Windows/Linux/ChromeOS and all behaving properly where I can read and write without problem.

This is only happening to me with cifs-documents-provider but I don't know why. I tested with 2 of my android devices Samsung Galaxy and Google Pixel, Samsung is Android 12 and Pixel is Android 10.

I installed Material FIles ( https://github.com/zhanghai/MaterialFiles ) and it gives me this error when I try to write files through cifs-documents-provider:

error while writing
There was an error writing "file.txt". java.io.IOException: write failed: EBADF (Bad file descriptor)

Material Files also has ability to add network storage so when I add the samba server through Material FIles (Menu -> Add storage -> SMB Server) I can read/write perfectly with Material FIles. Only problem happens if I try to use cifs-documents-provider (Menu -> Add storage -> External storage -> choose CIFS Documents Provider from the side menu and add the share to Material Files).

Any app that I use and I want to open a file from CIFS Documents Provider, the file will open, but cannot write. Here Material Files is just for example of one app. But it happens for all apps.

I don't know why. I'll be happy to try anything if you have suggestions.

Otherwise it's a very good app at least for read-only. But to be able to write will be even better. Thanks.

Moving file bug

APP Version:

1.1.0


Fault function:

moving file


Problem Description:

when requesting to move a file, sometimes what the program actually does is to rename the source file to the name of the target directory (not including its parent directory), sometimes it does nothing or occasionally succeeds.


Bug Found(maybe):

/app/src/main/java/com/wa2c/android/cifsdocumentsprovider/domain/repository/CifsRepository.kt#L253

suspend fun moveFile(sourceUri: String, targetUri: String): CifsFile? {
         return withContext(Dispatchers.IO) {
         //...
             Uri.parse(targetUri).lastPathSegment?.let { renameFile(sourceUri, it) }   // **H E R E**
         //...
        }
 }

The above code uses renaming to move files on the same server, but the new file name argument passed is only the last segment of the target uri.

/app/src/main/java/com/wa2c/android/cifsdocumentsprovider/domain/repository/CifsRepository.kt#L203

    suspend fun renameFile(sourceUri: String, newName: String): CifsFile? {
        return withContext(Dispatchers.IO) {
            val targetUri = if (sourceUri.isDirectoryUri) {
                sourceUri.trimEnd('/').replaceAfterLast('/', newName) + '/'
            } else {
                sourceUri.replaceAfterLast('/', newName)                                         // **H E R E**
            }

The uri of the target directory will be prefixed with the source file directory. This logic seems to only apply to renaming files in the same directory.

/app/src/main/java/com/wa2c/android/cifsdocumentsprovider/domain/repository/CifsRepository.kt#L40

    /**
     * True if directory URI
     */
    private val String.isDirectoryUri: Boolean
        get() = this.endsWith('/')

In the actual test, the directory uri did not end with "/", and #L205 is always false.

Therefore, if the source file and the target directory are at the same directory level, the move can be successful, otherwise it will have unpredictable consequences.

Selecting directory fails for certain apps

Hello,

When it comes to selecting a directory from the "Open From" files app, some apps won't even
show CIFS Document Provider as an option, such as Duckstation, AetherSX2, fMSX emulators for PSX, PS2 and MSX.

Please take a look at the implementation of DuckStation of opening and getting URI from a tree:
DuckStation's FileUtil.java

I am not asking to correct the code of such emulators, but to see what is missing in CIFS Document Provider
that prevents such apps from showing the option to select a folder!

Some other apps work fine like the Dolphin, MSX.emu emulators for the WII, GameCube, and MSX. They show that
CIFS Document Provider as an option to select a folder, they show "Access to Shared Folder" from "Open From" window,
and I can indeed select a folder for all of my games in my NAS drive.

I really appreciate your work, it is really helpful when it comes to access my games' library from my NAS
drive on all my android devices, including Android TV. Especially with newer and forced SAF of Android 11 and 12.

Problems with character # on filenames

I have a directory with serveral files with # character like this:

ls

But on the phone the first file is repeated n times:

photo5895355141253609125

Environment:

App version: 1.3.0 from Google Play
Android 10, LineageOS 17.1 (but also on my Galaxy Tab 6 Lite with Android 11)
SMB: Samba 4.9.5

Server for Memento Database

Greetings!
Is it possible to organize the server operation for the Memento Database application? Using the developer's server for personal purposes is expensive for me. The limit for the free version is not enough (3 libraries or 100 MB).
The program's website. I use Android and Windows.
Perhaps you can suggest how to do this, or add functionality to use your application as a Memento database server.
Thanks!

Can connect and download files from samba server but not upload to it.

I am connecting over wireguard to my samba server on Ubuntu (smb3) and can see the "set" share folder and it's contents and I can download files to my android (12) phone. Every time I attempt to reverse the process and save to the server I get a pop-up message, Failed to save document.

Folder permissions: drwxrwxrwx
owner: anj, shagadmin
Samba share permissions:
[OFFSITE]
comment = Android Content
path = /mnt/Entertainment/offsite
browseable = yes
guest ok = no
writeable = yes
write list = shagoo,anj
create mask = 755

Any idea what is wrong?

Thank you!

Thank you!

Thank you for your project and software!

Thank you for maintenance in the past and in the future!

Kind regards and season's greetings!

Copying a file corrupts the file

Copying a file via CIFS documents provider corrupts the file.

Steps to reproduce

  1. Copy a file with the same name and smaller file size as a file on SMB from Android's local storage.

Device : Android 8 and later

Can read but not update files in Word

I have connected to a Windows share (Server 2019) using CIFS provider and can open files on it but cannot save any changes made to the files. No error message but no update written.
Also new files saved to the share are 0kb long.

Connection failed when creating new share

I want to connect to the samba share hosted on my GL.Inet MT1300 router. In cifs documents provider I do this:

  1. click on the add button
  2. select the appropriate item in the list with ip 192.168.8.1
  3. choose IP address in the popup
  4. click the folder icon or the check connection button and I just get a "connection failed" message
  5. check "anonymous"
  6. point 4 again

Of course I tried entering the router login instead of choosing anonymous, and I tried setting the folder manually to "/" and to "GL-Samba", all combinations always result in the same error message. I can't see any details about the reason of the failure. I tried on two different phones.

Note that if I use the Ghost Commander app with the Samba plugin on the same phones, I can just browse to 192.168.8.1 normally without any login and without any issues. Mounting from linux also works fine with this command: mount -t cifs //192.168.8.1/GL-Samba /mnt/samba -o defaults,guest,iocharset=utf8,rw,vers=1.0,uid=nobody,gid=nobody,file_mode=0770,dir_mode=0770,exec,nounix

Please support seedvault

Currently, DAVX5 and Nextcloud could be used with seedvault, but I need your App to access my NAS to store my LineageOS Backup.

Slow performance during upload via provider

I started to copy some data and upload speed cannot exceed 10 Mbps. Checked CIFS share and that's not a problem (via ethernet I can reach speeds available around 1 Gbps), also WiFi works well (LAN plug-in for Total Commander pushes data at full available speed).

Is it possible to fix it?

Probleming seeking on large files on cifs documents provider

Hello,
I am developing a video player for android, I want to support SAF and CIFS documents provider.
Now I am trying to implement code to play large video files on network drives (Windows 10).
But I have problems seeking on these files, the seekto was not successful and an on video completion event on mediaplayer is then fired.

I have already tried the same codes on Nvidia Shield's SMB network drive SAF implementation and got a success.
any idea?

AndroidTV navigation is broken

Version 1.7.0 (17)

You can't select the new folder or anything, and it's nearly impossible to navigate around. I'm sure this is a great app, but it's been this way since last year 😢

add explenation for input fields

Host, Username and Password are obvious.

But what is meant with Domain, and DFS?
I searched the internet and Fo}nd an explenation for DFS but not in which condition A Client should activate and in what Condition a Domainis needed.
I assume what safe datatransfer means but I do not know what "Add extension when saving" means.

Abnormally behavier with domain user

At first I found that the program only works occasionally when using email as username.

Next, I read the jcifs code and found that when processing such usernames, the constructor of ntmlpasswordauthenticator will intercept the domain name in the mailbox and put it into another independent domain field.

At that time, I thought this was to be compatible with the format of directly writing the user name in the uri. The documentation of this class also said that the only special symbol that cannot be used is @. I obtained the private constructor of the class through reflection, and successfully established a stable connection with the mailbox name. But this doesn't explain why I was able to obtain files occasionally before.

So I captured the packet and analyzed the other two software that can normally use the mailbox as the cifs user name, and found that the method of dividing the domain name and the user name in solid explorer can work normally, while the full mailbox name is used in fx explorer.

Obviously it is fraudulent to obtain the private constructor, and the login problem of domain users has not been substantially solved.

After tracking the program and reading the anr report, I finally found that using the domain username to obtain the smbfile would cause a deadlock to determine whether it was a trusted domain. The reason is that the jcifs library regards the connection with the domain field as having the DFS service enabled, so it will try to read the named pipe under the target server, which is very arbitrary.

The solution is also clear. When the user knows that there is no DFS on the target server, optionally set the property for CIFScontent to manually disable the DFS,witch was enabled by default.

/app/src/main/java/com/wa2c/android/cifsdocumentsprovider/data/CifsClient.kt#L25

class CifsClient @Inject constructor() { /** * Get auth by user. Anonymous if user and password are empty. */ fun getConnection(user: String? = null, password: String? = null, domain: String? = null): CIFSContext { val property = Properties().apply { setProperty("jcifs.smb.client.minVersion", "SMB210") setProperty("jcifs.smb.client.maxVersion", "SMB300") setProperty("jcifs.smb.client.responseTimeout", READ_TIMEOUT.toString()) setProperty("jcifs.smb.client.connTimeout", CONNECTION_TIMEOUT.toString()) } return CIFSContextWrapper(BaseContext(PropertyConfiguration(property)) .withCredentials(NtlmPasswordAuthenticator(domain, user, password))) }

Whether the following line is executed is up to the user to judge.

setProperty("jcifs.smb.client.dfs.disabled", true.toString())

I translated your manual! + Feature request

Hello! I wanted to try this app on my Google Pixel and I read up on how to use it to the fullest, and figured that I would translate the manual page to English to make things faster for other users!

https://github.com/RaddedMC/CIFS-Document-Provider-Wiki/blob/main/Manual.md

I can't figure out how to PR a wiki so feel free to just add my file into your repo, don't worry about crediting me :)

I also have a feature request, I have a Pixel 7 and see your app show up in Google Files under Other Storage > CIFS Documents Provider

but I can't actually access files this way. Is there a way you could integrate into the Google Files app so that I can more easily transfer files from my Pixel to my server?

Local Storage

where can i find the mount after enabling local storage?

Can't load content at the moment

I did authorize against the university samba quite well and can also see folders without files (so folders which include others folders seem to work).
If I click on a folder with files, the view is empty with a message "Can't load content at the moment".

Checking or unchecking "Safe data transfer" does not seem to help either.

Would be very cool to have this working.
I don't know if this is an issue with the SMB server or with my device

Android 13 - Fairphone 4 - iodeOS

'Use as local storage' shows no files

The 'use as local storage' function in the app does not show files in any apps.
Using document provider function the files show up as expected, also I have made sure to enable the option and have rebooted.
Any suggestions?

Abertura de pasta com maior volume de dados.

Temos uma rede compartilhada entre um servidor windows 10 e um tablet Samsung A7 Lite, e estamos utilizando app CIFS para abrir as pasta no tablet, porem estamos tendo um problema no qual o app não esta abrindo as pastas com maior volume de dados.

Fizemos um teste utilizando o app "Total Comander", e este app abre todas as pastas, então descartamos problemas de conexão com a rede, porém o "Total Comander" não permite que outros app tenham acesso ao caminho da pasta compartilhada, e o CIFS permite, porém o CIFS não esta conseguindo abrir as pasta com volume de dados maior, gostaria de saber se é possível resolver esse problema e como resolver, podem nos ajudar por gentileza com algumas dicas, ou se for o caso talvez atualizando o app?

Scanning files stuck at File Limit minus 1 on some apps.

Hello @wa2c ,

Logcat_CIFS_DocProv.txt

When I scan for files using AetherSX2 or DuckStation emulators, the process will get stuck at the "File Limit - 1". In this case, I have the limit at 8. And it gets stuck at 7. I posted a video before about this in this commit . But this time, I was able to run CIFS Document Provider through Android Studio and provide some Logcat log. Any passwords has been removed from log obviously.

It seems due to some exceptions happening, the Queue added do not match the Queue removed? And the queue never reaches 0 after reading the file. Also not sure if it is normal for a file extension when querying child documents to change from ".iso" to "i00", maybe it is the intended behavior but I don't know.

Edit: I believe the issue started here ( I could be wrong, lol ).
android.cifsdocumentsprovider E Writing exception to parcel java.lang.SecurityException: Document 192.168.4.32/Share/Games/PS2 is not a descendant of 192.168.4.32/Share/Games/PS2/

Because after that exception, the extension changed from ISO to i00. Notice the difference is a front slash at the end? (one is a directory and the other is a document? they are both directories though for the same path)

At the end of the log, the emulator is frozen trying to process the last file.

For me to bypass this issue, I have to increase the file limit to absurd number that is greater than the number of files to be scanned for these specific apps. It is not a critical issue, but it is annoying.

Hopefully you will find the Log useful.

allow copying the folder URI

Right now it is displayed in the "connection" panel but it cannot be copied so it can be used in apps that dont support the content picker.

Man, your app is awsome, it even supports a custom port!!

sftp support (willing to help!)

I managed to compile ssh2 for android, this is a library that supports all sftp/scp/ssh commands and that could easily be used as a backend for your great document provider. I was wondering if you would be interested in supporting it, otherwise I would be happy to implement it myself. If so, do you have any recommendations on how to proceed?

Editing files does not work properly

Problem description

When editing a text file via CIFS documents provider, the file is not saved or is corrupted.

Steps to reproduce:

  1. Copy a text file of about 10 lines to SMB.
  2. Edit to about 5 lines in a text editor and save.
  3. Reload.

Device : Android 9, Android 12
SMB : Windows 10

Other functions are working properly.
Great work.

I guess

The standard procedure for writing a file using the Uri is as follows:
https://developer.android.com/training/data-storage/shared/documents-files#edit

ParcelFileDescriptor pfd = getActivity().getContentResolver().openFileDescriptor(uri, "w");
FileOutputStream fileOutputStream = new FileOutputStream(pfd.getFileDescriptor());
fileOutputStream.write(("Overwritten at " + System.currentTimeMillis() + "\n").getBytes());

However, in Android Q and later, this code no longer truncates the file.
So I added fileOutputStream.getChannel().truncate(0), but CIFS documents provider returns function not implemented error.

Using openFileDescriptor(uri, "wt") instead of openFileDescriptor(uri, "w") will return write failed: EBADF (Bad file descriptor) as in (#29).

Probably the editor that fixed this truncate issue is no longer able to save files. Other editors can write, but the file should be corrupted because it is not truncated (Android 10 and later).

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.