Nexus 5x Unlock Bootloader, Flash TWRP and SuperSU

Warning

Use this howto at your own risk, I am not responsible if you brick your device and I will not support you.

Prerequisites

  • Nexus 5x Bullhead
    • LGH791F 32GB
  • Linux Desktop or Laptop
    • adb and fastboot installed
      • android-tools-adb
      • android-tools-fastboot

Steps

Enable USB-Debugging

Go to Settings -> System -> About Phone -> Build number and hit it about 5 times until you’re a developer.

Go to Settings -> System -> Options for developers -> USB Debugging -> On

Enable OEM Unlock

Go to Settings -> System -> Options for developers -> USB Debugging -> On

See if adb is working

sudo adb devices

Unauthorized

At first I was presented with the following.

This was because I forgot to sudo the command above.

* daemon not running. starting it now on port 5037 * 
* daemon started successfully * 
List of devices attached 
????????????    no permissions

Restart adb-server

sudo adb kill-server
sudo adb start-server

See if adb is working now

sudo adb devices
List of devices attached 
02566a514593b4ac        device

Reboot into bootloader

sudo adb reboot-bootloader

List device

sudo fastboot devices
02566a514593b4ac        fastboot

Unlock the bootloader

Warning: This will erase your phone completely, be sure to have backed up everything!

sudo fastboot oem unlock

Confirm it on your screen

Reboot device

Don’t skip this step, this will reboot your device.

sudo fastboot reboot

Enable USB-Debugging (again)

Go to Settings -> System -> About Phone -> Build number and hit it about 5 times until you’re a developer.

Go to Settings -> System -> Options for developers -> USB Debugging -> On

Allow all future connections from your computer

Enable OEM Unlock

This should still be on.

See if adb is working

sudo adb devices

All is well if you see:

List of devices attached 
02566a514593b4ac        device

Reboot into bootloader

sudo adb reboot-bootloader

Download TWRP

Download the most recent .img file from https://eu.dl.twrp.me/bullhead/

Flash the TWRP image to the Recovery partition

For some reason the defice was locked again after the reboot so I had to unlock it again.

cd Downloads/
sudo fastboot flash recovery twrp-3.1.1-0-bullhead.img
target reported max download size of 536870912 bytes 
sending 'recovery' (14604 KB)... 
OKAY [  0.545s] 
writing 'recovery'... 
FAILED (remote: device is locked. Cannot flash images) 
finished. total time: 0.564s
sudo fastboot oem unlock
... 
OKAY [  5.490s] 
finished. total time: 5.490s
sudo fastboot flash recovery twrp-3.1.1-0-bullhead.img
target reported max download size of 536870912 bytes 
sending 'recovery' (14604 KB)... 
OKAY [  0.440s] 
writing 'recovery'... 
OKAY [  0.159s] 
finished. total time: 0.599s

Get into Recovery mode

Press down a couple of times until it shows recovery mode and press power to confirm

Download SuperSU

Download the .zip file from https://download.chainfire.eu/1220/SuperSU/

Upload SuperSU to your internal SD

adb push SR5-SuperSU-v2.82-SR5-20171001224502.zip /sdcard/
6589 KB/s (6882992 bytes in 1.020s)

Install SuperSU .zip

Install -> Browse to SR5-SuperSU-v2.82-SR5-20171001224502.zip and select it.

Swipe

To confirm the installation.

Reboot

You might get a prompt about the device being unable to decrypt your previously encrypted volume, it’ll bring you back to TWRP to do a factory reset.

Install AICP Oreo ROM

Download AICP

Download the latest nightly on http://dwnld.aicp-rom.com/?device=bullhead and get into TWRP.

Download Magisk

Download Magisk Manager Latest Version 7.2.0 For Android 2019

AICP doesn’t go well with SuperSU but it does with Magisk.

Download OpenGApps

http://opengapps.org/

ARM64 -> 8.0 -> Full

Upload the .zip files

adb push aicp_bullhead_o-13.0-NIGHTLY-20171020.zip /sdcard/
adb push Magisk-v14.0.zip /sdcard/
adb push open_gapps-arm64-8.0-full-20171020.zip /sdcard/

Flash AICP & Magisk

This is the usual procedure through TWRP, wipe caches afterwards and boot into the system.

Install OpenGApps

This took me some debugging as the nano version didn’t work, but the full version might do.

 

 

 

Leave a comment

Your email address will not be published. Required fields are marked *