Through sheer geekitude, I've compiled a custom cifs / windows file sharing kernel module which I'll make available here. This is specifically geared toward rooted CDMA Heros using stock HTC software or the MoDaCo ROM.
First let me lay this out there:
This is not for the feint of heart, does not currently have any automated methods, is not really all that useful in it's current state, and requires your phone to be rooted.
One of the beautiful things about open source, however, is once the tools are available, someone will (hopefully) make it useful. Right now, it's very 'command line' oriented.
What this allows you to do:
Mount Windows / SMB / CIFS fileshares on your Hero, which can be accessed via a file browser such as Astro or Linda file managers.
Copy files to/from your Hero to your PC via these shares.
What this does not allow you to do (currently):
Allow you to stream music / video / images from your PC through the default music player.
The Guide:
Download the attached cifs-module.zip file, extract it somewhere on your PC.
Connect your phone via USB. Run:
Code:
./adb shell
$ su (if you're not already root)
#
If your /system partition isn't already mounted read/write, you'll need to remount it inside the shell:
Code:
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
Change the permissions of the modules folder to allow you to push in the module (again, you should be in the adb shell):
Code:
# chmod 777 /system
# chmod 777 /system/lib
# chmod 777 /system/lib/modules
# exit
$ exit
Now, back at your command prompt, push the kernel module you just downloaded and extracted:
Code:
./adb push cifs.ko /system/lib/modules/cifs.ko
Back into the shell to load it in, reset the permissions, and mount your fileshare.
First, load the module (and fix the /system permissions):
Code:
./adb shell
$ su
# insmod /system/lib/modules/cifs.ko
# chmod 775 /system
# chmod 775 /system/lib
# chmod 775 /system/lib/modules
Congrats so far! You've just loaded in a kernel module! Now to actually use it. You'll want to be connected to your network via WiFi, and have an accessible file share to mount.
Make a folder where you'll mount the share:
Code:
# mkdir /system/remote
Next, mount the share. The username, password, and share name will of course be the info for your local fileshare. The IP I'm using here is just an example, you'll want to use the IP of the PC where your fileshare is located:
Code:
# mount -t cifs -o username=yourusername,password=yourpassword //192.168.1.20/sharename /system/remote
If that goes off without a hitch, you're done! You've successfully mounted a fileshare from your PC to your phone. You can verify by taking a look at the contents:
Code:
# cd /system/remote
# ls
<you should see your list of shared files>
You can also at this point use an app on your phone like Asrto or Linda file manager to browse to this /system/remote folder and copy files to/from your PC!
Again, this is very raw, only tested on my own phone so far, and will really only allow you to copy files to/from your PC. I was able to play a couple of MP3s via Astro, but unfortunately the stock music player can't access the /system or /data folders on your phone, and because your /sdcard is a fat32 filesystem, you cannot mount other filesystems there unfortunately.
If someone knows a good way to get the stock apps reading from the share, please share.
The module is rather large as well, ~ 2.9mb. If anyone can give me some tips on optimizing the module for size, that'd be great - This is the first ARM modules I've ever built, and did so using a cross-compiler, I'm not sure of all the little tricks of the trade yet.
Enjoy!
You might have more luck if you run an ext3/4 fs on the sd card, although I am not sure if that would work.
I tried the above steps on a nexus one running cyanogen mod 5.0.6 and the insmod command failed with a execute error.
Im guessing the model is not build for an ARM v7 chip?!
What were you steps in building the module? I would be keen on trying it myself.
I dropped development on this ages ago as there are far better options available for CIFS/Samba sharing.
Try out EStrong's File Explorer from the market, has a much more usable implementation of LAN file sharing built right in.
I followed these step in order to copy my cifs.ko to modules dir but I get an "out of memory" error when trying to copy the file to the modules dir
any hint?
Can not find a usbdriver for ADB that works for sony ericsson x10i?
http://code.google.com/p/adb-file-explorer/
//dong 2007
dong2007 said:
Can not find a usbdriver for ADB that works for sony ericsson x10i?
Click to expand...
Click to collapse
Not looked hard enough ADB, Fastboot, and Nandroid for Noobs
It is not for X10i, but G1 and droid?
Shall i first install Android SDK?
dong2007 said:
It is not for X10i, but G1 and droid?
Click to expand...
Click to collapse
Worked for me.
dong2007 said:
Shall i first install Android SDK?
Click to expand...
Click to collapse
nephron said:
This Guide is for windows only. If you are using Mac OS X please go here: ADB For Dummies
If you are using Linux please go here: [HOW-TO]Set up Android SDK/ADB/Fastboot on Ubuntu Linux
--------------------------------------------------------------------------
Things you need:
Android SDK - Download
Winrar - Download (32bit) Download (64bit)
Windows PC
USB Cable
--------------------------------------------------------------------------
Setting up the Android SDK
Download the file from above
Unzip to your desktop
Take the "android-sdk-windows" folder and move it to the root of your hard drive (C:\)
Right click on My Computer and click properties
Select the Advanced Tab or Advanced System Setting (Vista/Windows 7)
Select Environment Variables...
Press New
For Variable Name type: adb
For Variable Value type: C:\android-sdk-windows\tools
Now, [Get new sdk (1.5r3) to work]
1. Run SDK Setup.exe
2. If it gives you an error go to settings and click on "Force http//....."
3. Select all options and let it download and install
If you cant get the setup to work, Download the USB-DRIVERS folder - HERE (Windows XP/Vista/Windows 7)
--------------------------------------------------------------------------
Preparing your phone for ADB
Go to Settings on your phone
Select Applications
Select Development
Make sure 'USB Debugging' is checked
--------------------------------------------------------------------------
Installing Drivers
Plug in your phone through USB and DO NOT MOUNT IT!!!!!
Your computer should see a new device and try to install Android 1.0 driver (If it doesnt, scroll down to the "Im not getting a notification of Android ADB when i plug in my USB" section)
Let it load
Once it cant find them select "Install drivers from my pc"
The drivers you need are in the Android SDK 1.5r2 folder (C:\android-sdk-windows\usb_driver)
Depending on your OS pick x86 or amd64
You ADB Android Device should now be installed! Good Job
For Android SDK 1.5r3+
1. Run SDK Setup.exe
2. If it gives you an error go to settings and click on "Force http//....."
3. Select all options and let it download and install
If you cant get the setup to work, Download the USB-DRIVERS folder - HERE (Windows XP/Vista/Windows 7)
--------------------------------------------------------------------------
Check if your phone is detected by ADB
Open up Command Prompt (Go to run, type in cmd, press enter)
Type in
Code:
cd C:\android-sdk-windows\tools === Press Enter
adb devices === You should see your device listed
adb shell === you should see # in the next line
Now you are all set to run adb commands
Note: for a list of commands type in 'adb' in cmd
CONGRATS YOU NOW HAVE ADB FULLY RUNNING!
--------------------------------------------------------------------------
"Im not getting a notification of Android ADB when i plug in my USB"
Why: Your computer has detected your phone but as a protable device and as a storage device.
Fix: This took me a lot of research and time to figure out so this is what your are going to do.
First download USBDeview - Here
Unzip it
Run USBDeview.exe as Administrator
You will see all drivers being used on your computer
Highlight and Uninstall all drivers with the description have HTC Android (Should be 3 of them)
Right Click on the driver and press uninstall
Once done, Unplug your phone and plug it back in
You should now get the notification of the ADB device
Follow the steps above to install the drivers
--------------------------------------------------------------------------
When Typing just adb in cmd you will get whats called a "usage doc" which gives you a lits of commands that you can use:
Code:
-d - directs command to the only connected USB devic
e
returns an error if more than one USB device is
present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is r
unning.
-s <serial number> - directs command to the USB device or emulator w
ith
the given serial number
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must
be an absolute path.
devices - list all connected devices
device commands:
adb push <local> <remote> - copy file/dir to device
adb pull <remote> <local> - copy file/dir from device
adb sync [ <directory> ] - copy host->device only if changed
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb jdwp - list PIDs of processes hosting a JDWP transport
adb install [-l] [-r] <file> - push this package file to the device and instal
l it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data
)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories
)
adb bugreport - return all information from the device
that should be included in a bug report.
adb help - show this help message
adb version - show version num
scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb status-window - continuously print device status for a specifie
d device
adb remount - remounts the /system partition on the device re
ad-write
adb root - restarts adb with root permissions
networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PDP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns
adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:
- If <directory> is not specified, both /system and /data partitions will be u
pdated.
- If it is "system" or "data", only the corresponding partition
is updated.
--------------------------------------------------------------------------
Commands that you should know
adb push - Insert file to phone such as Stock.apk to /data/app_s
Code:
adb push <pathtofile.apk> <file system location> - Example: adb push c:\app.apk /data/app
adb pull - Remove file from phone such as Stock.apk from /data/app_s
Code:
adb pull <pathtofile.apk> - Example: adb pull /data/app_s/Stock.apk
adb install - Install app to phone
Code:
adb install <path to file> - Example: adb install c:/apps/apps2sd.apk
adb uninstall - Uninstall app from phone
Code:
adb uninstall <name of application> - Example: adb uninstall linda.apk
For more ADB Commands go - Here
--------------------------------------------------------------------------
Thats it for ADB! Congrats and if you have any questions please ask me or if anything is missing or not correct please tell me. I got all of this from research and personal experience.
Click to expand...
Click to collapse
XperiaX10iUser said:
Worked for me.
Click to expand...
Click to collapse
Okej I will try it out..
I can´t install Calculator.apk or the modified youtube.apk (High quality set as default) on my X10i????
for the calculator(is it a system apk) ? if yes then you have to push it to /system/app, if not try installing after signing it.
For youtube.apk i am sure it is a system apk and you need to push it to system/app
realunited123 said:
for the calculator(is it a system apk) ? if yes then you have to push it to /system/app, if not try installing after signing it.
For youtube.apk i am sure it is a system apk and you need to push it to system/app
Click to expand...
Click to collapse
I tried this method:
adb shell mount -o remount,rw -t yaffs2 /dev/block/mtdblock2/system
adb push YouTube.apk /sdcard/YouTube.apk
adb shell dd if=/sdcard/YouTube.apk of=/system/app/YouTube.apk
adb shell rm /sdcard/YouTube.apk
adb shell reboot
but still falied ?
I have obviously put youtube.apk into SDcard folder
dong2007 said:
I tried this method:
adb shell mount -o remount,rw -t yaffs2 /dev/block/mtdblock2/system
adb push YouTube.apk /sdcard/YouTube.apk
adb shell dd if=/sdcard/YouTube.apk of=/system/app/YouTube.apk
adb shell rm /sdcard/YouTube.apk
adb shell reboot
but still falied ?
I have obviously put youtube.apk into SDcard folder
Click to expand...
Click to collapse
looking at the screen shot you gave i am sure you haven't pushed it to sdcard .
it should be
Code:
adb push "the path where you have the apk" /sdcard/YouTube.apk
unless you have copied it to android-sdk folder.
And it seems it didn't mount the system to r/w .
Try these:
Code:
adb shell mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
adb push "the path where you have the apk" /sdcard/YouTube.apk
adb shell dd if=/sdcard/YouTube.apk of=/system/app/YouTube.apk
adb reboot
realunited123 said:
looking at the screen shot you gave i am sure you haven't pushed it to sdcard .
it should be
Code:
adb push "the path where you have the apk" /sdcard/YouTube.apk
unless you have copied it to android-sdk folder.
And it seems it didn't mount the system to r/w .
Try these:
Code:
adb shell mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
adb push "the path where you have the apk" /sdcard/YouTube.apk
adb shell dd if=/sdcard/YouTube.apk of=/system/app/YouTube.apk
adb reboot
Click to expand...
Click to collapse
now I get this message
Try This....
dong2007 said:
now I get this message
Click to expand...
Click to collapse
First step push the .apk file to your sdcard. then unmount your sdcard.
Then...
Code:
adb shell [B]{press enter}[/B]
$ su
su
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
note the space between the /mtdblock2 and /system...[you typed it without the space the first time]...
now check with the mount command...
Code:
# mount
there should be a few lines of output check for this one...
Code:
/dev/block/mtdblock2 /system yaffs2 rw 0 0
Note the "rw".... it indicates your fs is mounted now as read-write if it is "ro" [read only] then you made a mistake somewhere along the line...
if it is mounted succesfully as rw... then try this...
Code:
#dd if=/sdcard/YouTube.apk of=/system/app/YouTube.apk
then
Code:
#reboot
hope it helps...
dong2007 said:
now I get this message
Click to expand...
Click to collapse
well have you rooted your phone ? which method did you use ?
realunited123 said:
well have you rooted your phone ? which method did you use ?
Click to expand...
Click to collapse
I use Universal Androot (One Click Root), and my phone are rooted. I can use Marketacces, TB, root explorer and Quickbot...
dong2007 said:
I use Universal Androot (One Click Root), and my phone are rooted. I can use Marketacces, TB, root explorer and Quickbot...
Click to expand...
Click to collapse
OK. Maybe reboot you phone and try again ?
sam_a200 said:
First step push the .apk file to your sdcard. then unmount your sdcard.
Then...
Code:
adb shell
$ su
su
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
note the space between the /mtdblock2 and /system...[you typed it without the space the first time]...
now check with the mount command...
Code:
# mount
there should be a few lines of output check for this one...
Code:
/dev/block/mtdblock2 /system yaffs2 rw 0 0
Note the "rw".... it indicates your fs is mounted now as read-write if it is "ro" [read only] then you made a mistake somewhere along the line...
if it is mounted succesfully as rw... then try this...
Code:
#dd if=/sdcard/YouTube.apk of=/system/app/YouTube.apk
then
Code:
#reboot
hope it helps...
Click to expand...
Click to collapse
Still not working, i get this message.
Shall i mount or unmount my sdcard, when I start cmd??
I have the unmount...
realunited123 said:
OK. Maybe reboot you phone and try again ?
Click to expand...
Click to collapse
do it automatically via cmd when I use the formula which
(it is actually the only Ossetians it makes the mobile..)
adb shell mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
adb push YouTube.apk /sdcard/YouTube.apk
adb shell dd if=/sdcard/YouTube.apk of=/system/app/YouTube.apk
adb shell rm /sdcard/YouTube.apk
adb shell reboot
dong2007 said:
Still not working, i get this message.
Shall i mount or unmount my sdcard, when I start cmd??
I have the unmount...
Click to expand...
Click to collapse
you don't need to mount the sdcard... Maybe try ADB magic ? search the forums for it.
dong2007 said:
Still not working, i get this message.
Shall i mount or unmount my sdcard, when I start cmd??
I have the unmount...
Click to expand...
Click to collapse
Please do read my post again...edited it with further explanations... after typing "adb shell" press enter you will get a new line with "$" symbol... now type "su"... and go on...
sam_a200 said:
Please do read my post again...edited it with further explanations... after typing "adb shell" press enter you will get a new line with "$" symbol... now type "su"... and go on...
Click to expand...
Click to collapse
Now i get message "permission denied" :S
Now can i install the modifed Youtube apk via astro :S
so something must be right
I´ve the modified youtube installed now on my X10i, and it starting with high quality now
Until there are ad blocking apps for FFOS it needs a DIY method.
I'll assume you know how to use adb and have it set up on your machine. I'll also assume you have rooted your phone following the instructions here.
I use Linux so my commands may be a bit off in places.
1. Collect a suitable hosts file. I used the one on my Android phone but this one seems to update regularly http://winhelp2002.mvps.org/hosts.txt
2. Save the file as 'hosts' to a known location on your PC.
3. Open a shell window (command window) on your PC and check adb works.
Code:
adb devices
should return roamer2. If not, on your phone, go to settings > More Information > Developer - and check Remote Debugging.
4. In the shell window - change directory to where you have saved the hosts file. then type:-
Code:
adb push hosts /sdcard/
5. When that completes type:-
Code:
adb shell
you'll see $ prompt
Code:
su
If you are rooted correctly you'll see # prompt
Code:
mount -o remount,rw /system
Mounts the system folder for read / write permissions.
Code:
cat /system/etc/hosts
Should show just '127.0.0.1 localhost'
Save this if you want as hosts.old
Code:
busybox mv /system/etc/hosts /system/etc/hosts.old
Now replace the hosts file with the new one:-
Code:
busybox mv /sdcard/hosts /system/etc/hosts
To check your hosts file has been replaced type
Code:
cat /system/etc/hosts
And lots of domain names will whiz past.
All done.
I spent a few minutes struggling to install Google Dialer after rooting my latest OTA note 3 with towelroot. Here's what I discovered worked (works for putting anything in the system folder):
Step 1: Install ADB on your computer, push tr.apk (towelroot) and install. Run towelroot, install busybox
Step 2: Open up two command prompts on your computer. In one, ADB shell and su. I will refer to this as "the su terminal" for now. Ignore the second for a bit.
Step 3: type "mount | grep system" and extract the first bit:
Code:
/dev/block/platform/msm_sdcc.1/by-name/system /system ext4 ro,seclabel,relatime,
data=ordered 0 0
The important part is the first section, /dev/block/platform/msm_sdcc.1/by-name/system. Also notice that it is mounted as RO, read only.
Step 4: type the following, replacing the /dev/... line with your own from above (maybe the same, idk)
Code:
# mount -o rw,remount /dev/block/platform/msm_sdcc.1/by-name/system
Step 5: Confirm it worked by running mount | grep system again:
Code:
/dev/block/platform/msm_sdcc.1/by-name/system /system ext4 rw,seclabel,relatime,
data=ordered 0 0
Note that it is now RW.
Now we run into an issue, if you go to your second terminal and try to use ADB to push to system it still says read only. If you go to adb and try to adb root it says disabled for production builds. If you go into an app such as ES file manager, it still says read only. I also tried pushing the file to the sd card and using MV to move it while in a su shell, but that didn't work either (error about cross device something or other)
However... I found a workaround.
Step 6: On the second terminal, use adb to push your file to somewhere on your sd card, in my case, /storage/emulated/legacy/ worked.
Step 7: on the second terminal, adb shell and su.
Step 8: On the first terminal cd /system/priv-app/ (or any folder where you need to write something)
Step 8.?: On the second terminal cd /storage/emulated/legacy/
Step 9: Run the following commands
First terminal:
Code:
nc -l -p 1234 > com.google.android.dialer-1.1.apk
Second Terminal:
Code:
nc localhost 1234 < com.google.android.dialer-1.1.apk
Finally, on the first terminal, chmod 777 com.google.android.dialer-1.1.apk, and install by tapping within ES file manager or similar, then adb reboot.
You will need to use a tool to create a shortcut for the application, it does not get one this way.
You now have the google dialer installed on your Verizon Note 3, rooted with TowelRoot.
Trick can be used to push to the system folder without adb root or adb remount working.
Enjoy!
I recently bought a ZTE Open C and was surprised there's no adblocker (shame on you mozilla!). Since I'm using AdAway (available from F-Droid store) on my Android Tablet I simply extracted those hosts file and put it on my ZTE Open C - et voila: it works, much less ads while browsing now. [tested on an modified CAF build I found somewhere else]
Following sources used:
Code:
# http://adaway.org/hosts.txt
# http://hosts-file.net/ad_servers.asp
# http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext
# http://winhelp2002.mvps.org/hosts.txt
Instructions for setup on GNU/Linux (I'm not responsible if adb kills kittens or if your fridge explodes):
1. Download hosts file here
2. Enable ADB: Settings > Developer > USB Debugging > ADB
3. Connect device to PC
4. Setup
Code:
adb root ### run adb as root
adb shell ### open shell on ZTE Open C
mount -o rw,remount / ### remount root partition read-write
mount -o rw,remount /system ### remount system partition read-write
exit ### return to PC shell
adb push /path/to/my/hosts /hosts ### copy hosts file to ZTE Open C
adb shell ### back to ZTE Open C shell
cat /hosts > /system/etc/hosts ### write AdAway hosts to system hosts
rm /hosts ### remove no longer required temporay hosts file
exit ### back to PC
adb reboot ### restart phone to make changes take effect
Suggestions welcome.
Thank you very much. I didn't think about that solution to avoid ads on FFOS.
Do you know an elegant way to update the hosts from time to time (like with adway on android)
without adding double entries?