[GUIDE] Rooting your Essential PH-1

Search This thread

ipdev

Recognized Contributor
Feb 14, 2016
2,316
1
4,624
Google Nexus 10
Nexus 7 (2013)
I can't flash TWRP by bootloader method.
It has been awhile since I flashed mine. 🙂

If I remember correctly, I patched the new boot image with TWRP and then Magisk.
It is a big of a pain in the butt. 🙃

I was looking though some of my older posts trying to find one to point you to but, they all seemed to only note the part a user was having problems with.

As for TWRP.
I basically follow the instructions from TWRP.
Essential PH-1 - [twrp.me] - [WebSite] - Link

Example:
If you install the new boot image to slot 'a'.
Install TWRP to slot 'b'.
Then switch to slot 'b' and reboot.
Once in twrp, install the TWRP installer, to patch both slots.

Since slot 'b' is TWRP only, and slot 'a' is now a TWRP patched boot image..
I would use dd to dump the TWRP patched boot image, then pull it to your computer.
Reboot into bootloader and flash the TWRP patched boot image to both slots.

Double check to make sure you are back on slot 'a' and reboot into system (rom).

Then open the Magisk app and use the install 'patch file' option.
Select the TWRP patched boot image you dumped and continue.

When done, pull the now Magisk and TWRP patched boot image to your computer.
Reboot into bootloader and then flash the now Magisk and TWRP patched boot image to the active slot.
Might have to flash it to both slots??​
Reboot into system (rom).

---

To check active slot using adb.
Code:
adb shell getprop | grep slot

Using dd to dump boot partitions.
Code:
adb shell dd if=/dev/block/sde11 of=/sdcard/PH1-boot_a.img
adb shell dd if=/dev/block/sde28 of=/sdcard/PH1-boot_b.img

Fastboot commands.
Code:
fastboot getvar current-slot
fastboot set_active a
fastboot set_active b
fastboot flash boot_a NameOfFile.img
fastboot flash boot_b NameOfFile.img

Code:
fastboot --set-active=a
fastboot --set-active=b

Fastboot commands have changed with fastboot updates.
Not sure if newer fastboot options work with PH-1.
Code:
fastboot --slot all flash boot NameOfFile.img
fastboot --slot other flash boot NameOfFile.img

---

For some reason I think I had touch issues every now and then booting into the TWRP only image.
If you run into a no-touch issue..
TeamWin - [twrp.me] - [WebSite] - TWRP Commandline Guide

Example using adb.
Start TWRP sideload on the device.
Code:
adb shell twrp sideload
Using the TWRP installer to install a file on the device.
Code:
adb shell twrp install /path/to/file.zip

Cheers. :cowboy:

Edit:
PS.
When I refer to pull/push I am refering to adb pull and adb push.
 
  • Like
Reactions: galaxys

ultrasuper

Senior Member
Jan 6, 2011
182
18
I lost root from stock PIE a while ago by accidentally taking one of the OTA updates. (Not sure why it worked tbh cuz I thought OTA updates wouldn't work when stock rooted/magisk/twrp 🤷‍♂️

Right after that I just decided to go to the end with the stock OTA updates, Android 10 and (the final) Feb 2020 security update.

Now I'd like to get root back. Hopefully without losing my data at all.

Magisk Manager is still there (Magisk 17.1, Manager 7.5.1, TWRP 3.2.3 was where it was before), and when I open that, the only menu option is Settings.. nothing to patch or anything else (like Magisk Hide, etc). There's also an update button for MM, and and Install button for Magisk itself.

Can I safely get root back through MM? Maybe by updating it, and letting it direct install Magisk? Or will it not work in my state?

Do I need to break out the Linux and use adb or fastboot? Steps I can follow would be greatly appreciated.
 
[...]
Magisk Manager is still there (Magisk 17.1, Manager 7.5.1, TWRP 3.2.3 was where it was before), and when I open that, the only menu option is Settings.. nothing to patch or anything else (like Magisk Hide, etc). There's also an update button for MM, and and Install button for Magisk itself.

Can I safely get root back through MM? Maybe by updating it, and letting it direct install Magisk? Or will it not work in my state?

Do I need to break out the Linux and use adb or fastboot? Steps I can follow would be greatly appreciated.
Have you done anything since?
 
Magisk Manager is still there (Magisk 17.1, Manager 7.5.1, TWRP 3.2.3 was where it was before), and when I open that, the only menu option is Settings.. nothing to patch or anything else (like Magisk Hide, etc). There's also an update button for MM, and and Install button for Magisk itself.
Since you are on the OEM ROM, grab that from https://essential-images.netlify.app/ and pull the boot.img from the zipfile. Then, put that boot.img on sdcard and patch it with Magisk (the "install" button in top right). Done.
 

ultrasuper

Senior Member
Jan 6, 2011
182
18
Since you are on the OEM ROM, grab that from https://essential-images.netlify.app/ and pull the boot.img from the zipfile. Then, put that boot.img on sdcard and patch it with Magisk (the "install" button in top right). Done.
My Magisk looks like this:

There's only "Settings" in the menu. IIRC, there used to be a menu option to "patch" the boot.img. ?
(the "Advanced" dropdown menu has "Preserve force encryption" checked, "Preserve AVB 2.0/dm-verity" checked, and "Recovery mode" unchecked)

Is MM supposed to "detect" boot.img in /downloads or something? and present the option to patch? without updating MagiskManager OR installing Magisk as seen in the screencap (which is a much newer vers than I had on the phone and I'd be a little concerned about compatibility issues)?

It's been a long time I can't recall how the process exactly flowed.
 

Attachments

  • image_2023-02-04_060115.png
    image_2023-02-04_060115.png
    141 KB · Views: 5
My Magisk looks like this:

There's only "Settings" in the menu. IIRC, there used to be a menu option to "patch" the boot.img. ?
(the "Advanced" dropdown menu has "Preserve force encryption" checked, "Preserve AVB 2.0/dm-verity" checked, and "Recovery mode" unchecked)

Is MM supposed to "detect" boot.img in /downloads or something? and present the option to patch? without updating MagiskManager OR installing Magisk as seen in the screencap (which is a much newer vers than I had on the phone and I'd be a little concerned about compatibility issues)?

It's been a long time I can't recall how the process exactly flowed.
I have not used Magisk Manager (MM) (I usually just sideload Magisk itself) but you said that you have Magisk (17.1 is old!), so why not use that.

But, so what happens when you click on Install in MM? It should ask you for the patching method -- you'd choose 'from file" and navigate to the boot.img. If yes, then that should do it.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 110
    WARNING: Before attempting to root your device, do note that by unlocking your bootloader and modifying your device with root, ROMs, etc... you are risking voiding your warranty! I am NOT responsible for what you do to your device either, so follow these instructions at your own risk. Make sure you know what you're doing, it's best to understand the process rather than just copy and paste commands and such.

    Useful and important general information can be found in the second post here.

    NOTES

    1. If you flash the TWRP Installer when you've already got Magisk installed, your device will keep booting to the recovery. You should be able to fix this by just simply reflashing Magisk.

    2. If you have TWRP installed via the TWRP Installer, you will not be able to install stock OTA updates. You will have to reflash the stock boot image for whatever build you're running beforehand.

    3. The prebuilt TWRP image may not have touch functionality if you're using the September 2018 Update or newer. Patching the boot image, however, for these builds with the TWRP Installer will allow touch to work flawlessly. Here is a pre-patched September 2018 Boot Image with TWRP. It should also work with builds newer than September. Since it's based off the September 2018 update, I suggest not using this as your main boot image but rather just as a replacement for the pre-built TWRP image from the official TWRP thread.

    4. Simple "flash and forget" boot images pre-patched with Magisk and TWRP are provided by @aer0zer0 and are available here. They are based on ianmacd's variant of Magisk. If you are running stock, you can flash these boot images to get root and TWRP instead of following the guide to patch it yourself. Here is January's.

    If you don't care about TWRP and simply want to just root your device, you can just simply patch the boot image for your ROM with the Magisk Manager and flash it in fastboot with
    Code:
    fastboot flash boot patched_boot.img
    The link to the boot images for most stock builds can be grabbed from my Google Drive link in the second post or from the back-to-stock zips.


    REQUIREMENTS
    An unlocked bootloader
    Working adb and fastboot environment, along with knowledge on how they work.
    The latest build of TWRP along with the TWRP Installer. Read Note 3 above beforehand.

    1. Download the latest build of TWRP and the TWRP Installer. Transfer the TWRP Installer zip to your device.

    2. Reboot your phone into fastboot. Once in fastboot, change your device's current slot using the command
    Code:
    fastboot set_active other
    If the command above doesn't work for you, use fastboot getvar current-slot followed by fastboot -aX, replacing "X" with the slot opposite (a or b) from your current slot.

    3. Once your device's current slot has been switched, flash the TWRP image you downloaded earlier using the command
    Code:
    fastboot flash boot twrp.img
    Depending on your version of fastboot, the above command might not work either. In that case, you can enter the following command, replacing "X" with your current slot (a or b).
    Code:
    fastboot flash boot_X twrp.img

    4. Once TWRP has been flashed, boot into the recovery.

    5. Once you have booted into TWRP, simply flash the TWRP Installer zip.

    6. Once you have finished flashing the TWRP Installer zip, boot to recovery on the OPPOSITE slot. You can do this from TWRP by going to "Reboot", then selecting the opposite of the current slot (if on A, select Slot B. If on B, select Slot A), then select "Recovery." You can also do this through fastboot by running the same command from step 2.

    7. Once you have booted back into TWRP, simply flash the Magisk zip and you are now good to go! Feel free to flash anything else like kernels while you're at it.

    8. Reboot. :good:

    NOTE: TWRP WILL remain installed on your device so long as you reflash the installer zip after every update.
    21
    https://www.androidfilehost.com/?fid=11410963190603865614

    December patched boot.img (stock, TWRP, ianmacd 1203 17.4 magisk

    Enjoy :)
    20
    Important Information for the Essential PH-1 can be found here. Keep it bookmarked.

    Tips on updating via OTA after rooting can be found here.

    In the case that you mess something up on your device, you may find it helpful to revert back to stock with the unofficial factory images graciously provided by @invisiblek and @aer0zer0 over here.

    Official TWRP XDA Thread for the Essential PH-1

    Join the Essential PH-1 Discord Server! -- Lots of cool people here!

    Join the Essential PH-1 Development Telegram Channel!

    Stock Boot Images for most builds can be found at my Google Drive link here.

    Have a Red Verity Warning when booting your device? Click here.
    If the link to the boot.fix.red image isn't working, you can also find it here or in my Google Drive link in the first post.

    Essential Phone (PH-1) Partition Layout

    Dumping Boot Images

    1. Find the current slot with
    Code:
    fastboot getvar current-slot
    or
    Code:
    adb shell getprop ro.boot.slot_suffix
    2. Switch to the opposite slot in Fastboot using the command
    Code:
    fastboot set_active other
    3. Flash TWRP using the command
    Code:
    fastboot flash boot twrp.img
    4. Now, boot into TWRP and use the following command from your PC, replacing X in "boot_X" with the original slot from step 1 (a or b). TRIPLE CHECK:
    Code:
    adb shell dd if=/dev/block/bootdevice/by-name/boot_X of=/sdcard/boot.img
    5. Profit! Don't forget to switch back to the original partition with the same command from step 2!

    extractTarFork() error when restoring data from a TWRP backup

    1. Reinstall the ROM from which the backup is based on.
    2. Wipe your data. You can do this from the recovery or from fastboot using the command
    Code:
    fastboot -w
    3. Boot into the ROM. When going through the initial setup, use the EXACT same security setup as the one from your backup. For example, if you used a Fingerprint + Password in the backed up ROM, use the exact same combo along with the exact same password as well. There is no need to set up anything else, like accounts.
    4. Flash, install, and reboot into TWRP. You should now be able to restore the data backup without any issues.
    16
    15
    https://www.androidfilehost.com/?fid=11410932744536995931

    nov_patched_twrp_magisk_stock boot.img is up

    Enjoy:)