codestruct blog

Replicant Mobile OS - Part 2

This is part 2 of Unboxing the Tehnoetic S2 phone with Replicant.

USB Networking (failed)

The following is based on this Replicant USB Networking article. It does not work for me yet, but here are my intermediate steps.

Download the script and make it executable.

$ sudo zypper install android-tools # for the adb command
$ sudo zypper install bridge-utils  # to make the script work correctly

"Make sure to have installed ADB and to have the host daemon running as root."

$ adb root
root access is disabled by system setting - enable in settings -> development option

Go to Settings -> Developer Options (under the System section) -> Root access -> (default was "Apps only", I switched it to "ADB only")

$ adb root
restarting adbd as root
$ ./ rndis
Starting RNDIS...
root's password:
Pinging the phone...
PING ( 56(84) bytes of data.

--- ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 1.758/1.758/1.758/0.000 ms

The next command did not succeed and I had to restart the openSUSE host in order to get the networking work again. So, make sure the brctl is installed (in package bridge-utils). And it must be sudoed because otherwise ifconfig is not found.

$ sudo ./ nat
Configuring NAT...
net.ipv4.ip_forward = 1
Setting up phone routes and DNS...

Android asks you to accept the host. Answer 'yes' on the phone.

* daemon not running. starting it now on port 5037 *
cannot bind 'tcp:5037'
ADB server didn't ACK
* failed to start daemon *
error: cannot connect to daemon

In this case sudo ./ stop-all does not work and the host must be restarted.

So, no success so far:

Next steps:

Initial phone setup

These are the next things I did to initialize the phone.

  • Insert SIM card.
  • Phone works.
  • Internet works (over mobile connection).
  • F-droid works
  • Noticed graphics error :(
    • Installed a game app (Gravity Defied - Trail racing game) which caused the phone to get considerably warmer and show graphics errors (colored horizontal lines and then false colors over the whole screen) even after reboot. After some time the graphics errors went away (maybe because the phone got cooler).

Import contacts from old phone

Old phone:

  • Select all contacts
  • Send via bluetooth to a phone where bluetooth is working
  • There were concerns that this action would automatically import the contacts to the other phones address book, but only a vcf file was received.
  • This vcf file was then moved over a PC using an USB cable connection.

New phone:

  • Open People, select menu, Import/Export, choose "import from Storage" which automatically found the vcf file on the SD card. Select it and the contacts are imported.

Messenger / Migrate Kontalk

  • Install Kontalk (10 MB)
  • Export key on old phone -> password protected zip file stored on sd card
  • Put SD card into new phone
  • Import key file on new phone. Contacts are automatically loaded and ready to chat.

No status LED

EDIT: The front status LED does not work... because the Samsung S2 does not have one! (

No free Bluetooth firmware

Remove the questionmark from the lockscreen

There is an orange questionmark on the lock screen which looks rather odd.

Goto to Settings > Lock screen > Clock widget > Weather panel and disable it.

Slower 2D graphics

One thing noticeable thing is that animations (scrolling, open/closing an app) are often a little studdering compared to my old phone.

Backup / Send back the phone

After a few days the above-mentioned graphics error re-appeared and became permanent. Before I send the phone back for replacement I will try to backup most of the data that was accumulated by now

List of installed apps

In alphabetical order:

  • Adblock Plus - needs root access if not only ads over Wifi should be blocked (remember that there is no Wifi support out of the box)
  • Apollo - pre-installed music player
  • Arity - graphical calculator
  • Barcode Scanner - did not recognize any of the barcodes and QR codes I tried
    • QR Scanner - did also not work
  • Calendar Import-Export
    • together with Offline Calender
  • Conversations - XMPP client
  • Cowsay
  • FreeOTP - for two-factor authentication
  • Interactive Story - an interactive Mars story which is over after 1 minute
  • Lightning - alternative browser
  • Meeting-Cost-Clock
  • RadioDroid
  • robotfindskitten
  • Silence - Send encrypted SMS
  • Turbo Editor - Decent text editor for taking notes
  • WaveUp - turn on / off screen by using the proximity sensor

Backup data with MTP (failed)

The MTP connection was not reliable from the beginning. The device contents were listed but after copy and paste there was the message "The process for the mtp protocoll died unexpectantly" and now the Device Notifier does not stop from popping up and disappear (and sometimes steals focus).

Next steps: find out how to debug this.

Backup with other methods

  • Bluetooth: not working because of missing firmware
  • Wifi: not working because of missing firmware
  • Computer USB connection and then choose Mass storage instead of "Media Device (MTP)": it did not work at first (the computer does not detect any device, even when waiting a few minutes) but there is another "Turn on USB storage" that has to be activated.
  • OTG cable ("USB on the go"): connected USB stick was recognized and data could be transferred
    • TODO: howto unmount?

Backup with Android Debug Bridge

Backup SD card

adb pull /storage/sdcard0 also copies hidden files as desired. ('-p' to display the transfer progress) ('-a' means copy timestamp and mode)

adb root
cd /local/backupdir/sdcard0
adb pull -p -a /storage/sdcard0

Note that with the -a option the files may not readable for 'user'. So the permissions must be adapted afterwards.

Backup contacts

People -> Menu -> Import/Export -> Export To Storage

cd /local/backupdir/contacts
adb pull -p -a /storage/sdcard0/00002.vcf

Backup bookmarks

cd /local/backupdir/bookmarks
adb backup

Test restore:

adb restore backup.ab

I deleted some bookmarks to test the restore which worked fine.

I made no backup for: SMS messages, Kontalk messages, homescreen settings, lockscreen settings, regional settings

Delete data and do factory restore

  • Power off
  • Remove SIM card
  • Boot
  • Filebrowser > /storage/sdcard0 > Select all > Delete
  • Settings > Backup & Reset > Factory data reset, check the "Erase SD card" to be sure, "Reset phone" (draw your unlock pattern to confirm), "Erase everything"
    • Phone reboots automatically (takes longer than normal)

Then, I sent back the phone and now I wait for replacement.

TODO: include discussion capability to this blog post.