[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] nahdude:
Loading cifs.ko md4.ko with smb share accessible to all apps

Better late than never..

Here's one way I managed to get smb shares working with all apps.

I wrote two small scripts named mount_smb.sh and umount_smb.sh that mount and unmount the share.

Then I use the widget feature of Terminal Emulator to create home screen shortcuts to launch the scripts.

To test make sure you have Busybox and Terminal Emulator installed.

Copy the needed modules cifs.ko and md4.ko to /lib/modules.

The modules are here:

https://xdaforums.com/attachment.php?attachmentid=4931691&d=1579570680

Then save the scripts below to your phone, for this example save them in /mnt.

Before you save mount_smb.sh, you will need to edit it to include your smb path, username, and password.

{smb_username} = smb username

{smb_password} = smb password

//{path_to}/{smb_share} = path to smb share

So for example the last line might be:

su --mount-master -c busybox mount -o username=user,password=password,ro,noperm,iocharset=utf8 -t cifs //192.168.1.1/share /mnt/cifs

After both scripts are saved to /mnt, set their permissions to execute.

In Terminal Emulator enter the following:

su -c chmod +x /mnt/mount_smb.sh
su -c chmod +x /mnt/umount_smb.sh
exit

Then close Terminal Emulator.

mount_smb.sh:

#!/system/bin/sh
# load modules
su -c lsmod | grep cifs >/dev/null
if [ "$?" != "0" ]; then
su -c insmod /lib/modules/cifs.ko
su -c insmod /lib/modules/md4.ko
fi
# exit if already mounted
su -c df | grep /mnt/cifs >/dev/null
if [ "$?" = "0" ]; then
echo 'CIFS already mounted'
sleep 4
exit & exit
fi
su -c setenforce 0
su -c mkdir -p /mnt/cifs
su -c chmod -R 777 /mnt/cifs
su --mount-master -c busybox mount -o username={smb_username},password={smb_password},ro,noperm,iocharset=utf8 -t cifs //{path_to}/{smb_share} /mnt/cifs

umount_smb.sh:

#!/system/bin/sh
# exit if not mounted
su -c df | grep /mnt/cifs >/dev/null
if [ "$?" != "0" ]; then
echo 'CIFS not mounted'
sleep 4
exit & exit
fi
su --mount-master -c busybox umount /mnt/cifs >/dev/null
# can't umount if apps are accessing smb
if [ "$?" != "0" ]; then
echo 'Must close apps using smb share before umounting'
sleep 4
exit & exit
fi
su -c rm -Rf /mnt/cifs
su -c setenforce 1

Next create the Terminal Emulator shortcuts.

Press and hold anywhere on the home screen.

Select 'Widgets', then press and hold on the 'Term shortcut' widget and place it on your home screen.

In the 'Arguments' field enter the following:

sh /mnt/mount_smb.sh && exit

Then in the 'Shortcut label' field name the shortcut something, for example 'Mount SMB'.

Now repeat this again for the umount script, but this time in the 'Arguments' field enter:

sh /mnt/umount_smb.sh && exit

Then name the shortcut something, for example 'Unmount SMB'.

If all goes well after launching the mount_smb.sh script, your smb share will be mounted to /mnt/cifs and be accessible to all apps.

Before you unmount the share make sure all apps that were accessing it are closed.

I mostly use this to play media with VLC for Android.

Once the share is mounted open VLC and go to the settings.

Once in settings select 'Media library folders'.

Then tap the three dots to open the menu and select 'Add a custom path'.

Then enter '/mnt/cifs' and tap 'OK.

Now when you open VLC while the share is mounted all media in /mnt/cifs will be available.

[MENTION=10496119]evdenis[/MENTION] the modules were built with just the default options.