Nexus 5x bootloader unlock, TWRP recovery, decrypt, and Rooting


marshmallow android (6.0)이 업데이트 되면서 
Nexus 5x의 rooting이 이전들의 reference phone과 다르게 좀 새로운 것들이 포함된다.
이유는 SELinux의 전격 도입에 따른 문제 같다.
항상 Android는 Security 부분에서 많은 학계 논문들이 출간 되었는데 그동안 부분적으로 체택한 걱에 반해서 이번 버전에서는 전격적으로 모두 도입한것 같다. 따라서 여러번 해본 Rooting이지만 조금은 오랜만에 자세히 다뤄 본다.

현재까지 출시된 Nexus 5x version

bullhead" for Nexus 5X
6.0.0 (MDA89E)
6.0.0 (MDB08I)
6.0.0 (MDB08L
6.0.0 (MDB08M)
6.0.1 (MMB29K)
6.0.1 (MMB29P)

rooting 순서

Prerequisites

  1. Nexus 5x usb drives installation
  2. ADB and Fastboot installation
  3. USB debugging mode enable > Go to Settings > About device. Locate build no. and tap on it 7-8 times or until you get toast notification saying you’re now a developer’

Bootloader OEM Unlock

Enable OEM Unlock in developer options
go to Seetings > Developer Options -> Enable OEM Unlock

adb reboot bootloader

Bootloader로 reboot 된다. 그러면 아래의 두 메시지를 볼 수 있다.
SECURE BOOT - enabled
DEVICE STATE - locked

root@jemin-virtual-machine:~# fastboot oem unlock
...
OKAY [  8.031s]
finished. total time: 8.031s

DEVICE STATE - unlocked
boot loader unlcok을 하면, your softweare can't be checked for corruption. 이라는 메시지가 나오게 된다. unlock을 했으므로 보안에 취약한 것은 어쩔수 없다.

Flash modified bootloader image

이부분이 기존과 다른데 수정된 boot loader image를 올리지 않으면 루팅을 할 수 없게 된다.
자신의 build number에 맞춰서 다운 받는다.
boot image: http://forum.xda-developers.com/showpost.php?p=63781454&postcount=143

공식사이트: http://forum.xda-developers.com/apps/supersu/wip-android-6-0-marshmellow-t3219344

# fastboot flash boot boot.img 
target reported max download size of 536870912 bytes
sending 'boot' (11472 KB)...
OKAY [  1.506s]
writing 'boot'...
OKAY [  0.199s]
finished. total time: 1.705s

decrypt 확인
Setting -> Security -> Encrpt phon
팝업창으로 해당폰을 encrypt하라고 나온다면 정상적으로 decrypt된 것이다.
이제 SuperSU를 recovery 모드에서 찾을 수 있다.
이것이 안되면 Recovery mode에서 SuperSU.zip 파일이 보이지 않으니 반드시 이부분을 확인 해야 한다.

어째서 Modified boot.img를 flash 해야하는지에 대한 이유가 이 부분이다.

TWRP recovery mode 설치

공식사이트: https://twrp.me/devices/lgnexus5x.html
사용된 버전: twrp-2.8.7.0-bullhead.img

# adb reboot bootloader
# fastboot flash recovery twrp-2.8.7.0-bullhead.img
target reported max download size of 536870912 bytes
sending 'recovery' (16240 KB)...
OKAY [  2.084s]
writing 'recovery'...
OKAY [  0.264s]
finished. total time: 2.348s

WIPE
Wipe -> Format Data -> enter "yes" in the form
reboot -> do not install

swipe to factory reset의 경우 default 기능으로 user data from the phone, including your installed apps, cache, and dalvik cache를 초기화 한다. 하지만, This will not effect the internal or SD card storage area of your phone, meaning your documents, downloads, pictures, music, videos and other files will stay safe.
위에 언급한 부분까지 모두 wipe 하고 싶다면, Format Data를 사용 한다.

SuperSU

공식 사이트: http://forum.xda-developers.com/showthread.php?t=1538053
버전 변화 정보: http://forum.xda-developers.com/showpost.php?p=23427824&postcount=3
How-To SU: http://su.chainfire.eu/

SuperSU 2.66 beta 버전을 sdcard로 이동 시킴.
USB typeC 이므로 위에서 data transfer로 설정을 해줘야 SDCard가 인식 된다.

adb push BETA-SuperSU-v2.66-20160103015024.zip /sdcard/
975 KB/s (4272471 bytes in 4.275s)

결과

최종적으로 root checker basic app을 다운받아 확인해보면 아래와 같이 루팅이 성공한 것을 알 수 있다.

encrypt도 decrypt 되었으므로 성능 degradation 사라졌다.
Congratulations!

기타 자료

Recovery Mode

2014년만 해도 ClockworkMod (a.k.a CWM)이 거의 대부분 사용하는 custom recovery 모드 였다.

CWM recovery

최근, TeamWin Recovery Project(aka TWRP)에 의해서 완벽한 touch based custom recovery가 구현 되어졌다. 초반에는 단지 Nexus 계열의 장치만을 지원 하다가 최근에 들어서는 셀수 없이 많은 smartphone을 지원하기 시작 했다.

공식사이트: https://twrp.me/devices/lgnexus5x.html

TWRP recovery

Reference

YouTube: https://www.youtube.com/watch?v=mUq1xdJ-7-E#t=143
How to Root: http://forum.xda-developers.com/nexus-5x/general/guide-how-to-install-custom-recovery-t3231143
How To guide For Beginners: http://forum.xda-developers.com/nexus-5x/general/guides-how-to-guides-beginners-t3206930


+ Recent posts