Tag Archives: android

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.

Postphone v1.1.0

There’s a new version of Postphone. Huge list of things, here’s the full changelog:

    Improvements:
      New feat Google Android Backup Service (settings and database)
      Issue-001 now app keeps alarms upon reboot
      Hotfix-002 now when you receive a call with unknown Caller ID, 
           no popup is shown
    
    Application workflow:
      You must check or dismiss notification to remove alarm
    
    Code:
      Min SDK change from 7 to 8 (drop support for Eclair)
      DatabaseHelper class replaces DBAdapter
      Allow to upgrade from db v0 to db v1 and allow future upgrades
      Remove old code doTheVibration() and playSound()
      File rename popupcallback => popupcallback.xml
      Fix some typos
      Lower the number of events logged
    
    Developer side:
      New utility emulate-reboot
      New utility insert-fake-passed-calls with support for TZ
      New utilities for backup
      Change tmp path in sqlite-postphone-db utility
      Publish notes
      Backup notes
    
    Debug menu:
      Is disabled by default
      Can now be enabled via multiple taps on version name
      New menu entry "clear alarms table"
      New menu entry "test PopUpAfterCall"
    
    Design and blog:
      Blog featured banner
      Official logo.png

Debugging IO on Android

Android is Linux based, so there are some interesting way to monitor and debug IO activity especially on storage.

The one I found more useful is this:

  1. enable dumping of IO info
    echo 1 > /proc/sys/vm/block_dump
  2. observe kernel log
    cat /proc/kmsg
  3. make your analysis
  4. disable dumping of IO info
    echo 0 > /proc/sys/vm/block_dump

The output you will get is similar to this:
<7>[71477.927886] kswapd0(24): WRITE block 21240712 on mmcblk0p12 (8 sectors)
<7>[71477.928436] kswapd0(24): WRITE block 21410792 on mmcblk0p12 (8 sectors)
<7>[71477.928710] kswapd0(24): WRITE block 21240704 on mmcblk0p12 (8 sectors)
<7>[71477.929016] kswapd0(24): WRITE block 21240656 on mmcblk0p12 (8 sectors)
<7>[71477.929443] kswapd0(24): WRITE block 25427968 on mmcblk0p12 (8 sectors)
<7>[71477.929687] kswapd0(24): WRITE block 8 on mmcblk0p12 (8 sectors)
<7>[71477.930084] kswapd0(24): WRITE block 0 on mmcblk0p12 (8 sectors)
<7>[71478.086639] sdcard(159): READ block 23431168 on mmcblk0p12 (256 sectors)
<7>[71478.087036] sdcard(159): READ block 23430912 on mmcblk0p12 (8 sectors)
<7>[71478.258148] sdcard(159): READ block 23430920 on mmcblk0p12 (200 sectors)
<7>[71478.258514] sdcard(159): READ block 23431424 on mmcblk0p12 (8 sectors)
<7>[71478.266967] sdcard(138): READ block 23430656 on mmcblk0p12 (32 sectors)
<7>[71478.268798] sdcard(159): READ block 23430688 on mmcblk0p12 (64 sectors)
<7>[71478.269409] sdcard(159): READ block 23430752 on mmcblk0p12 (128 sectors)
<7>[71478.271484] sdcard(159): READ block 23430880 on mmcblk0p12 (32 sectors)
<7>[71478.600646] sdcard(138): READ block 23431432 on mmcblk0p12 (512 sectors)
<7>[71478.765136] sdcard(159): READ block 23431944 on mmcblk0p12 (256 sectors)
<7>[71478.958129] Compiler(412): READ block 327320 on mmcblk0p11 (8 sectors)
<7>[71478.958557] Compiler(412): READ block 327400 on mmcblk0p11 (48 sectors)

Tried on my rooted Galaxy Nexus with CyanogenMod 10.1.0-RC1.