Monthly Archives: June 2014

How to compile rsync for Android in Ubuntu

My situation

My machine

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04 LTS
Release:    14.04
Codename:   trusty

The latest rsync version to compile (for me it was rsync-3.1.0.tar.gz)

$ curl -s http://rsync.samba.org/ftp/rsync/ \
    | sed -r 's/^.*href="([^"]*)".*$/\1/' | grep 'rsync-[0-9].*\.tar\.gz$'

Procedure

  1. save the tarball name in a variable
    $ RSYNCTGZ="rsync-3.1.0.tar.gz"
    
  2. install needed software
    $ sudo aptitude install gcc-arm-linux-gnueabi
    
  3. download sources
    $ wget http://rsync.samba.org/ftp/rsync/$RSYNCTGZ
    $ tar xzf $RSYNCTGZ
    $ cd rsync-[0-9]*
    
  4. compile
    $ ./configure --host=arm-linux-gnueabi CFLAGS=-static
    $ make
    
  5. install on the device
    $ adb push rsync /data/local/tmp && adb shell chmod 775 /data/local/tmp/rsync
    
  6. test execution
    $ adb shell /data/local/tmp/rsync
    

References

Override DNS for KitKat – first release

Override DNS for KitKat has been released

Override DNS icon

Override DNS is the easiest way to force your rooted phone to use custom nameservers on mobile networks.

Many things dealing with name resolution have changed in Android 4.4 KitKat and so all the current Play Store apps stopped working.

The problem I found with this release of Android (4.4) is that, apparently for caching reasons, the system behaviour has been changed to redirect all DNS queries to a system daemon called netd (here’s a link to a presentation related to Android networking before 4.4 which, however, covers part of this topics).

The getprop/setprop method used by all the DNS changer apps does not work anymore. Those values, when changed, get simply ignored by the netd daemon.

It’s necessary to communicate directly to the daemon via the /dev/socket/netd socket.

The app automatically guesses the network device name and applies the right commands each time a mobile network gets activated.