Saturday, April 21, 2018

Agata converts from Apple to Android

Sing Hallelujah

Subtitle: A bitter sweet ending

My development / party / other phone is a shiny Nexus 5X rocking Android 8 Oreo.

Imagine my surprise when my wonderful wife expressed an interest in using it for a forthcoming Marathon.  Now since the phone has an unlocked Bootloader,  a custom TWRP recovery image and is fully rooted I thought this was too powerful a combination to hand to this hardcore Apple User.

She could accidentally trash the whole phone.  So here is how I put the phone back to stock

Unrooting my Android Phone

01 Download the Correct Package from Google

I download loaded the bullhead Nexus 5X package from here

02 Install ADB Toolkit and test with fastboot

Download to your PC the drivers that will allow you to talk to the Android phone bootloader.   Many sources available.  Try clockwork mod first

After installation connect your phone to the PC and copy all the package files i.e. the 2 .img and 1 .zip files to the same directory where fastboot.exe is located.

03 Boot phone into Bootloader
For the Nexus 5X power off the phone, then power on pressing power ON and downward arrow button together

04 Check Fastboot

Get the fastboot devices command to return the id of your phone.   If fastboot shows a blank then first try a different cable, else next you will have to try a different ADB installation.  Painful but you can't get anywhere until fastboot devices returns something

05 Replace Bootloader

 fastboot flash bootloader bootloader-bullhead-bhz31b.img

Replace any custom bootloader with official file

06 Reboot to Bootloader

fastboot reboot-bootloader

07 Replace Radio

fastboot flash radio radio-bullhead-m8994f-

Replace the radio i.e. code that talks to your SIMcard providing telephony

08 Reboot to Bootloader

 fastboot reboot-bootloader

09 Replace the Operating System et Al

fastboot -w update

The output was thus:

extracting android-info.txt (0 MB)...
extracting boot.img (11 MB)...
target reported max download size of 536870912 bytes
archive does not contain 'boot.sig'
archive does not contain 'dtbo.img'
archive does not contain 'dt.img'
extracting recovery.img (17 MB)...
archive does not contain 'recovery.sig'
extracting system.img (1909 MB)...
archive does not contain 'system.sig'
archive does not contain 'vbmeta.img'
extracting vendor.img (185 MB)...
archive does not contain 'vendor.sig'
wiping userdata...
Couldn't parse erase-block-size '0x'.
Couldn't parse logical-block-size '0x'.
Creating filesystem with parameters:
    Size: 27283927040
    Block size: 4096
    Blocks per group: 32768
    Inodes per group: 8176
    Inode size: 256
    Journal blocks: 32768
    Blocks: 6661115
    Block groups: 204
    Reserved block group size: 1024
Created filesystem with 11/1667904 inodes and 148720/6661115 blocks
wiping cache...
Couldn't parse erase-block-size '0x'.
Couldn't parse logical-block-size '0x'.
Creating filesystem with parameters:
    Size: 100663296
    Block size: 4096
    Blocks per group: 32768
    Inodes per group: 6144
    Inode size: 256
    Journal blocks: 1024
    Blocks: 24576
    Block groups: 1
    Reserved block group size: 7
Created filesystem with 11/6144 inodes and 1422/24576 blocks
Bootloader Version...: BHZ31b
Baseband Version.....: M8994F-
Serial Number........: 01e1949a26c04e96
checking product...
OKAY [  0.020s]
checking version-bootloader...
OKAY [  0.015s]
checking version-baseband...
OKAY [  0.018s]
sending 'boot' (11789 KB)...
OKAY [  0.349s]
writing 'boot'...
OKAY [  0.111s]
sending 'recovery' (17433 KB)...
OKAY [  0.460s]
writing 'recovery'...
OKAY [  0.218s]
erasing 'system'...
OKAY [  0.487s]
sending sparse 'system' 1/4 (511320 KB)...
OKAY [ 13.218s]
writing 'system' 1/4...
OKAY [  5.874s]
sending sparse 'system' 2/4 (524130 KB)...
OKAY [ 13.398s]
writing 'system' 2/4...
OKAY [  5.734s]
sending sparse 'system' 3/4 (500189 KB)...
OKAY [ 13.019s]
writing 'system' 3/4...
OKAY [  6.165s]
sending sparse 'system' 4/4 (419689 KB)...
OKAY [ 10.760s]
writing 'system' 4/4...
OKAY [  4.321s]
erasing 'vendor'...
OKAY [  0.108s]
sending 'vendor' (190308 KB)...
OKAY [  4.354s]
writing 'vendor'...
OKAY [  2.552s]
erasing 'userdata'...
OKAY [  2.947s]
sending 'userdata' (138993 KB)...
OKAY [  3.188s]
writing 'userdata'...
OKAY [  1.343s]
erasing 'cache'...
OKAY [  0.075s]
sending 'cache' (5688 KB)...
OKAY [  0.211s]
writing 'cache'...
OKAY [  0.083s]

finished. total time: 89.252s

10 Reboot to Bootloader

 fastboot reboot-bootloader

11 Lock Bootloader

fastboot oem lock

12 Give the phone to Agata for her customisation

Initially I had trouble connecting my PC to the Nexis 5X.  fastboot refused to work.  I had to move to an alternate Windows PC and use a different ADB installation.

Once fastboot worked the process will take you literally minutes from start to finish.

Then on the final reboot you will have a factory fresh phone without any extra applications or data for you to customise.

And Just one More Thing

After all this effort there was a kicker to the end of the story.  Agata has now confessed that she does not want to take her precious Apple iPhone on the marathon.  The implication is that instead she would like to take my lesser Android phone instead.

I mean the barefaced cheek of it :-)

I can only hope that when see seas the beautiful seamless and superior Android experience she will at last begin to consider jumping out of that Apple walled garden.  It's so much better outside. It's just not Double Dutch.   

This is Double Dutch: