[App] rsync backup for Android - Android Apps and Games

I just wanted you to inform you about my first Android application: rsync backup for Android. It is available in Market (for free, ad-supported).
Comments, suggestions, feature requests and bug reports are welcomed.

Just curious about your instructions.... You mention generating keys multiple times, but not sure why?
Typically to use ssh keys, one must generate keys on the client, transfer the public key of the client to the server. Then the client can connect into the server using the certificate rather than passphrase authentication.
Your instructions confused me.. It could be due to not having coffee yet, but might want to streamline the info a bit or users might never get to actually using it.
I'll try it myself later, as I already do this but curious how you've done it on your end. Here's what I run manually about once a week from GScript:
rsync -rltDv --delete --chmod=u=rwX,g=rX,o=rX --exclude=".android_secure" --exclude "Music" -e "sshfixed -l user -y -i /sdcard/bin/etc/dropbear/dropbear_dss_host_key" /mnt/sdcard [email protected]:/media3/android/microsd/rsync-backup/hourly.0/
Click to expand...
Click to collapse
And the server itself does a hard-link copy and move of directory names etc which maintains a set of 4 snapshots, I also do the same thing for my backups on the machines themselves.. Handy to find stuff I just realized I hosed a month ago..
Biggest annoyance was having to dupliate ssh (dropbear) and fix it so it uses /dev/urandom, as /dev/random isn't a viable source for ssh.

These are three different ways of generating private+public key pair. I'll add some description, because it could be confusing, as you said.

_sammael_ said:
These are three different ways of generating private+public key pair. I'll add some description, because it could be confusing, as you said.
Click to expand...
Click to collapse
Ah, yes that makes more sense, give them options on how to generate the keys.. However, you can only create keys on the client itself, one mention seemed like it was referring to using a Linux box to create them?

You can always generate keys on Linux box, then transfer private key to your Android and append public key to authorized_keys.

_sammael_ said:
You can always generate keys on Linux box, then transfer private key to your Android and append public key to authorized_keys.
Click to expand...
Click to collapse
To connect from Linux to Android... Yes. But pretty sure that won't work for Android to Linux, which is what I'd think you'd normally do?

He's saying, move both keys. Generally the private key is left on the system that generated it, but that doesn't need to be the case. At least as far as I know.

First off, brilliant app! It's exactly what I have been looking for to save me a huge amount of time and effort. Currently I was doing this by hand because I've had bad experiences with sdcards suddenly just stop working meaning I loose everything.
I have set a range of profiles up and had Tasker kick them off daily however I am at a loss how to get --exclude-from '/sdcard/excludefile.txt' working. When ever I run a profile it states:
rsync: failed to open exclude file '/sdcard/excludefile.txt' : No such file or directory (2)
rsync error : error in file IO (code 11) at exclude.c(1062) [client=3.0.6]
Click to expand...
Click to collapse
What I'm wanting to do is have the following profiles
/ -> /home/user/mobile/dellstreak/
[exclude sdcard exclude*]
/sdcard -> /home/user/mobile/dellstreak/sdcard
[exclude DCIM audio ebooks video media rings downloads temp exclude*]
/sdcard/DCIM -> /home/user/mobile/dellstreak/sdcard/DCIM
Click to expand...
Click to collapse
You can see what I'm wanting to do, I want a little more control over some profiles i.e. so I can backup DCIM whilst out and about or back up the sdcard without backing up all my music, videos etc.
Any help would be appreciated.

Try filename without the quotes:
--exclude-from /sdcard/excludefile.txt
Currently custom parameters parser takes arguments literally. Splitting is done using space as a delimited. That's why spaces in filenames won't work and rsync think that your filename is '/sdcard/excludefile.txt' (file excludefile.txt' in directory '/sdcard) instead of /sdcard/excludefile.txt

khaytsus said:
To connect from Linux to Android... Yes. But pretty sure that won't work for Android to Linux, which is what I'd think you'd normally do?
Click to expand...
Click to collapse
Yes, it will work. If you don't believe me, check it for yourself. In fact I initially generated my private key on my Linux box (using dropbearkey), then tested method with dropbearconvert.
Please notice that what you're generating is key pair, which means that it will work as long as you put public key in remote side's authorized_keys (no matter what system it is and where it was generated) and authenticate using corresponding private key.

Been using it for weeks now, I love it.
You should document a few things, such as how to create a dropbear key from a standard key.
Confirmation number: 9X233376XY8982101.

It is documented on application's webpage (see Menu -> Help).

_sammael_ said:
It is documented on application's webpage (see Menu -> Help).
Click to expand...
Click to collapse
So it is. I'm not sure if that was there when I first started using, but you've added the things I would have suggested (being able to change the command line options, etc.)

_sammael_ said:
Try filename without the quotes:
--exclude-from /sdcard/excludefile.txt
Currently custom parameters parser takes arguments literally. Splitting is done using space as a delimited. That's why spaces in filenames won't work and rsync think that your filename is '/sdcard/excludefile.txt' (file excludefile.txt' in directory '/sdcard) instead of /sdcard/excludefile.txt
Click to expand...
Click to collapse
The exclude files I'm parsing don't have spaces in anyway so luckily I didn't have to worry about that (coming from a linux background has taught me to avoid spaces where ever possible, not to mention keep everything lower case )
Your suggestion of removing the quotes (') seems to have done it, I use rsync on my linux boxes which require you to use quotes when parsing an exclude file.
Will check that it's parsing the exclude files correctly and will report back.
As per documentation that someone has suggested, I found the current documentation to work find, however it seems a little sparse. Maybe creating a wiki site for the documentation might help with this?
Again thankyou for a great app.

The exclude list seems to be working as expected, I now have it syncing as follows
/ -> /home/user/mobile/dellstreak/sdcard
/sdcard -> /home/user/mobile/dellstreak/sdcard
/sdcard/DCIM -> /home/user/mobile/dellstreak/sdcard/DCIM
Click to expand...
Click to collapse
I've also significantly increased my excludes to cover directories that have permission issues or that are (re)created on boot.
##rsyncrootexclude##
/sdcard
/acct
/cache
/config
/d
/mnt
/proc
/dev
/sys
Click to expand...
Click to collapse
##rsyncsdcardexclude##
/sdcard/Update*.zip
/sdcard/update*.zip
/sdcard/video
/sdcard/audio
/sdcard/ebooks
/sdcard/download
/sdcard/media/music
/sdcard/music
/sdcard/xuluan.podcast
Click to expand...
Click to collapse

So one suggestion, is it possible to add a scheduler to this?
I use Titanium Backup to make backups of my apps/data daily and would like that pushed automatically to my rsync server.

I didn't plan to add this, you can use Tasker or Locale.

As _sammael_ says, tasker works great with it.
I get it to automagically rsync when ever I connect to my wifi, and then on a timed scheduled.

ssh required?
great app.. like others, I was using rsync manually.
Do you only support rsync over ssh? I currently use the (insecure) rsync protocol to sync a "TV" folder on my Windows Media Center box. I can install a SSH server, it just seems overkill for my needs.
Robert

Currently only rsync over ssh is supported, but I guess I can add selection whether user want to use ssh or not. Am I thinking correctly that it will be as simple as skipping rsync's -e option?

Related

Automatic wireless folder sync app needed

Hi,
I have looked around and cant seem to find an application quite fitting.
All I want is an app that will wirelessly sync just a folder automatically when I have my WiFi turned on, is there an app that can do this?
i.e. Come home from work, turn on wifi and it just syncs.
Many thanks
To any developers about: How hard would something like this be to make?
I think dropbox does that?
Dropbox syncs a folder on multiple devices with a folder on dropbox server.
There is also an app called PCFileSync that syncs a folder over wifi between the phone and a samba share. I am turning it on with Tasker once it connects to my home ssid. Works great!
Sent from my Desire HD using XDA App
samba share? hm........
rsync and ssh would be a much better choice and cleaner, just a script to run.
synflex said:
samba share? hm........
rsync and ssh would be a much better choice and cleaner, just a script to run.
Click to expand...
Click to collapse
http://a-more-common-hades.blogspot.com/2010/07/backup-photos-with-rsync.html
Tasker+Rsync, and combine it with a ssh key and you can automate it easy.
BTW, I decided to do this today.. I have one which backs up /sdcard/DCIM, and another which backs up the entire sdcard, both over wifi to my Fedora Linux workstation. I'll have to figure out how I want to execute these, but I can do it from GScript Lite, Tasker, whatever floats my boat.
Here's the notes I took, just in case I have to do it again in the future, hope it's useful to some folks..
# Get dropbear/dropbearkey from http://www.elkins.org/dropbear.tar.gz
# Get ssh off device and follow instructions (references at the end) to fix it, name fixed file "sshfxed"
# Remount /system rw
~/AndroidSDK/tools/adb shell
su
mount -o rw,remount device /system
#exit back to Linux shell
Click to expand...
Click to collapse
# Install dropbear and sshfixed from adb push
~/AndroidSDK/tools/adb push sshfixed /system/xbin/sshfixed
~/AndroidSDK/tools/adb push dropbear /system/xbin/dropbear
~/AndroidSDK/tools/adb push dropbearkey /system/xbin/dropbearkey
Click to expand...
Click to collapse
# Now get into adb shell and execute in Android..
mkdir /system/etc/dropbear
chmod 4755 /system/bin/dropbear
chmod 4755 /system/bin/dropbearkey
Click to expand...
Click to collapse
# Create keys
dropbearkey -t rsa -f /system/etc/dropbear/dropbear_rsa_host_key
dropbearkey -t dss -f /system/etc/dropbear/dropbear_dss_host_key
Click to expand...
Click to collapse
# Copy and paste the public DSS key the dss command above outputs and put it in ~/.ssh/authorized_keys on intended host. If you need to know more here, google for how to use ssh keys on Linux hosts. Basically if you're going to [email protected], on machine1 under user account "user" you create a file named authorized_keys in the .ssh directory with the output of the previous command, it tells you it's the 'public key', which is what you want to copy. It has to be all one line.
# Now actually use it all and rsync sdcard to your host For debugging, I suggest trying the "sshfixed -l USER -y -i /system/etc/dropbear/dropbear_dss_host_key" part just by itself and make sure you can ssh to your machine WITHOUT any prompting, password, etc.
~/AndroidSDK/tools/adb shell
# the following is all one line..
rsync -rltDv --chmod=u=rwX,g=rX,o=rX -e "sshfixed -l USER -y -i /system/etc/dropbear/dropbear_dss_host_key" /mnt/sdcard [email protected]:/your/path
Click to expand...
Click to collapse
-- References
Get dropbear - http://forum.xda-developers.com/showthread.php?p=8220181
Set up dropbear - http://forum.xda-developers.com/showthread.php?t=442754
Fix ssh client to use urandom - https://www.heiher.info/1592.html
Use it all to rsync over wifi - http://a-more-common-hades.blogspot.com/2010/07/backup-photos-with-rsync.html
Another vote for Dropbox, it works great! Look for referral codes in the comments on Market for some additional free storage. I use it all the time for pictures and vids for the family.
Sent from my HTC Desire using the XDA App
I use S&K sync.
Horrible user interface but once things are set up you need only to start the client on your phone and press the "Start Sync" button.
Supports multiple configuration sets (local/remote directory pairs, ip address, etc), each can be started separately.
Google: "SK sync android"
khaytsus said:
http://a-more-common-hades.blogspot.com/2010/07/backup-photos-with-rsync.html
Tasker+Rsync, and combine it with a ssh key and you can automate it easy.
Click to expand...
Click to collapse
I'm actually syncing to 2 android phones, with dropbox, rsync and dropbear.
Dropbox is good for documents and such, with small filesize and possiblity of sharing with others.
Using rsync for large files like movies and music folders, also some pictures, notes, keepass, and stuffs I like having around, things that's only going around between my laptop and phone.
Running a crontab that scans for my phone in adb devices, if found, pull a "last sync status" file, if interval > 1 hour or changes made locally, do a local notify-send till rsync is done, then execute dropbear on phone, rsync remote and local, kills dropbear, then push last sync file.
This way, no resources is wasted on the phone, all scanning and verification of device, system, and files were done on laptop.
At the same time I'm monitoring my development phone with frequent ssh rsync when it's in range, push updates, kernels and such across in proper folder structure.
This will ensure changes or new kernels were pushed to phone ready for testing.
Could use the same script for both phone, be it adb+ssh+rsync or pure ssh+rsync, but I personally don't like having sshd running in background when I'm connected to wifi hotspot.
Cleaner this way, less resources wasted on phone, and I can have full control over what, where, and when to sync.
I do realise that there isn't much choice for syncronization in the wild, thus you may like yo try something along the same idea, and you may get your own perfect combo to sync.
P.S. backing up, restoring or syncing bookmarks from browser.db and such could be done this way.

[Ubuntu Image] 1st really working simple to install Ubuntu on your phone

This is easier than making a cup of coffee.
Pictures below as attachment couldnt figure how to put the pic here edit figured it out now im just lazy.
you dont have to do it the hard way
Everyone (edit: i thought so at the time)will want this "Fully" (note below) funtioning Ubuntu system
or you can make your own here: http://forum.xda-developers.com/showthread.php?t=913622
I will be maintaning and updating as time permits
Phone has to be rooted: http://forum.xda-developers.com/wiki/index.php?title=HTC_Supersonic/Guides_&_Tutorials
NEW IMAGE 3.5 gigibyte
Lucid base image (only added: lxde and tightvncserver): Zip http://www.megaupload.com/?d=GLMYVCMN User: "dad" Passwd:ffffffff
Remove app2sd and settings- applications- manage applications- sdcard "move all apps to phone" or it will not work!
I suggest you install gnome-panel
I use it and i find no speed differance!
trying to get :upstart services" to work im looking into compiling a kernel with "CONFIG_TMPFS enabled, to initiate a workaround, because "upstart" services wont work in a chroot.
Stock Maverick : http://www.megaupload.com/?d=56AT71WD
Karmic Sucks programs stop opening after some short time, so i gave up.
Tested with: CM7 http://mirror.teamdouche.net/get/supersonic/update-cm-7.0.0-RC1-Supersonic-signed.zip
CM6: http://mirror.teamdouche.net/get/supersonic/update-cm-6.1.2-Supersonic-signed.zip
myn-WarmTwoPointTwo-11-05-2010-RLS-3
Unzip
Copy the "ubuntu" folder to your sd card
Go to market download "Terminal" and android VNC Viewer
Open terminal and type: (without the quotes), "su" then "cd /sdcard/ubuntu"
then "sh ./ubuntu.sh"
then "bootubuntu"
then "vncserver :0 -geometry 1024x800"
Thats it, go to android VNC Viewer and use dad for nickname, "ffffffff" for the password, "localhost", for address, 5900 for the port, Use 24bit veiwing settings, then go.
to shutdown you will have to power off phone and power back on.
Enter in your :"Initial Command",in the settings of Android Terminal:
su
cd /sdcard/ubuntu
sh ./ubuntu.sh
bootubuntu
So everytime you want to start ubuntu just open terminal
to start VNC SERVER automaticly you will have to add to the bottom of your /home/.bashrc file this:
cd /
rm -r -f /tmp
mkdir /tmp
vncserver :0 -geometry 1024x800
Thats it, your off ENJOY
Notes: Its as fully funtioning for myself, cant speak for everyone
This is in Beta stages I am an old Visual Basic dabbler as a hobby, and am not very fluent in the lenux operating system. However this "ubuntu on mobile device" has rekindled a lost desire to program.
I will update changes as i get the time
If anyone would like to contribute their lenux expertese to iron out the bugs, i and so many others would appreciate it
Issues to work on:
:no sound
NOTE: A big kernel level problem is the lack of sound. Most of the kernels we use as a base for our ports are designed for Google Android. Android doesn't use the standard Linux sound System ALSA. An ALSA wrapper for the EVO DSP kernel system must be written.
:Setting up users and groups (used kusers but seemed to slow system a bit, needs kde-common) But is very tolorable, I actually use dolphin. (cant get nautilus to create folders or files (destination read only? u got me)).
:hacked /root/.bashrc for easy login help (when using terminal runs .bashrc. dont know anotherway to start hamachi on login and also vncserver tries to restart)
:keyboard mapping (mapping arrow keys to the abc keyboard it has arrow keys, esc,etc...)
: No way to exit or turn off ubuntu. You have to turn off phone, to turn off ubuntu.
nce in a while the programs refuse to open, it has somthing to do with ?. you have to restart ubuntu again.
I suppose a fluent ubuntu/lenux person could help change usernames and such, using the terminal,set proper permissions and such
Im using CyanogenMod Rom its the only one that works with Hamachi
your rom will most likely work, however networking wont!
Tips:
ownload VNC for your computer and modify your ubuntu desktop on your computer screen (that way i dont need my glasses) (use "ifconfig" to find ip address)
:You can even use VNC to view the build while in qemu emulation, after installing lxde and tightvncserver in the emulation. (watch out for seg faults)
:In terminal, preferances-initial command, enter the "cd /sdcard/ubuntu ...etc ," that way its a one click to login .
:Get "abc keyboard" from market it has the esc, arrow keys etc... ( extra keys only good outside chroot, the "terminal", on your android desktop)
:If your not familiar with ubuntu, you use synaptic package manager to install programs
:When u share over himachi or start smbd, programs will stop opening.
.
Trust me everything i want it use it for seems to be pretty zippy, but just give a little xtra time for programs to load the first time. (Firefox may take 90 sec. to load the first time. After that its a snap)
I Would like to check into this
The no sound issue is getting to me, I may wait for that as that is an essential to my all in one device.
THANKS FOR THE HARD WORK. I LOVE UBUNTU
you really have to try it and tell everyone about it cant believe its not one of the hottest topics
I Would like to check into this
any way to delete this post....didn't mean to submit, came back to send like i didn't send it but ending up sending twice
apologies
Sounds pretty cool, I will defiantly have to give this a try. Question though, is this installing over top of the rom I am currently using. Example I am using the MIUI 1.22, if I install this is this like dual booting or will it just uninstall every time I reboot the phone??
Is it still uploading? I really want to try this!
corybucher said:
Sounds pretty cool, I will defiantly have to give this a try. Question though, is this installing over top of the rom I am currently using. Example I am using the MIUI 1.22, if I install this is this like dual booting or will it just uninstall every time I reboot the phone??
Click to expand...
Click to collapse
This will sit on your sdcard and ride side by side with your android system (you can use your phone at the same time)
IT DOES NOT EFFECT YOUR PHONE IN ANY WAY
wasnt shouting just wanted everyone to see
ioos said:
Is it still uploading? I really want to try this!
Click to expand...
Click to collapse
Download away!
This is awesome! I can't wait to get home and give it a try.
This is gonna be a great weekend. Between this and the flashable ROMs that are starting to roll out for my nook color, I might be sprouting antennae by Monday.
So wep cracking soon...? That's about the only thing I want/need Linux for.
Sent from the void...
wuclan48 said:
So wep cracking soon...? That's about the only thing I want/need Linux for.
Sent from the void...
Click to expand...
Click to collapse
How would one go about this "wep cracking thing"
please explain further
Almost* all WEP and some** WPA wireless passwords can be cracked. IMHO its easiest to do this on a Linux machine (please take note I love all OSs equally!)
*I forget how accurate this is but some WEP keys(like crazy long ones) can cause problems l in cracking, thus being protected (though not by design)
**most wpa specifications are not crackable yet and those that are often have a very stringent set of requirements (off the top of my head: most require someone to be legitimately connected to the access point and very simple passwords with low encryption.
On topic, though, this is sweet. Hope I can get something like this on my galaxy tab too!
EDIT: If you really need to know this (please only for testing... not to mooch people's internet) Google "wep cracking on backtrack"
The short simple answer is you sniff packets that the wireless access points send out and manipulate them to decrypt the key.
EDIT 2: I just realized you are also the guy who made this. Let me answer a few questions.
1) For audio you probably need to find a way to register the hardware with a Linux Audio Mixer. I'm guessing Ubuntu uses ALSA? I'd have to look that up
2) For users, kusers is part of the KDE desktop system. Ubuntu uses GNOME. People generally only use one or the other (unless they're trying to show off). That's probably why it either a) won't work or b) not work well and take up lots of extra space
3) It's Linux, not Lenux (but that's fine I can sense English isn't your first language... it's not mine either, but that's fine ^^)
the download has a "zipx" extension.
I did a little googling and it looks like that is winzips new default compression method, and the only way to open the archive is with winzip, bitzipper, pkzip, or a couple of others. none of the compression utilities I typically use (7zip on Windows, unarchiver on mac) seem to support it.
Edit: sorry if I sound unappreciative, I just think its funny to use a proprietary closed format for distribution of software that is all about open software and formats. I'm currently trying to find something that will open this on the mac without being a scummy trial, or ill just do it on a pc.
Sorry i just used the wizard and made a zip file with winzip 12.1
Quote"Almost* all WEP and some** WPA wireless passwords can be cracked. IMHO its easiest to do this on a Linux machine (please take note I love all OSs equally!)
*I forget how accurate this is but some WEP keys(like crazy long ones) can cause problems l in cracking, thus being protected (though not by design)"
Thanks for the info
laydros said:
the download has a "zipx" extension.
I did a little googling and it looks like that is winzips new default compression method, and the only way to open the archive is with winzip, bitzipper, pkzip, or a couple of others. none of the compression utilities I typically use (7zip on Windows, unarchiver on mac) seem to support it.
Edit: sorry if I sound unappreciative, I just think its funny to use a proprietary closed format for distribution of software that is all about open software and formats. I'm currently trying to find something that will open this on the mac without being a scummy trial, or ill just do it on a pc.
Click to expand...
Click to collapse
shame on me .
Your right im a noob and really know too much about it yet i just like having ubuntu on my phone.
Ill do better next time
People talking about cracking WEP and stuff, this probably doesn't have a driver to put the wireless card to put the card in monitor mode.
laydros said:
the download has a "zipx" extension.
I did a little googling and it looks like that is winzips new default compression method, and the only way to open the archive is with winzip, bitzipper, pkzip, or a couple of others. none of the compression utilities I typically use (7zip on Windows, unarchiver on mac) seem to support it.
Edit: sorry if I sound unappreciative, I just think its funny to use a proprietary closed format for distribution of software that is all about open software and formats. I'm currently trying to find something that will open this on the mac without being a scummy trial, or ill just do it on a pc.
Click to expand...
Click to collapse
Have the same problems, did you happen to find anything to open it with? I searched a little on google myself but all I find is software that needs to be purchased.
Homefix said:
Quote"Almost* all WEP and some** WPA wireless passwords can be cracked. IMHO its easiest to do this on a Linux machine (please take note I love all OSs equally!)
*I forget how accurate this is but some WEP keys(like crazy long ones) can cause problems l in cracking, thus being protected (though not by design)"
Thanks for the info
Click to expand...
Click to collapse
AFAIK, WEP can be easily cracked. WPA or WPA2 though, will require bruteforcing, there is no way around it.
corybucher said:
Have the same problems, did you happen to find anything to open it with? I searched a little on google myself but all I find is software that needs to be purchased.
Click to expand...
Click to collapse
I will repackage it, but it might take 3-4 hrs to upload, sorry.
ill get right on it

[SCRIPT][1.6+][WHATSAPP][14/11/08] Disable sending read-receipts for WhatsApp msgs

Shell script to disable read receipts for all your incoming Whatsapp messages
Even "better": Others won't see whether you've already read their message(s) or not. However, you will still be able to see the read receipts of others!
Code:
################################################################################
#
# Shell script to disable read receipts for all incoming Whatsapp messages.
#
# [ ANDROID AND ROOT ONLY ! ]
#
# Author: Stephan Schmitz <[email protected]>
# Source: https://gist.github.com/eyecatchup/9af90363732801b131bf
# Last Updated: 09. Nov 2014
#
# ABOUT
#
# You don't like that everyone in your Whatsapp contact list is now able to see
# whether you've already read their latest message(s) or not? Then feel free to
# use the following "work-around" that I found to disable sending read receipts
# globally. Once patched, whenever you get new messages, the senders will never
# see the 2 check marks in blue. They'll just stay gray, just like it was until
# recently. Well, almost. Because you'll still be able to see whether your chat
# partners have already read the messages you sent to them. ;)
#
# DESCRIPTION
#
# In early Nov. 2014, Whatsapp added a new "feature" - read receipts. It means,
# your chat partners will get a visual feedback (2 blue check marks) as soon as
# you've read their message(s).
#
# Unfortunately, Whatsapp's dev team forgot to implement a corresponding privacy
# setting for users to be able to turn off this feature. However, fortunately, I
# found it was fairly simple to disable the feature, since it is set in a public
# XML file in Whatsapp's app data directory.
#
# This script shall serve as a convenient wrapper for those Android users who do
# not live in userland - as well as for the lazy ones.
#
# PRE-REQUIREMENT
#
# Basically, all it needs is a working `sed` commandline utily in path.
# If you should not have "Busybox" installed yet, choose one of the available
# "Busybox" installer apps from Google Play Store and let it install busybox.
#
# USAGE
#
# - Save this script to your phone's sdcard as disable_whatsapp_read_receipts.sh
# - Open a terminal session on your device
# E.g. https://play.google.com/store/apps/details?id=jackpal.androidterm
# - In the console, login as root (type su, hit enter) and type:
# sh /sdcard/disable_whatsapp_read_receipts.sh
# (adjust the path, if required, to fit your's!)
# - Hit the enter button. Done. (Whatsapp will restart afterwards)
#
# If you get any error message a) make sure the /data partition is mounted /w rw
# permissions and b), if the permission for restarting WA is denied, 1st try to
# uncomment the last line of this script (append hash char "#" (without quotes))
# and run the again. Otherwise, consult me for help here:
# http://forum.xda-developers.com/android/development/script-disable-whatsapp-read-receipts-t2933467
#
# IMPORTANT NOTE
#
# The last successful test for this was run at 09. Nov. 2014 and on the Whatsapp
# Android version 2.11.399 and 2.11.432 only. Even though it should work for all
# Android versions, it was not tested. Also, Whatsapp might change their current
# implementation any time soon. So this work-around might stop working any time
# soon too. Keep that in mind!
#
################################################################################
Download
NOTE: This script requires the "sed" command line utily (ie "busybox") installed on the system, which pre-requires a rooted device!
NOTE: The gist requires an update, which I'll post tomorrow. For further details and a manual workaround see my post here: http://forum.xda-developers.com/showpost.php?p=56640205&postcount=9
External link to gist.github.com (see the inline comments for further instructions): http://goo.gl/EiOvO0
Download, run, done. Enjoy. Whatever.
PS: For those who understand German, here're some screenshots of testing this " hack". As you can see, my chat partners can't see the read status. http://imgur.com/a/kzQs3
Nice trick!
However, I've noticed that the preferences .XML files are reset to the original values once the application relaunches. So, basically, the changes do not stick.
Any workaround on this?
smartxdev said:
Nice trick!
However, I've noticed that the preferences .XML files are reset to the original values once the application relaunches. So, basically, the changes do not stick.
Any workaround on this?
Click to expand...
Click to collapse
That's kind of odd, since the script explictly restarts the Whatsapp package *after* applying the changes to the prefs xml. Which then, in turn, should result in no result at all (assuming a restart rewrites the xml), right!? But it does work. Now, the first question would be how you define restart (activity (re)launch, package force && start)?
Update: Just checked it and you're right. If I use the -S option on the am start call (to force stop Whatsapp before (re)starting the activity), running script has no effect at all - since the XML is being recreated. And that also means, that the change will gets lost with every device reboot.
The easiest solution I see here, to have a "permanent" effect, to wrap the script in a plain simple app and attach it an onboot service. (Also, looking at #4, some further checks should be added.) If Whatsapp will leave this current implementation of defining whether to send read receipts or not, I'll invest the time into an app version, I think. (Just don't want to have too much hustle with it. So want to wait whether it's worth to spend more time on this.) Thoughts?
hi, i have this problem:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
can you fix it?
Dj Mauro said:
hi, i have this problem:
can you fix it?
Click to expand...
Click to collapse
I had permission error too.
In the terminal, try to first run "su" command (without the quotation marks), it will obtain root permissions for the terminal.
Then run the actual command. That solved the permission error for me.
Bexton said:
That's kind of odd, since the script explictly restarts the Whatsapp package *after* applying the changes to the prefs xml. Which then, in turn, should result in no result at all (assuming a restart rewrites the xml), right!? But it does work. Now, the first question would be how you define restart (activity (re)launch, package force && start)?
Click to expand...
Click to collapse
Actually it never worked for me (I mean, script ran successfully, but i have no success in disabling the "read recipient" when i tested it).
Then, I tried to do it manually:
- make a backup copy of the target file (/data/data/com.whatsapp/shared_prefs/com.whatsapp_preferences.xml)
- and then set: "read_receipts" to value="0" in the original file
- save it
- and when i open whatsapp app again, the XML file is restored to the older values, and the "backup" copy gets erased.
And for the "restart" question, i tried the following:
1 - swipe the app away from the recents, make XML modifications, and relaunch
2 - kill the app, make XML modifications, and run it again
I also tried to set XML file permissions to read-only, but it still was replaced by original config. once i opened the app.
-----
I was thinking about another workaround:
Since the read receipt (and delivery too) is usually done by transmitting a small message by the application, back to the sender, once the conversation window is opened.
It may be possible to just block this outgoing communication on your side by XPrivacy.
But, i have yet to hunt down the specific permission/address to block, without crippling the app..
Dj Mauro said:
hi, i have this problem:
snip
can you fix it?
Click to expand...
Click to collapse
As a quick fix, this should work for you:
1.) Add the following line above the line with the sed command:
Code:
mount -o rw,remount /data
2.) Change the last line of the script to the following (if it still compains replace the user id value in the command with that from the error message. and if it still complains, it might even work when you just comment out the line):
Code:
echo `am start --user -2 -n com.whatsapp/com.whatsapp.Conversation`
3.) Back in the console again, login as root (su, enter) and run the script.
Let me know if it worked.
As said in my update to post #3, I'll probably add some automatisms for such issues soon.
Bexton Tnx !
how about an xposed module?
smartxdev said:
I had permission error too.
In the terminal, try to first run "su" command (without the quotation marks), it will obtain root permissions for the terminal.
Then run the actual command. That solved the permission error for me.
Click to expand...
Click to collapse
Yeah, recognized already that I completely forgot to mention that at all (to run the script as root). I updated the inline instructions accordingly.
smartxdev said:
Actually it never worked for me (I mean, script ran successfully, but i have no success in disabling the "read recipient" when i tested it).
Then, I tried to do it manually:
- make a backup copy of the target file (/data/data/com.whatsapp/shared_prefs/com.whatsapp_preferences.xml)
- and then set: "read_receipts" to value="0" in the original file
- save it
- and when i open whatsapp app again, the XML file is restored to the older values, and the "backup" copy gets erased.
And for the "restart" question, i tried the following:
1 - swipe the app away from the recents, make XML modifications, and relaunch
2 - kill the app, make XML modifications, and run it again
I also tried to set XML file permissions to read-only, but it still was replaced by original config. once i opened the app.
Click to expand...
Click to collapse
Sheesh. Okay, I think I got what's wrong here.
As far as I understood, you didn't even got to the point where the file
Code:
/data/data/com.whatsapp/shared_prefs/com.whatsapp_preferences.xml
stored the modified value, correct?
When I was looking at your manual procedure I recognized a small but probably crucial difference! Let's have a look at it. My initial, manual approach was:
# Login as root
Code:
[email protected]> [B]adb shell[/B]
[email protected]:/ $ [B]su[/B]
# Copy the original prefs xml file to /sdcard/.
# NOTE: We use cp as root user, but with the --preserve switch to copy a file owned by Whatapp's OS user.
Code:
[email protected]:/ # [B]cp -p /data/data/com.whatsapp/shared_prefs/com.whatsapp_preferences.xml /sdcard/[/B]
# So, at this point, the copied file /sdcard/com.whatsapp_preferences.xml is still owned by Whatapp's OS user.
# Now, my last 2 steps were to modify the read-receipts settings value in /sdcard/com.whatsapp_preferences.xml and copy back the modified file to its original location, which I did as follows:
Code:
[email protected]:/ # [B]sed -i'.bak' 's/^.*\bread_receipts\b.*$/ <long name="read_receipts" value="0" \/>/g' /sdcard/com.whatsapp_preferences.xml[/B]
[email protected]:/ # [B]cp -p /sdcard/com.whatsapp_preferences.xml /data/data/com.whatsapp/shared_prefs/[/B]
So all together, this was:
Code:
[email protected]> [B]adb shell[/B]
[email protected]:/ $ [B]su[/B]
[email protected]:/ # [B]cp -p /data/data/com.whatsapp/shared_prefs/com.whatsapp_preferences.xml /sdcard/[/B]
[email protected]:/ # [B]sed -i'.bak' 's/^.*\bread_receipts\b.*$/ <long name="read_receipts" value="0" \/>/g' /sdcard/com.whatsapp_preferences.xml[/B]
[email protected]:/ # [B]cp -fp /sdcard/com.whatsapp_preferences.xml /data/data/com.whatsapp/shared_prefs/[/B]
So what happened with the last 2 commands that made it work for me, but breaks in the script version?
The core problem here is, as I just learned, that GNU sed's -i extension does not actually edit files in place (--in-place is a misnomer, in my opinion); it creates a temp file, deletes the original file, then renames the temp to the name of the original. The result is a new file - much possibly with a different owner.
So in my manual procedure, the result of the sed command worked fine except for the fact that it changed ownership on all the files it went through. The only problem is that these files (or at least the backup file) were owned by the root user - the user I run the command as. However, then I used the -f switch (to force overwrite) and the -p switch (to preserve permission, ownership and timestamps) to copy back the prefs file from /sdcard/ back to its original location in the Whatsapp data folder. That means, as a result, in the Whatsapp data folder there was a) no new file from another user (the backup file) and b) the modified prefs xml file still had its original ownership information. Basically, this kind of "fixed" sed's -i mode behaviour on the prefs file plus didn't created a new file in Whatsapp's data folder.
The last step to solve the puzzle is fairly simple. I just tried the procedure manually - as defined upthread - with all my friends' phones. Thus, I didn't noticed the sed behaviour. Plus, the friend Iinitially wrote the script for didn't told me that it wasn't working for him.
Anyway. Let's finally come to how to fix.
A quick look into the sed manual unveils that -c switch should do the trick:
Code:
-c, --copy
use copy instead of rename when shuffling files in -i mode
(avoids change of input file ownership)
Unfortunately, this switch is not enabled in all the busybox sed's for Android. Also, this would still leave us with a new file in Whatsapp's data directory. Even if all ownership information of existing files can be preserved, we should also not create any files in the folder that are not known to the Whatsapp app.
So basically my manual approach is the way to go:
a) Save the backup of the original prefs file somewhere on /sdcard/
b) Preserve ownership and permissions for /data/data/com.whatsapp/shared_prefs/com.whatsapp_preferences.xml
NOTE: Even if you got the value in the prefs xml saved to "0" and with no changes to ownership and permissions, you still need to restart any running Whatsapp process. Otherwise the change will have no effect! And, rebooting the device, resets the prefs xml file!
I'll post an updated version later. Until then, probably the easiest way to test this, is the manual way using a text editor app on your device.
- Open any text editor app with root capabilities (I used https://play.google.com/store/apps/details?id=com.maskyn.fileeditor )
- From the menu choose "Open file", navigate to /data/data/com.whatsapp/shared_prefs/ and open the file com.whatsapp_preferences.xml
- Find the line that reads <long name="read_receipts" value="SOMENUMBER" /> (SOMENUMBER is a placeholder, of course)
- Replace SOMENUMBER with 0 (zero), so the line reads <long name="read_receipts" value="0" />
- Save the file
- Now, close Whatsapp from the recent apps view and restart it.
- You can verify the change by running the following command (as root) from a terminal on your phone:
Code:
cat /data/data/com.whatsapp/shared_prefs/com.whatsapp_preferences.xml |grep read
- You can verify the ownership and permissions by running the following command (as root) from a terminal on your phone:
Code:
ls -l /data/data/com.whatsapp/shared_prefs/com.whatsapp_preferences.xml
smartxdev said:
I was thinking about another workaround:
Since the read receipt (and delivery too) is usually done by transmitting a small message by the application, back to the sender, once the conversation window is opened.
It may be possible to just block this outgoing communication on your side by XPrivacy.
But, i have yet to hunt down the specific permission/address to block, without crippling the app..
Click to expand...
Click to collapse
Sure, feel free to share any suggestions!
Ather said:
how about an xposed module?
Click to expand...
Click to collapse
I guess that'd be possible too. Just that I never looked into it yet.
Thanks, @Bexton for your detailed explanation.
Manual editing by Turbo Editor did the work for me.
I tested it, and the blue check marks were indeed blocked.
And btw, Turbo Editor has a nice "recent files" list on the startup, so reediting of the parameter on restart should be simple and easy.
Then, i did Restart (full restart to the device), and.... ...it still holds!
The parameter in the XML is unchanged and read notifications are still blocked
So, it made me wonder, why it didn't work for me before? I used ES Text Editor to edit the XML, it was fine, but then i made a backup copy somewhere inside the /data/data/com.whatsapp/ folder. And I think that "foreign" file caused full rewrite of the xml files by the app.
I hope it may hold permanently, but, we'll see..
Ahoy everyone!
We're 2 students from the University of Milan who created a repository [https://github.com/phosphore/whatsapp-blue/wiki]
for an Android app with the aim of getting rid of those blue ticks. We're currently
considering and testing out all the possible solutions including the modification
of com.whatsapp_preferences.xml (as found by @Bexton) or the filtering of the TCP
packet responsible for the read receipt.
Although using Bexton's method greatly simplifies the solution, it is just a
temporary workaround before Whatsapp fixes it.
Having a proxy filtering the requests should be a permanent solution. We are
reverse engineering FunXMPP (WA proprietary protocol) to find that particular request.
We're open to contribution!
smartxdev said:
So, it made me wonder, why it didn't work for me before? I used ES Text Editor to edit the XML, it was fine, but then i made a backup copy somewhere inside the /data/data/com.whatsapp/ folder. And I think that "foreign" file caused full rewrite of the xml files by the app.
I hope it may hold permanently, but, we'll see..
Click to expand...
Click to collapse
Some editors use a similar internal workflow as GNU's sed in -i mode and without the c switch. Resulting in "corrupted" files (in the sense of ownership & contex)..
Th3Zer0 said:
Ahoy everyone!
We're 2 students from the University of Milan who created a repository [https://github.com/phosphore/whatsapp-blue/wiki]
for an Android app with the aim of getting rid of those blue ticks. We're currently
considering and testing out all the possible solutions including the modification
of com.whatsapp_preferences.xml (as found by @Bexton) or the filtering of the TCP
packet responsible for the read receipt.
Although using Bexton's method greatly simplifies the solution, it is just a
temporary workaround before Whatsapp fixes it.
Having a proxy filtering the requests should be a permanent solution. We are
reverse engineering FunXMPP (WA proprietary protocol) to find that particular request.
We're open to contribution!
Click to expand...
Click to collapse
Could you hook up via email? I'm working on an app as well and currently considering the possibilities. Maybe it's worth sharing thought.. Please send to [email protected], thanks!
This is why I waited before investing more time into it, hehe. So, time to relax for everyone. Here is news:
Whatsapp will soon get the ability to turn off the blue checkmark read indicator, according to an alleged Beta tester of the application.
Click to expand...
Click to collapse
Original tweet: https://twitter.com/0xmaciln/status/530294585072025600
Via: http://www.myce.com/news/whatsapp-w...ble-privacy-sensitive-blue-check-marks-73438/
Looks like this thread will be obsolete very soon.
Bexton said:
Whatsapp will soon get the ability to turn off the blue checkmark read indicator, according to an alleged Beta tester of the application.
Original tweet: https://twitter.com/0xmaciln/status/530294585072025600
Via: http://www.myce.com/news/whatsapp-wi...k-marks-73438/
Looks like this thread will be obsolete very soon.
Click to expand...
Click to collapse
Nice!
I think whatsapp(facebook?) expected this to come, they already had some bad experience with the "last seen" issue some time ago.
And it is already implemented as a simple switch inside XML prefs...
Bexton said:
Looks like this thread will be obsolete very soon.
Click to expand...
Click to collapse
Hm, maybe I was wrong and it will not become obsolete. Maybe I will still build an app for it. Why? I found more news on the matter, that pointed out a major difference to me.
The same person who confirmed the additon of the on/off toggle for the read receipts, Ihlan Pektas, actually blogged about the feature already a few days ago. The essential information given in his blog post here (in German language) for me is, that he says that early alpha builds already have an implementation for it, and when you disable sending your read status (so that others can't see if you've read a msg), you will, in return, NOT be able to see the read status of your chat partners! (What makes perfectly sense, becausee it's the same way they do it for the "last seen" status.)
That being said, I think there'll be interest in an alternative. An alternative that is capable of disable sending one's own read status, while still being able to see the read status for one's own msgs, sent to others?!
Well, we'll see. (But the party ain't over yet.. )
Thanks Bexton. Tried your manual method with ES File Explorer, without making a backup, and it works. Even survives a full reboot.
Bexton said:
That being said, I think there'll be interest in an alternative. An alternative that is capable of disable sending one's own read status, while still being able to see the read status for one's own msgs, sent to others?!
Well, we'll see. (But the party ain't over yet.. )
Click to expand...
Click to collapse
I see your point, but to make this happen, we need to look at another approach. Because, now we disable it by the pretty obvious flag in the pref. file, and once they release a "feature" it will be probably the same flag that will cause you not the deliver read receipts either.
The thing is, that in fact I barely use whatsapp, for various reasons. I'm here to help some non-techie friends of mine.
Anyways, I use Open WhisperSystems' TextSecure mostly (less polished and fewer features, but free, opensource, and actually secure).
So, a short while ago, they've introduced "delivery receipts". And for some reason, only I was able to get others' delivery receipts, but when others send me messages, they didn't receive a delivery receipt from me. (That's basically what we are trying to do here, just with read receipts)
At first, I was sure there is some bug in this. But then it turned out that I tuned XPrivacy too tight on restrictions, and this new feature could not get through and send the delivery notice. (unfortunately I don't remember what exactly the troublesome restriction was)
That's why i first thought about XPrivacy for this case as well.
Logically, the mechanism here might be the same, and once we find out what activity or address to block it will do the trick without letting the app itself know about it.
And it seems like @Th3Zer0 guys have the same direction in mind.
Bottom line: sounds like a good idea to find out how to "cheat" those things, and maybe build Xposed module/app on it
This seems to be the equivalent of downgrading whatsapp, letting you see blue ticks but other's cant see
It seems that it disables the part where you can highlight your own message and see who has seen the message though.
Working on 2.11.432.
Whatsapp just enabled a new feature a la Telegram where you can see who's typing in a group.
Contradictory to my previous report, I'm noticing that over time the "read_receipts" parameter keep reverting to a original value. What's weird though is that i was unable to pinpoint when it actually happening, since it happens without any kind of full phone restart in between.
Have you (@Bexton?) any insight on it?
And by the way, as I was talking about the sadly unpopular, but security-wise superior TextSecure, this post came out: Open Whisper Systems partners with WhatsApp.
Sounds promising, but it still remains to be seen how it all gets implemented and how much of a metadata leakage will be going on, since it is very unlikely that a proprietary and closed source SW company as WhatsApp will kill their business value (which is an insight on near 700M users' data) just like that.

android and rsync = perpetual re-copying

I've been using rsync to keep my iTunes Music folder on my mac sync'ed to the Music folder on my sdcard. As long as I only sync in one direction and carefully choose my rsync options it works pretty well. But if I make changes on my phone and try to sync them back to my mac, it gets messy. Every time I switch direction rsync thinks it needs to sync a bunch of stuff even though the files are all already identical.
I think the culprit is some combination of: 1) the vfat filesystem, which has an incompatible permissions and ownership model, and 2) the mount options, which include a umask that prevents rsync from replicating permissions from my mac, maybe including mtime?
I tried for awhile to switch my sdcard to ext4, but can't get it working. Then I tried to run a mount -o remount to change the umask, but that didn't seem to work. I'm stuck.
Old thread, but the answer is still valid: The problem here is that vfat stores time with a 2-second resolution only. rsync will detect files as changed even though they didn't change at all.
Use the "--modify-window=1" cmdline switch to ignore difference in time up to one second.
From the rsync manpage:
--modify-window
When comparing two timestamps, rsync treats the timestamps as being equal if they differ by no more than the modify-window value. This is normally 0 (for an exact match), but you may find it useful to set this to a larger value in some situations. In particular, when transferring to or from an MS Windows FAT filesystem (which represents times with a 2-second resolution), --modify-window=1 is useful (allowing times to differ by up to 1 second).
Click to expand...
Click to collapse

[GUIDE][HOWTO] Setup 2way-sync over WiFi using Unison

There are a lot of howtos about pulling/pushing content over wifi around. Taking adb or AirDroid may be reliable for common use, but i was looking for a real two-way-sync without utilizing a cloud, also i wanted not too much 3rd Party-Software involved, neither on my box nor at my phone.
Although Unison is platform-independant and can be run from Windows, i'm focussing on the Linux part (coz i've got no Windows box to test). I won't go deeper into things like howto install the required applications on your box. You won't have to compile anything, precompiled binaries should be available for your distro. Guess pacman, yum and apt-get will do their job, but if in doubt, Google will lead the way.
Requirements
A rooted device
SSHDroid installed on your Android
OpenSSH, SSHFS and Unison properly installed on your Box
SSH
After ensured the requirements above, you should be able to ssh to your android device. It's ip is shown by SSHDroid.
Code:
ssh [email protected]<yourdeviceip>
First connect will take some time, coz ssh will handshake your device and save the fingerprint. After the connect succeeded, you will be easily able to connect your device anytime over wifi.
SSHFS
SSHFS allows us to mount the whole android device to a mountpoint on your box. Compare it like a external harddisk you plug into your box usb.
First we'll create a directory in our home and then mount the device into it.
Code:
mkdir wifidroid && sshfs [email protected]<your device ip>:/sdcard/ ~/wifidroid/
SSHFS will ask for your root password anytime you try to connect. If not configured different within SSHDroid, it will be admin. You're ought to change it for safety reasons. After above steps, your device is mounted into wifidroid. You can easily browse the contents using your preferred linux filemanager (like dolphin or nautilus). To unmount device, use fusermount -u ~/wifidroid/ later.
UNISON
Unison will handle the syncing between your box and your device. It comes with an cli and even with a gui. Whatever you will use is up to your personal preference.
First of all we're going to create the unison profile directory and a basic example profile for syncing pictures.
Code:
mkdir ~/.unison && touch pictures.prf
Open pictures.prf with your preferred editor (nano, vi, kate, gedit, orwutevah) and write down some config stuff.
Code:
root=/home/<username>/Pictures
root=/home/<username>/wifidroid/Pictures
path=Friends
path=Landscape
path=Misc Stuff
perms=0
ignore=Name .*~
ignore=Name *~
ignore=Name .*
The first root=/home/<username>/Pictures points to your local pictures directory, whereas the second one, root=/home/<username>/wifidroid/Pictures points to the pictures-folder at your mounted android device. Unison syncs recursevly, so it would simply sync anything beneath the directory Pictures. If you want to sync only some Subfolders, use path=Friends i. e. to include Pictures/Friends. You may edit this to your own convince. We don't want unison to set permissions on synced files, so we set perms=0. Rest should be self explanatory.
Okay, now just fire up unison with unison pictures for cli-version, or unison-gtk pictures for the gui-version and syncing should begin.
Keep in mind that, depending on your wifi speed, it will take a huge amount of time to sync a whole mp3/picture library for the first time. After first sync things should be butter smooth
Above example is just a basic profile. You can easily use unison to backup your whole device, or, as i do, make regular backups of your Camera-Roll, WhatsApp and Threema Backups. If you wanna go deeper into this, you should take a look at the Unison Reference Guide.
Genericxx said:
There are a lot of howtos about pulling/pushing content over wifi around. Taking adb or AirDroid may be reliable for common use, but i was looking for a real two-way-sync without utilizing a cloud, also i wanted not too much 3rd Party-Software involved, neither on my box nor at my phone.
Although Unison is platform-independant and can be run from Windows, i'm focussing on the Linux part (coz i've got no Windows box to test). I won't go deeper into things like howto install the required applications on your box. You won't have to compile anything, precompiled binaries should be available for your distro. Guess pacman, yum and apt-get will do their job, but if in doubt, Google will lead the way.
Requirements
A rooted device
SSHDroid installed on your Android
OpenSSH, SSHFS and Unison properly installed on your Box
SSH
After ensured the requirements above, you should be able to ssh to your android device. It's ip is shown by SSHDroid.
Code:
ssh [email protected]<yourdeviceip>
First connect will take some time, coz ssh will handshake your device and save the fingerprint. After the connect succeeded, you will be easily able to connect your device anytime over wifi.
SSHFS
SSHFS allows us to mount the whole android device to a mountpoint on your box. Compare it like a external harddisk you plug into your box usb.
First we'll create a directory in our home and then mount the device into it.
Code:
mkdir wifidroid && sshfs [email protected]<your device ip>:/sdcard/ ~/wifidroid/
SSHFS will ask for your root password anytime you try to connect. If not configured different within SSHDroid, it will be admin. You're ought to change it for safety reasons. After above steps, your device is mounted into wifidroid. You can easily browse the contents using your preferred linux filemanager (like dolphin or nautilus). To unmount device, use fusermount -u ~/wifidroid/ later.
UNISON
Unison will handle the syncing between your box and your device. It comes with an cli and even with a gui. Whatever you will use is up to your personal preference.
First of all we're going to create the unison profile directory and a basic example profile for syncing pictures.
Code:
mkdir ~/.unison && touch pictures.prf
Open pictures.prf with your preferred editor (nano, vi, kate, gedit, orwutevah) and write down some config stuff.
Code:
root=/home/<username>/Pictures
root=/home/<username>/wifidroid/Pictures
path=Friends
path=Landscape
path=Misc Stuff
perms=0
ignore=Name .*~
ignore=Name *~
ignore=Name .*
The first root=/home/<username>/Pictures points to your local pictures directory, whereas the second one, root=/home/<username>/wifidroid/Pictures points to the pictures-folder at your mounted android device. Unison syncs recursevly, so it would simply sync anything beneath the directory Pictures. If you want to sync only some Subfolders, use path=Friends i. e. to include Pictures/Friends. You may edit this to your own convince. We don't want unison to set permissions on synced files, so we set perms=0. Rest should be self explanatory.
Okay, now just fire up unison with unison pictures for cli-version, or unison-gtk pictures for the gui-version and syncing should begin.
Keep in mind that, depending on your wifi speed, it will take a huge amount of time to sync a whole mp3/picture library for the first time. After first sync things should be butter smooth
Above example is just a basic profile. You can easily use unison to backup your whole device, or, as i do, make regular backups of your Camera-Roll, WhatsApp and Threema Backups. If you wanna go deeper into this, you should take a look at the Unison Reference Guide.
Click to expand...
Click to collapse
Thanks will try
Nice job mate. I will try it.
Thanks @Genericxx, it looks complicated at first, but after reading a while it makes complete sense,
For anyone who wants an easier way for syncing between PC windows and Android, i'd recommend ES File Explorer and Goodsync (on windows PC)
First enable FTP Remote manager in ES through a WiFi same with ur PC windows. Then open Goodsync and setup a sync wizard and choose FTP and then the ip address from ES on the Right (destination)sync folder.
It works great on the Note 2 and it is awesome app! 5 star on market and thanks here.
No need to be root
Great guide, thanks a lot!
I have two things to add.
1. You do not need to root your Android device to use SSHDroid.
2. As the user of a non-rooted device, I ran into the problem of permissions when using unison. The solution:
Apart from having the
perms = 0
line in your .prf file, also add
dontchmod = true
So, my file looks like this:
Code:
perms=0
dontchmod = true
root=/home/<username>/Pictures
root=/home/<username>/wifidroid/Pictures
ignore=Name .*~
ignore=Name *~
ignore=Name .*
Placing "perms=0" and "dontchmod = true" at the beginning of the file may be important (I read it somewhere), but maybe it is not.
And it works nicely with my non-rooted device. Thanks again!
Check also UnisonSync:
https://play.google.com/store/apps/details?id=net.danielroggen.unisonsync
It's a Unison client for Android with GUI.
The advantage of unison client (rather than server) on the answer Android device is that you can connect to your server even if your shoe Android device is on a different subnet or behind a firewall (as long as your server is accessible of course).
Cheers,
D.

Categories

Resources