MX Player Ready to Rock on Lollipop

A good video player should be reliable and free. One of the XDA Community Apps, MX Player, meets both of … more

How to Disable Data Encryption on Nexus 6

In late September, Google decided to step on NSA’s toes and turn on encryption by default in … more

DJI Phantom 2 Vision+ Review – XDA TV

The holidays will be here in no time, so why not start thinking about gifts now? Youll be ahead … more

Mozilla Ditches Google, Makes Yahoo Default Search Engine

Mozilla and Google have had a long-standing relationship of about 10 years. Google … more

Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[SOLVED] Mount a smb/cifs share

OP sendan

16th February 2014, 10:02 PM   |  #1  
sendan's Avatar
OP Senior Member
Flag Appleton
Thanks Meter: 103
 
576 posts
Join Date:Joined: Dec 2009
More
Thank you in advance if you can help with this, unfortunately I'm not going to be able to follow through with this very well at the moment. If this gets no attention I'll bump it when I can follow through.

I want to mount a smb/cifs share from my router to my Nexus 5.

I can successfully mount the share and view it in terminal but none of it shows up in any apps...and that's pretty much my issue.


Here's some unimportant info, and a little info about me, I'm as scatterbrained as they come. The reason I want to do this is to stream my movies on the "NAS" to my Chromecast through Allcast or something.

As of now I'm using an entware mini dlna package on the router to stream everything to Avia. My problem is dlna broadcasts all my media to my entire network...no password required or anything. Also accessing my files through Avia is a pain in the ass, navigating through the folders repetitively gets exhausting.

Here's what I've come up with so far:

I'm using hammerhead-faux123-010m kernel, and SlimRC3.

CIFS DebugData:

Code:
CIFS Version 1.78
Features: posix xattr
Active VFS Requests: 0
Servers:
1) Name: 192.168.1.1  Domain: WORKGROUP Uses: 1 OS: Unix
NOS: Samba 3.0.37	Capability: 0x80e3fd
SMB session status: 1	TCP status: 1
Local Users To Server: 1 SecMode: 0x3 Req On Wire: 0
Shares:
1) \\192.168.1.1\NAS Mounts: 1 Type: NTFS DevInfo: 0x0 Attributes: 0xf
PathComponentMax: 255 Status: 0x1 type: 0 

MIDs:
The disk is actually Ext3, not NTFS.

This guy kinda just crushed all my hopes and dreams of the future but I'm trying to use his OneClickMount alpha app.
http://forum.xda-developers.com/show...&postcount=127

app here:
http://forum.xda-developers.com/show...&postcount=129

This is what I have tried, I ended up with the same results:

Code:
root@android:/storage/emulated/0/cifs # setenforce Permissive
root@android:/storage/emulated/0/cifs # getenforce
Permissive
root@android:/storage/emulated/0/cifs # mount -r -o noperm,rw,file_mode=777,dir_mode=777,uid=1023,gid=1023,unc=\\\\192.168.1.1\\NAS,username=***,password=*** -t cifs none /storage/emulated/0/cifs
root@android:/storage/emulated/0/cifs # ls
My Music
My Pictures
My Videos
Torrents
Then I tried OneClick Mount app:

https://www.dropbox.com/sh/muabb9vp1i8ubxt/o78FSYMcHo

From what I can tell from the app logcat, the app tries to move the debuggered file, create its own with a chosen command inside, start then stop it, and restart the original.

I might try to do this manually later, as in a month from now at the least. I'm pretty sure a certain someone is pissed off at me for not becoming one with the universe n all that jazz.
Last edited by sendan; 19th February 2014 at 09:00 PM.
16th February 2014, 10:45 PM   |  #2  
sendan's Avatar
OP Senior Member
Flag Appleton
Thanks Meter: 103
 
576 posts
Join Date:Joined: Dec 2009
More
I'm gonna leave a couple links here so I can delve into them later, they seem to have crazy amounts of useful information:

[HINT] How Stickmount (and others...) are working with Android 4.2

Debuggered script

Sincerely, Head is spinning
18th February 2014, 03:54 PM   |  #3  
Senior Member
Flag Toronto
Thanks Meter: 334
 
735 posts
Join Date:Joined: May 2011
More
Sorry but as of android 4.4.2 CIFS at a device level (all accounts see the network shares) no longer works and no one has a solution. This includes rooted devices and custom Roms. Of course apps such as ES File Explorer can have network share accesses but not all apps can utilize that access. For example MX player can be invoked from an ES file folder by clicking on a video file but apps like PowerAmp cannot see those folders. Some apps include built in network share features but they have the same restrictions as I previously described.

Things all changed when Android included multiple accounts and security started to get tighter. Initially developers found ways around those measures but too my knowledge, with 4.4.2 no one has found a work around.

Sent from my Nexus 10 using XDA Premium HD app
18th February 2014, 04:16 PM   |  #4  
rootSU's Avatar
Senior Member
Flag Oxenhope, West Yorkshire, UK
Thanks Meter: 13,336
 
24,422 posts
Join Date:Joined: Aug 2010
More
Quote:
Originally Posted by 3DSammy

Things all changed when Android included multiple accounts and security started to get tighter. Initially developers found ways around those measures but too my knowledge, with 4.4.2 no one has found a work around.

Sent from my Nexus 10 using XDA Premium HD app


One workaround is hijack a system process such as debuggerd (debugger daemon) which runs with higher than su permissions. This method still works but is awkward to exploit manually. Apps such as foldermount use this workaround but not for network mounting, but it shows that it is still possible.
18th February 2014, 04:26 PM   |  #5  
Member
Thanks Meter: 5
 
53 posts
Join Date:Joined: Apr 2012
More
I have a Raspberry Pi running OpenELEC for streaming my locally stored media. I use my Chromecast for streaming Netflix, Google Play media, etc.

I understand what you are trying to do, but a dedicated device works great for me.

That said, you might keep an eye on VLC to see if they start supporting casting to Chromecast. That would likely accomplish what you are asking.
18th February 2014, 08:26 PM   |  #6  
sendan's Avatar
OP Senior Member
Flag Appleton
Thanks Meter: 103
 
576 posts
Join Date:Joined: Dec 2009
More
Quote:
Originally Posted by rootSU

One workaround is hijack a system process such as debuggerd (debugger daemon) which runs with higher than su permissions. This method still works but is awkward to exploit manually. Apps such as foldermount use this workaround but not for network mounting, but it shows that it is still possible.

This is what I'm going to attempt next, from what I read it can be terribly inconsistent if not done through SSH, so that's a bummer. I just need to get more information on how to do it. Debuggered in general confuses me.

Quote:
Originally Posted by embhorn

I have a Raspberry Pi running OpenELEC for streaming my locally stored media. I use my Chromecast for streaming Netflix, Google Play media, etc.

I understand what you are trying to do, but a dedicated device works great for me.

That said, you might keep an eye on VLC to see if they start supporting casting to Chromecast. That would likely accomplish what you are asking.

This is what I've been wanting to do with my old Galaxy Nexus. I have the HDMI adapter and everything but the screen is broke (the digitizer works), so I plug it into my TV and randomly hit the screen hoping to eventually connect my bluetooth mouse lol. No such luck. I wish I could just boot it into a custom build but that's never gonna happen. Unless OpenELEC works on android devices? Seems unlikely.
18th February 2014, 08:39 PM   |  #7  
rootSU's Avatar
Senior Member
Flag Oxenhope, West Yorkshire, UK
Thanks Meter: 13,336
 
24,422 posts
Join Date:Joined: Aug 2010
More
debuggerd can be replaced with a shell script with the mount command in it and it will run at boot.

It's really messy. I found I had to put the original debuggerd back or the phone would lock up.

Sent from my Nexus 5 using Tapatalk
The Following User Says Thank You to rootSU For This Useful Post: [ View ]
18th February 2014, 11:24 PM   |  #8  
sendan's Avatar
OP Senior Member
Flag Appleton
Thanks Meter: 103
 
576 posts
Join Date:Joined: Dec 2009
More
WEEEEEOOOOOOO I finally got all my stuff to show in a file manager, now I just need to find a terminal command to trigger media scan on the folder. Right after I eat a bunch of chicken.

Awesome, it works perfectly. And by perfectly I mean it's the messiest thing I've ever done on Android. I'm not really sure how this affects battery and all but thank god this finally works.
Last edited by sendan; 18th February 2014 at 11:42 PM.
19th February 2014, 12:32 AM   |  #9  
sendan's Avatar
OP Senior Member
Flag Appleton
Thanks Meter: 103
 
576 posts
Join Date:Joined: Dec 2009
More
For anyone interested:

Follow the directions in this post.

I didn't understand the mount command he used so I used

Code:
/system/xbin/busybox mount -r -o noperm,rw,file_mode=777,dir_mode=777,uid=1023,gid=1023,unc=\\\\192.168.1.1\\NAS,username=***,password=*** -t cifs none /data/media/0/cifs
You also need to use /data/media/0/ otherwise it will only work in already opened apps apparently.

So thanks rootSU...And that should work, I'm going to do it in a way where I don't have to use scriptmanager but that's the gist. All the credit goes to the people in the threads I linked, I have absolutely no idea what I did here and I learned nothing.

Nothing special to see here.
19th February 2014, 08:46 PM   |  #10  
sendan's Avatar
OP Senior Member
Flag Appleton
Thanks Meter: 103
 
576 posts
Join Date:Joined: Dec 2009
More
Here's a way to unmount it so it doesn't explode your apps when you disconnect WiFi:

/system/bin/debuggerd.binnn

Code:
#!/system/bin/sh
/system/bin/umount_movies.sh
exec /system/bin/debuggerd.bin "$@"
/system/bin/umount_movies.sh

Code:
#!/system/bin/sh
/system/xbin/busybox umount /data/media/0/cifs
/system/xbin/busybox umount -r -o noperm,rw,file_mode=777,dir_mode=777,uid=1023,gid=1023,unc=\\\\192.168.1.1\\NAS,username=***,password=*** -t cifs none /data/media/0/cifs
Script_eject.sh

Code:
#!/system/bin/sh
mount -o rw,remount /system
sleep1
/system/xbin/busybox mv /system/bin/debuggerd /system/bin/debuggerd.binn
sleep 1
/system/xbin/busybox mv /system/bin/debuggerd.binnn /system/bin/debuggerd
sleep 1
mypid=$(/system/xbin/busybox ps -o pid,comm | /system/xbin/busybox grep 'debuggerd' | /system/xbin/busybox awk 'NR == 1 {print $1}')
/system/bin/kill $mypid
sleep 1
/system/xbin/busybox mv /system/bin/debuggerd /system/bin/debuggerd.binnn
sleep 1
/system/xbin/busybox mv /system/bin/debuggerd.binn /system/bin/debuggerd
sleep 1
mount -o ro,remount /system
I'm automating all this with Tasker.

Script task: (I have it run at boot)

waits 15 seconds
run shell command to kill debuggerd
wait 5 seconds
media action scan card /

Script_eject task: (I have it run when I disconnect from my SSID)

run shell command with the script_eject.sh code
wait 6 seconds
media scan card /

It has been seamless so far, also lol.
Attached Files
File Type: zip Tasker_tasks.zip - [Click for QR Code] (1.0 KB, 18 views)

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes