back to the beginning

Obtaining root access with Magisk on stock Android 8.1

Obtaining root for the first time is different from retaining it.

These instructions are for obtaining root access for the first time using Magisk.

You will need to unlock your boot loader (you only have to do this once) before continuing. You will lose all data on your phone.

Required resources:

A quality USB cable and not the one provided with your phone.

TWRP modified by invisiblek

Magisk

Websites for information and resources:

Rooting your Essential PH-1

Magisk v16.0 - Root & Universal Systemless Interface

Obtaining root for the first time:

    These first steps are all performed in your phone's settings menu.

    If you just followed all the instructions for unlocking your bootloader you can skip down to "Get active boot slot".

  1. Disable lock screen code
  2. Settings - Security - Screen Lock - None

    If you forget to unlock your phone before you do the next steps you will have to reflash your boot image to stock, reboot your phone, turn of the lock screen and start over.

  3. Turn on developer options
  4. Settings - System - About phone - Build number

    Tap Build number until developer options are enabled

  5. Disable automatic updates
  6. Settings - System - Developer options - Automatic System updates

    Updates will fail unless Magisk is disabled before attempting to update.

  7. Turn on adb debugging
  8. Settings - System - Developer options - USB debugging

    Connect your phone to your computer with a USB cable and give your computer permission to do USB debugging with your phone.

  9. Reboot to bootloader
  10. From your computer type this command:

    sudo adb reboot bootloader

    Or reboot phone while holding down the volume down button.

    The benefit of doing it with the adb command is you can make sure your phone is connected and willing to accept those commands.

  11. Flash stock!
  12. Recommend stock image on both partitions if you had another OS image like Lineage OS

    Obtain latest stock from Essential

    Unzip, edit, flash - instructions to follow

  13. Get active boot slot (a or b)
  14. The following commands should list your phone and tell you which slot you booted from:

    sudo fastboot devices
    sudo fastboot getvar current-slot

    We need to pull the boot image off of the phone. There are two boot partitions on this phone because it is an A/B phone and can contain two complete operating systems. This allows the phone to update while it is running and reboot into the second operating slot. If the new operating system does not work for some reason, the phone will fall back to the previous running version.

    Take note of this slot. This is the slot we need for a later step.

    Since this returns the CURRENT SLOT, the OTHER slot is where we will set up access for reading the image.

    With the June update from Essential the steps required for getting the boot image are unnecessary since it is easily available in the .zip file.

    I will update the instructions with changes based on this.

  15. Install TWRP
  16. You will need capture the boot image from your phone to install Magisk.

    In order to save the image we must install TWRP and gain read access to that partition.

    Install TWRP to the partion that is NOT in use

    Change to the other boot slot:

    sudo fastboot set_active other

    Install TWRP to that boot partition:

    sudo fastboot flash boot twrp-mata_11.img

    Now press the volume down button on your phone to select booting to recovery mode and press the power button to select. The phone will reboot and after a few moments TWRP will start.

  17. Save boot image
  18. We need to save the boot image from where the phone was booting originally not the one we just booted TWRP from.

    To save by image name use one of these commands depending on the boot image slot you require.

    adb shell dd if=/dev/block/bootdevice/by-name/boot_a of=/sdcard/boota.img

    or

    adb shell dd if=/dev/block/bootdevice/by-name/boot_b of=/sdcard/bootb.img

    I suggest you save or rename that .img file with the month date of the update your phone is running (e.g. boot-may.img).

  19. Restore boot image
  20. In TWRP press the INSTALL button.

    Note: TWRP has a button to select if you want to flash an .img or a .zip file. You have to press "Install Image" to see the boot.img file on the /sdcard partion of your phone.

    Note: In TWRP you need to use the back button as well as the interface buttons for navigation.

    Scroll down until you see the boot image you previously saved. Touch it and select the radio button labeled "Boot". Swipe to confirm flash. This actually overwrites TWRP with the boot image you extracted. At this point the phone is back to stock but we still have TWRP running.

  21. Switch back to original boot slot
  22. Reboot your phone:

    sudo adb reboot bootloader

    Switch back to the original slot we started from:

    sudo fastboot set_active other

    Now that we have the boot image we can install Magisk.

  23. Install TWRP
  24. We need to install TWRP to this partition since we previously installed it to the other boot slot and partition. TWRP gets written to the boot partition.

    sudo fastboot flash boot twrp-mata_11.img

    Now press the volume down button to select booting to recovery mode and press the power button to select. After a few moments TWRP will start.

    In TWRP slide the slider to allow modifications.

  25. Move Magisk to your phone
  26. You may have a different version of Magisk so instead of FILENAME use the name of the Magisk file you download:

    sudo adb push FILENAME.zip /sdcard/

  27. Flash boot.img and Magisk
  28. In TWRP press the INSTALL button.

    Note: TWRP has a button to select if you want to flash an .img or a .zip file. You have to press "Install Image" to see the boot.img file and again later to see the Magisk file on the /sdcard partion of your phone.

    Note: In TWRP you need to use the back button as well as the interface buttons for navigation.

    Scroll down until you see the boot image you previously saved. Touch it and select the radio button labeled "Boot". Swipe to confirm flash. This actually overwrites TWRP with the boot image you extracted. At this point the phone is back to stock but we still have TWRP running.

    When that has completed select and flash Magisk by pressing the Back button, the phone's back button, the Install Zip button, touch Magisk file, swipe to confirm flash.

  29. Reboot the phone without installing TWRP
  30. Press the Reboot System button

    There is no need to have TWRP installed as an app on your phone so press the Do Not Install button.

  31. Install Magisk Manager
  32. Once your phone reboots go to the app drawer and touch Magisk. Allow it to install Magisk Manager.

  33. Disable USB debugging
  34. Settings - System - Developer options - USB debugging

    It is safest to keep USB debugging disabled until you need it. Go to the developer options menu in settings and disable it.

    You can also now set your lockscreen.

    Settings - Security - Lockscreen

back to the beginning