Thursday, February 18, 2016

Upgrading to TWRP 3.0

TWRP, Team Win Recovery Program  is a small program allowing you to install new Android Builds onto your Unlocked Android Phone.

For many OnePlus One phone users such as Marcus I perform a daily Android Upgrade to the next beta level of the Android 6.0.1  Cyanogen Operating System release, since it is still not in production.

Normally after poweron the phone runs a program called the Bootloader and that loads the Operating System.

Instead you can load TWRP and then there are lots of options to make a backup, restore from a backup, or in the normal case install a new Operating System.

With the latest 6.0.1 OS builds this is automated in that

a) in Android you check for Cyanogenmod new releases

b) There is normally a new 300MB or so daily release

c) You download that inside the OS and at the end of the download it asks whether you want to reboot into TWRP and apply the update

d) This is so called 'dirty flashing' meaning you are effectively overlaying  (via the tar command) a set of files on top of the existing installation.  Not doing a fresh install

e) Dirty flash is prefered though sub optimal.   The dirty takes minutes to overlay and then about another 10 minutes to reboot.  Then you are done and all your apps and passwords and settings are in place.

Why Use TWRP 3.0

  • Some older TWRP were not able to cope with changing the phones radio firmware, and then on reboot you lost the ability to make any calls  (because the OS and everything but the phone firmware was upgraded)
  • For users of encrypted phones there was a stupid bug that the TWRP only allowed a 3x3 unlock pattern.  So if in the OS you set a higher say 4x4 pattern you could not unlock the phone in TWRP,  v3.x corrects this oversight

How did we do it

C:\oneplus\sdk>fastboot devices
a22278a8        fastboot

C:\oneplus\sdk>fastboot oem unlock
OKAY [ -0.000s]
finished. total time: -0.000s

C:\oneplus\sdk>fastboot flash recovery twrp-3.0.0-0-bacon.img
target reported max download size of 1073741824 bytes
sending 'recovery' (11504 KB)...
OKAY [  0.374s]
writing 'recovery'...
OKAY [  0.156s]
finished. total time: 0.530s

C:\oneplus\sdk>fastboot reboot

finished. total time: 0.000s


Some Screenshots
The interface now uses material design so it looks more hip and trendy.

Example using TWRP 3 to install new OS
(via dirty flash overwrite)

 Selected file downloaded earlier

 The files are overlaid

 Phone reboots

 Cyanogen starts

 About 10 minutes later

 Enter phone PIN and done.

Find latest  TWRP binary
I downloaded latest TWRP (Team Win Recovery Program) from here leading to a twrp-3.0.0-0-bacon.img from here

See Also
Android 6.0 and CyanogenMod and Oneplus One

Cyanogenmod Android 6.0.1 stable again or Not