-
-
Notifications
You must be signed in to change notification settings - Fork 62
Implement basic SMB 1.0, 2.0, 3.0+ Network navigation: connect to hosts, list shares, navigate folders, create folders and files #213
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
base: master
Are you sure you want to change the base?
Conversation
Added support to connect to an SMB host, list available shares, and navigate through folders. Users can now browse network drives directly from the app.
Added ProGuard rules to preserve SMBJ and DCERPC classes required for SMB network drive support. This prevents missing class errors during release build with R8 minification enabled.
|
Related to #39 |
… reuse with SMBConnectionManager for improved efficiency
| } | ||
|
|
||
| override fun open(context: Context, anonymous: Boolean, skipSupportedExtensions: Boolean, customMimeType: String?) { | ||
| if(isFolder) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Folders are checked and handled in the files list itself, this check is redundant. This function is only called if this holder is a file not a folder.
I know this isn't obvious, but I'm working on a proper documentation of functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed on c710c23
| _dialogsState.update { it.copy(showImportPrefsDialog = file != null) } | ||
| } | ||
|
|
||
| fun toggleImportPrefsDialogSMB(file: SMBFileHolder?) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the state of this PR (opening files is not implemented yet), this must be removed, otherwise it might cause problems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed on 8583863
|
This is looking so promising! I wanted to test the feature but I couldn't connect to a server, I'm not sure how the port is determined, because there is no input field for it in the dialog, this might be the reason why I couldn't connect. Regarding the integration in the home screen, to make it easier to implement other types of cloud storages and servers, I would suggest the following: 1- In the home screen, there should be a '+' icon button in the same row of the "Storage" label, and when clicked, a drop-down menu (or a dialog) shows with all types of storages to add (for now it will just show SMB, but in the future, there will be FTP, Local Storage, etc). amd from there the dialog of adding new SMB will show. 2- The added storages should show under "Storage" section, so I'd suggest removing the separate section for the SMB from home screen to make it cleaner. 3- the storages that are added should be saved (so that we don't need to rewrite all the credentials every time the app is opened), you can make a data class for SMB storage with all the required credentials (and other information like name, type, etc), and saved it as a set to the datastore in PreferencesManager. Then those will be retrieved and displayed in storage section as discussed in second point. 4- The design of the "add new SMB dialog" must follow the style of the other dialogs in the app. See "Jump to path" dialog for reference. Regarding the SMB implementation, I'm not familiar with the libraries used, so I need to test the app and see if any further improvements required. Huge thanks for your contribution, and I'm looking forward to test the app after fixing the bug regarding connecting to a server. |
Folders are already filtered in the files list, making this check unnecessary. This function is only invoked for files, not folders.
Given the current state of this PR (opening files is not implemented yet), keeping this function could cause issues. It has been removed to prevent unintended behavior.
Fixed the design of the 'Add New SMB' dialog to match the style of other dialogs. f739cfc |
Possible cause: SMB 1.0 Mixplorer likely uses SMB 1.0 (CIFS) for its server feature, which is not supported by SMBJ. To properly test your setup, try sharing a folder using:
|
okay, that's probably why it didn't connect. I thought this is straightforward like FTP, I couldn't find an app that has SMB2 or higher. Anyways, I'll try from Windows. |
|
Initial support for SMB 1.0 added on commit 79ed7e6 using jcifs-ng. Added a dropdown in the SMB connection dialog to select the SMB version. |
|
Thanks, it does connect now, however, using the same setup as before (using mixplorer to make the server), no files are shown, even though when opening the same server on MT Manager, for example, there are shared files. Prism (no shared files shown): MT Manager: |
|
I tested it on my phone with MiXplorer, and it works. However, I noticed that if I enter the wrong port, username, or password, the same thing you showed in the video happens — it doesn’t detect the error, but this only happens with SMB1. I’m going to check that. Still, I can list the shares, view the contents, and create folders and files correctly, both in SMB1 using JCIFS and in SMB2 (Windows and Linux) using SMBJ. |
|
I know for a fact that the username, password and port are correct. In my tests, the username and password are both |
… only if connection succeeds, preventing invalid credentials from being stored
Please click on the "More" button and enter the port manually. The domain is optional. I have already fixed the issue that made SMB1 appear to authenticate correctly without listing the shares. I’ve tested it in Mixplorer and on Linux using SMB2. 539ede6 |
|
I'm still getting the same error despite all credentials being correct (including the port). I'm busy rn, I will try to use Windows when I get a chance. I also tested the anonymous connection, it did connect, but the one folder shown doesn't open (video below). Screen_Recording_20250909_231349_Prism.File.Explorer.mp4 |
- Implements a function to scan the LAN for SMB/Windows file sharing devices. - Displays devices in the format 'hostname (IP:port)'. - Adds a dialog to show the scanned devices and allow selection. - Currently, scanning is based on network and predefined known SMB ports; this could be improved in the future.
|
New LAN discovery feature! Scan your local network for SMB/Windows file-sharing devices and quickly connect to them. Currently, the scan uses predefined SMB ports, but this can be improved in the future. lan_discover.mp4 |
|
I'm really sorry for keeping this pull request hanging like this, but I couldn't make this SMB feature to work in my device, I'm not sure if it's my phone or the network, I need to investigate more. I've tested FTP in this app before and it was much straightforward than this. Thanks. |
|
I’ve also been very busy with my work lately and didn’t have much time to work on the project these last few days. Please don’t make a pull request until the SMB feature is fully implemented (opening files, etc.). I still have pending the following three things you requested in your previous comments:
Also, I still need to run more tests on my side to identify the issue that might be causing problems for you. Thanks. |
|
@Raival-e Hey buddy, don't be too hard on yourself. |
There are a lot of file managers. His accuracy makes this app to point out. |



This PR adds initial support for SMB network drives. Users can now:
SMB Version Support:
Note: SMBJ and jcifs-ng automatically negotiates the highest supported SMB version between the client and server.
Additional Info:
The LAN discovery currently scans the network using known SMB ports (139, 445, 4450). This could be improved in future updates for more comprehensive network detection.
This is the foundation for full SMB integration; future updates will include file operations and improved error handling.
lan_discover.mp4