[Guide] Pixel XL Android 7(Nougat) Unlock/Install Stock Images + Kernels/Recovery +

Search This thread

GroovinChip

Senior Member
Aug 7, 2016
370
177
Hi, new PIxel XL owner here, just got my device from Google in the mail today. I have a question about the guide in the OP. Is the custom kernel necessary for this procedure? What benefits do the custom kernels bring? Also, would I be able to simply flash TWRP and Magisk? Is it necessary for me to install a factory image before I do any of this (I don't think so, but I ask because those steps are first in the OP, before TWRP and root)?
 

pcriz

Senior Member
Aug 23, 2008
5,009
2,934
Changelog:
- ZIP: Detect TWRP UI slot switch (Pixel/XL: 3.1.0-RC2+)

For my own curiosity what exactly does that mean, or a better question is whats the delta in performance between having that and not having it detect a slot switch? Does that mean we can flash su in the same session as the rom and twrp? As opposed to having to reboot once and then flash?
 

Kisakuku

Senior Member
Oct 31, 2011
2,590
4,617
For my own curiosity what exactly does that mean, or a better question is whats the delta in performance between having that and not having it detect a slot switch? Does that mean we can flash su in the same session as the rom and twrp? As opposed to having to reboot once and then flash?
No, this is detection of a manual slot switch using the TWRP UI, after TWRP is booted but before SuperSU is flashed.
 

Homeboy76

Senior Member
  • Aug 24, 2012
    2,574
    1,249
    Hi, new PIxel XL owner here, just got my device from Google in the mail today. I have a question about the guide in the OP. Is the custom kernel necessary for this procedure? What benefits do the custom kernels bring? Also, would I be able to simply flash TWRP and Magisk? Is it necessary for me to install a factory image before I do any of this (I don't think so, but I ask because those steps are first in the OP, before TWRP and root)?

    If you have the latest Pixel XL firmware August 2017 with current bootloader and radio. You can check the Build Number of your firmware by Clicking Settings > About phone. If the Build number is NGH47Q, NJH47F, NKG47S, or NZH54D depending on your carrier. You have the latest firmware installed, start at #5d. Skip #5e3. If not I would suggest you do #3 and #5. Yes the kernel is necessary to install Magisk. If you want to know the benefits of Custom Kernels click on the kernel links
     

    GroovinChip

    Senior Member
    Aug 7, 2016
    370
    177
    OK I have another question before I get started on this. Does having a different kernel mean that the camera won't function the same way that it does normally? I mean with all the EIS awesomeness and generally Pixel camera goodness. Also, will installing a custom kernel remove all my apps and data?
     

    Homeboy76

    Senior Member
  • Aug 24, 2012
    2,574
    1,249
    OK I have another question before I get started on this. Does having a different kernel mean that the camera won't function the same way that it does normally? I mean with all the EIS awesomeness and generally Pixel camera goodness. Also, will installing a custom kernel remove all my apps and data?

    I've never heard/read of a kernel affecting camera functions on a stock ROM. So, your 'EIS (Electronic image Stabilization) awesomeness and general camera goodness' should function 'the same way that it does normally'. No, the kernel will not remove all your apps and data. That is why I suggested #3 (Install Factory Image and keep data) and #5 if you need to update your firmware.
     

    GroovinChip

    Senior Member
    Aug 7, 2016
    370
    177
    I've never heard/read of a kernel affecting camera functions on a stock ROM. So, your 'EIS (Electronic image Stabilization) awesomeness and general camera goodness' should function 'the same way that it does normally'. No, the kernel will not remove all your apps and data. That is why I suggested #3 (Install Factory Image and keep data) and #5 if you need to update your firmware.
    Gotcha. Thanks!
     

    GroovinChip

    Senior Member
    Aug 7, 2016
    370
    177
    I just tried to do this, and Magisk would not install after flashing TWRP and Franco kernel. I got an error code 1 :( I couldn't boot to system, so I had to flash back to stock.
     

    GroovinChip

    Senior Member
    Aug 7, 2016
    370
    177
    Yes, I did use RC1. My mistake!

    Side question - it occurs to me that since Android O is dropping this month, it might be prudent to wait to do all this until everything gets updated for O. Do you guys think that's true, or will TWRP and Magisk and the kernels be compatible with O?
     

    pcriz

    Senior Member
    Aug 23, 2008
    5,009
    2,934
    So say if I do get my phone rooted with stock. How would I update it safely? Would I need to go through these steps when the next monthly update comes up?

    Yes because if you take a update it will replace the boot.img which means you will lose twrp and root.
     

    GroovinChip

    Senior Member
    Aug 7, 2016
    370
    177

    Homeboy76

    Senior Member
  • Aug 24, 2012
    2,574
    1,249
    Thanks. Could you please clear up why we need custom kernels for root on Pixel, where as on Nexus this wasn't the case?

    Sent from my Google Pixel XL using XDA Labs

    You do not need a custom kernel to 'root' your phone. You can root your Pixel/Pixel XL with SuperSu 2.82 without installing a custom kernel. You need the custom kernel to root with Magisk. More specifically, the Custom Kernel is needed for Magisk. The Pixel/Pixel XL have dual slots the Nexus did not.
     
    • Like
    Reactions: GroovinChip

    GroovinChip

    Senior Member
    Aug 7, 2016
    370
    177
    You do not need a custom kernel to 'root' your phone. You can root your Pixel/Pixel XL with SuperSu 2.82 without installing a custom kernel. You need the custom kernel to root with Magisk. More specifically, the Custom Kernel is needed for Magisk. The Pixel/Pixel XL have dual slots the Nexus did not.
    Ok I understand. Thanks!

    Sent from my Google Pixel XL using XDA Labs
     

    Top Liked Posts

    • There are no posts matching your filters.
    • 17
      [Guide] Pixel XL Android 7.1.2 (OREO) Unlock/Lock Bootloader + Install Stock Images/Custom kernels/TWRP Recovery/Systemless ROOT + August 2017 Security Patch

      Intro
      • This thread is for Pixel XL owners that want to Root their phone, and enjoy the benefits of rooting it without installing a custom ROM. However, for those that just can't live without a Custom ROM, take a look at 'Custom ROMs for Pixel/Pixel XL'.
      • It also works for Pixel owners: If, they download the correct files for their Pixel.
      • This Guide is not for use with the Second Generation Pixel 2 or Pixel 2 XL devices.

      Update(s):
      • Other - Added 'Other' after 'Prerequisites'

      Disclaimers:
      • I assume no responsibility for the malfunctioning/bricking of your phone.
      • The order of listed items i.e., Custom Kernels, Custom ROMS, etc. Does not indicate my preference for them. It is your responsibility to do the research before selecting an item.

      Prerequisites

      Need help installing Android SDK or SDK Platform Tools


      Other

      Credit/Thanks/Recognitions


      Index
      1. Open Command Prompt/ Boot Bootloader/Boot Recovery

        1. Open Command Prompt on Computer
          • Option 1 - Open File Explorer, click the platform-tools folder, press shift, right click, and select open command prompt here.
          • Option 2 - Open File Explorer, click platform-tools folder, highlight the directory information in the address bar or click the folder (left side of address bar) to highlight it type 'cmd' and press enter.
          • Note: If your computer only has 'open powershell here' in the context menu and you do not want to change it or add open 'command prompt here' use use option 2.
        2. Boot Bootloader:
          • Power off phone, press and hold the power and volume down buttons until you see Start.
        3. Boot Recovery
          • Power off phone, press and hold the power and volume down buttons until you see Start. Press volume Up/Down button until you see Recovery Mode > Press Power button.
      2. Testing ADB (Android Debug Bridge)/fastboot

        • ADB
          1. Enable USB Debugging - Tap Settings > System > About Phone > Developer Options. Enable USB Debugging.
          2. Open a Command Prompt on your computer.
          3. Type this at the prompt and press enter to test ADB.
            Code:
            adb version
            It should return a version number for ADB.
        • fastboot
          1. Enable USB Debugging - Tap Settings > System > About Phone > Developer Options. Enable USB Debugging.
          2. Open a Command Prompt on your computer.
          3. Boot bootloader.
          4. Connect your phone to your computer with a USB cable.
          5. Type this at the prompt and press enter to test fastboot.
            Code:
            fastboot devices
            It should return your device serial number.
      3. Unlock Your Bootloader

        • Backup your data and Internal storage
        • Activate Developer Options: Tap Settings > System > About Phone > Build Number. Tap Build Number until you see you're a Developer. Tap back > Developer Options. Enable OEM Unlock and, USB Debugging.
        • Boot Bootloader
        • Connect your phone to your computer via USB cable.
        • Open a Command Prompt on your computer.
        • Type the following at the prompt and press enter:
          Code:
          fastboot flashing unlock
          This will erase all user data from the device!
        • You should see a screen on your phone asking you to confirm this action, use the volume keys to scroll and the power key to make your selection.
        • Allow the process to complete and then issue this command:
          Code:
          fastboot reboot
        • When your phone reboots disconnect your usb cable.

          Note: After unlocking your bootloader, you'll be greeted with a warning that says Your device software can't be checked for corruption. Please lock the bootloader everytime you reboot. It's ok, as long as your bootloader is unlocked it will stay there.

          Important: do not repeat do not relock your bootloader unless your phone is fully stock. You must flash the factory images first in order to remove root and custom recovery (if you have them), if this precaution isn't taken you may end up with a brick. Please see 9 of this guide for instructions on how to return to stock and lock the boot loader.
      4. Install Factory Image and wipe data

        • Backup your data and Internal storage
        • Download the factory image for your phone and carrier.
        • Unzip factory Image
        • Copy the following files to the Platform Tools folder on your Computer
          1. flash-all.bat
          2. bootloader-marlin-9999-999999-9999999999.img
          3. radio-marlin-9999-999999-9999999999.img
          4. image-marlin-aaa99a.zip
        • Boot Bootloader
        • Connect phone to Computer with USB cable
        • Open a Command Prompt on your computer.
        • Type the following at the prompt and press enter.
          Code:
          flash-all
      5. Install Factory Image and keep data

        • Backup your data and Internal storage
        • Download the factory image for your phone and carrier.
        • Unzip factory Image
        • Edit flash-all.bat: Remove -w
        • Copy the following files to the Platform Tools folder on your Computer
          1. flash-all.bat
          2. bootloader-marlin-9999-999999-9999999999.img
          3. radio-marlin-9999-999999-9999999999.img
          4. image-marlin-aaa99a.zip
        • Boot Bootloader
        • Connect phone to Computer with USB cable
        • Open a Command Prompt on your computer.
        • Type the following at the prompt and press enter.
          Code:
          flash-all
      6. Install A Custom Recovery and Root with SuperSU

        • Important: Set Pin before installing TWRP: Setting > Security > Pin.
        • Important: Make and restore nandroid backups with TRWP RC1 zip. Some, users have reported problems creating/restoring nandroid backups with TWRP RC2 zip.
      7. Install A Custom Recovery and Root with Magisk (Clean Install)

        • Important: Set Pin before installing TWRP: Setting > Security > Pin.
        • Important: Make and restore nandroid backups with TRWP RC1 zip. Some, users have reported problems creating/restoring nandroid backups with TWRP RC2 zip.
        • Note:[Substratum] theme Spectrum does not work with Magisk root.
        • Backup your data and Internal storage
        • Download the following files:
          1. ElementalX-P-1.14.zip for Pixel XL
          2. twrp-3.0.2-0-RC1-fastboot-marlin.img
          3. twrp-pixel-installer-marlin-3.0.2-0-RC2.zip
          4. Magisk-v13.3-Pixel-b4.zip
          5. MagiskManager-5_1_1.apk
          6. Magisk-uninstaller-20170720.zip
        • Flash Boot.img - If you have TWRP, SuperSU, or a custom kernel installed.
          1. Extract the contents of your factory image and open the folder it creates. From there, extract the second archive (image-marlin-aaa99a.zip)
            Then open that folder and copy the boot.img file and paste it into the platform-tools folder.
          2. Boot Bootloader
          3. Connect the phone to your computer
          4. Open a Command Prompt on your computer.
          5. Type the following command at the prompt:
            Code:
            fastboot flash boot --slot all boot.img
          6. When it finishes, leave the command prompt window open, your phone in bootloader mode and connected to your computer.
        • Install TWRP
          1. Place twrp-3.0.2-0-RC1-fastboot-marlin.img in your platform-tools folder and Rename it twrp.img
          2. Type the following command at the prompt:
            Code:
            fastboot boot twrp.img
          3. When TWRP boots, tap the Install button and select twrp-pixel-installer-marlin-3.0.2-0-RC2.zip
          4. Swipe the slider to install
          5. Press the back button until you are on TWRP's main menu select Reboot > Recovery.
        • Flash the ZIPs
          1. Disconnect your phone from your Computer.
          2. Tap the Install button, then navigate to the files you downloaded.
          3. Select the Magisk Uninstaller.zip, tap the Add more ZIPs button.
          4. Select the twrp-pixel-installer-marlin-3.0.2-0-RC2.zip.
          5. Swipe to install
          6. Reboot Recovery
          7. Tap the Install button select a Custom Kernel: ElementalX-P-1.1x.zip or Franco's Kernel-r1x.zip.
          8. Tap Add more ZIPs button select Magisk-v13.3-Pixel-b4.zip, tap the Add more ZIPs button and select: twrp-pixel-installer-marlin-3.0.2-0-RC2.zip
          9. Swipe to install
            Note: During the Installation of ElementalX, ElementalX's AROMA installer interface, will require your input: So, tick I agree, then tap Next a few times and press Install ElementalX when prompted.
          10. When ElementalX AROMA installer finishes, tap Next, and Finish. After, the other ZIPs are installed.
          11. Reboot System
            Note: If you're prompted to install the TWRP app at this point, remove check marks from two check boxes and select Do Not Install.
        • Install MagiskManager
          1. Install Magisk Manager (5.1.1.apk)
          2. Wipe data on Magisk Manager
          3. Enable Magisk Hide
          4. Enable Core Only Mode
          5. Toggle on and off systemless hosts
        • Reboot system
        • Check for Latest Version, Root, and Saftey Net.
      8. Update Magisk Dirty Flash

        1. Download file:Flash the ZIPs
      9. Custom ROMs for Pixel/Pixel XL
      10. Install Custom Kernel

        • Franco's Kernel - SuperSu
          1. Download file:
          2. Boot into TWRP
          3. Press Install button select the file you downloaded
          4. Swipe slider to install
          5. Reboot System
        • ElementalX-PXL-1.xx by flar2 Kernel - SuperSU
          1. Download files:
          2. Flash ElementalX zip in TWRP recovery (do not flash SuperSU-v2.82-201705271822.zip again if you're already rooted).
            • During the Installation, ElementalX's AROMA installer interface, will require your input: So, tick I agree, then tap Next a few times and tap Install ElementalX when prompted.
            • When ElementalX AROMA installer finishes, tap Next, and then Finish.
              Note: If you're prompted to install the TWRP app at this point, remove check marks from two check boxes and select Do Not Install.
        • Franco's Kernel or ElementalX-PXL-1.xx by flar2 Kernel - Magisk
      11. Install Substratum Theme

      12. Return to Stock and Lock Bootloader

        • Return to Stock
          1. Backup your data and Internal storage
          2. Download the appropriate factory image for your phone and carrier.
          3. Unzip factory Image
          4. Copy the following files to the platform-tools folder on your Computer
            • flash-all.bat
              • Verify -w is present in flash-all.bat. Example: fastboot -w update image-marlin-aaa9.999999.999.zip
            • bootloader-marlin-9999-999999-9999999999.img
            • radio-marlin-9999-999999-9999999999.img
            • image-marlin-aaa99a.zip
          5. Boot Bootloader
          6. Connect phone to Computer with USB cable
          7. Open a Command Prompt on your computer.
          8. Type the following command at the prompt.
            Code:
            flash-all
        • Lock Bootloader

          1. Phone
          2. Boot Bootloader
          3. Connect your phone to your Computer with USB cable.
          4. Computer
          5. Open a Command Prompt on your computer.
          6. Type the following at the prompt:
            Code:
            fastboot flashing lock
          7. When it finishes the bootloader is locked.
          8. The next step won't be needed if your Pixel XL reboots into system after bootloader relock.
          9. You need to boot into system now, either press Power button to reboot OR issue the following command:
            Code:
            fastboot reboot
          10. When your phone reboots disconnect your usb cable.
      13. Audio Mod

      3
      Intro
      The purpose of this thread is twofold:
      First, it is for Pixel XL owners that want to Root their phone, and enjoy the benefits of rooting it without installing a custom ROM...

      If you follow the instructions above you should not have to worry about slot a/b.

      If you are installing Custom ROM this thread is not for you. You, should follow the installation instructions of the Custom ROM you want to install.

      A few things that may make this a bit confusing for users.

      Your steps work fine for users that want to use custom roms. This is because unlocking, flashing, twrp, flashing SU and flashing a rom are independent.

      So basically someone can follow your steps to get their device to a state that flashing roms is possible. The other thing is why do you have them flash radio and boot loader separately? When they download the factory image it has a flash all bat that flashes everything for them.

      Also if any of these users are coming from the O beta your steps will not work because they will have factory flash in both A and B slots.. Or at least flash bootloader and boot.img in both slots.

      Lastly you dont need the huge android sdk for the latest ADB and fastboot..

      Google provides ADB and Fastboot in a 4mb package here: https://developer.android.com/studio/releases/platform-tools.html
      2
      we already have guides though

      can't hurt to have an updated guide for those too lazy to read.. so many posts about "this guide is out of date" or "i dont have time to read 6 pages about other people's experiences"
      2
      SuperSU v2.82 SR2
      2
      I think I asked the wrong question so let's start again.
      My phone has the current factory firmware (July) and is rooted.
      The boot slot is a.

      I want to install a Custom ROM ex., PureNexus:
      What are the steps to install the ROM, vendor.img, gapps, root (SuperSu/Magisk), kernel, trwp.zip.
      Also, please include instructions on how to set a slot active via adb/twrp. There are a lot of novices when it comes to flashing a Custom ROM, including me. All the thanks, credit, and recognition will go to you. :)

      I'm gonna assume your other slot is at least bootable
      Boot into recovery
      Factory reset
      Flash ROM
      Flash twrp
      Reboot recovery
      Flash vendor
      Flash super user (if you flash magisk you need to flash twrp after it before you reboot)
      Boot ROM

      There are no gapps for pure nexus but if you needed to flash them do it after you flash the ROM and have rebooted once.

      If want to use your current slot because you know its good. Boot into recovery. Go into reboot and select the opposite slot. Then choose to reboot into recovery and perform the steps I listed above.