[ROOT] Magisk AutoRoot: Magisk + phh's SuperUser for Nougat (No TWRP required)

Search This thread

topjohnwu

Senior Recognized Developer / Inactive RC
Jan 31, 2012
1,849
61,429
Taipei
People are panicking about TWRP not working on the latest Nougat firmware.
As an advanced user like me, I cannot live with a device with no root, so here is my solution.
Oh, and of course, your device need to be either bootloader unlocked, S-OFFed, or both.

What Is Magisk
Maybe.... you live under a rock? :p:p
Magisk Subforum on XDA

What This Will Do
Following the instructions here will install Magisk v9.1 (nearly same as official v9 with some fixes for cache support) and phh's SuperUser to your device.
You DON'T need any custom recovery, and your system partition is NOT touched at all.
Files and binaries are stored in the cache image, Magisk will move them to /data in the next reboot.
You can upgrade Magisk, phh root, and install other Magisk Modules within the Magisk Manager app!

Instructions
If a prebuilt boot image is available:
  1. Download "magisk+phh_arm64_cache.zip", your prebuilt boot image, and unzip both
    You should get "patched_boot.img" and "magisk_cache.img"
  2. Install Magisk Manager and phh's SuperUser app
  3. Reboot your device to download mode (adb reboot download)
  4. Manually flash the images:
    Code:
    fastboot flash boot patched_boot.img
    fastboot flash cache magisk_cache.img
  5. Reboot and you're done!
If you are using other bases, then grab your boot image from your OTA package, and follow the instructions:
  1. Download "magisk+phh_arm64_cache.zip", "magisk_boot_patcher.zip", and unzip both
    You should get "magisk_cache.img", and a folder with scripts and tools
  2. Grab ANY rooted device >Android 5.0 to do the patching. Running the scripts on an unrooted device will create an unbootable boot image!
  3. Follow the instructions in the README.txt of the tool, it shall guide you to patch your own boot image

Downloads:
Prebuilt Cache Images:
Prebuilt Boot Images:
Magisk Manager:
phh's SuperUser app:
 

Attachments

  • magisk-v9.1+phh-r266-2_arm64_cache.zip
    4.4 MB · Views: 8,045
  • US_Unlocked_2.28.617.8_boot.zip
    18.8 MB · Views: 5,254
  • magisk-v9.1_boot_patcher.zip
    9.8 MB · Views: 3,745

jsaxon2

Senior Member
Mar 3, 2010
973
701
Bunnell, FL
OnePlus 6
OnePlus 6T
Just installed on US Unlocked HTC 10 running Stock Android N. Works great. I now have root back. Thanks for doing this.

Also, @topjohnwu correct me if I'm wrong, but if you install a Magisk Module that prevents your phone from booting, you can just re-flash the cache image. That would remove all modules you may have added and start back with just root.

And as an added bonus, I am also passing SafetyNet which I was not before do to the unlocked bootloader. Great work.
 

Attachments

  • Screenshot_20161126-090517.png
    Screenshot_20161126-090517.png
    215.1 KB · Views: 4,839
Last edited:

sane82

Senior Member
Mar 1, 2010
81
10
Denver
Sorry if it's already been answered in a different form it has been a while since I've been on here butt Am I able to just pull the boot image file out of the roms zip I am using or could I use the backed up boot image from the nand backup I have. Or do I have to do the Adb method. Thanks in advance.
 

jbm76

Senior Member
This works well thank you. Has anyone been able to get xposed to work within it? I've tried to download all 3 and it will not install them - says Can't load the content at the
moment
EDIT - didn't know Xposed need SDK 24 for N... So disregard last bit
 
Last edited:

GhastlyTT

Member
Jan 19, 2013
38
23
Hampton
I have to ask, what Rom are you using? Did you update to N OTA? Are you on Viper or one of the beta ICE or LeeDroid versions?

I fixed the bootloop by extracting the stock OTA boot.img and flashing that. I did update OTA from M using TWRP then SD card flashing the firmware.zip. Really want your stock dialer module back lol.
 

jsaxon2

Senior Member
Mar 3, 2010
973
701
Bunnell, FL
OnePlus 6
OnePlus 6T
I fixed the bootloop by extracting the stock OTA boot.img and flashing that. I did update OTA from M using TWRP then SD card flashing the firmware.zip. Really want your stock dialer module back lol.


I OTA to Android N and wanted to try this out. Just flashed a stock boot.img and will see if that fixes the bootloop.
We're either of you using Magisk prior to OTA? I'm wondering if the magisk.img file was still in /data after you updated.

I RUU'd prior to taking the OTA so I was coming from a clean phone and did not have any problems installing this.
 

GhastlyTT

Member
Jan 19, 2013
38
23
Hampton
I fixed the bootloop by extracting the stock OTA boot.img and flashing that. I did update OTA from M using TWRP then SD card flashing the firmware.zip. Really want your stock dialer module back lol.

We're either of you using Magisk prior to OTA? I'm wondering if the magisk.img file was still in /data after you updated.

I RUU'd prior to taking the OTA so I was coming from a clean phone and did not have any problems installing this.

I was in fact using Magisk. I took the OTA with Magisk and Root installed. In fact, i have the AOSP lockscreen still lol.
 

serophia

Senior Member
Feb 8, 2013
328
97
California
We're either of you using Magisk prior to OTA? I'm wondering if the magisk.img file was still in /data after you updated.

I RUU'd prior to taking the OTA so I was coming from a clean phone and did not have any problems installing this.

Yes I was but i thought flashing stock boot.img will remove magisk seeing as how it allowed me to ota onto Android N perfectly fine.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 74
    People are panicking about TWRP not working on the latest Nougat firmware.
    As an advanced user like me, I cannot live with a device with no root, so here is my solution.
    Oh, and of course, your device need to be either bootloader unlocked, S-OFFed, or both.

    What Is Magisk
    Maybe.... you live under a rock? :p:p
    Magisk Subforum on XDA

    What This Will Do
    Following the instructions here will install Magisk v9.1 (nearly same as official v9 with some fixes for cache support) and phh's SuperUser to your device.
    You DON'T need any custom recovery, and your system partition is NOT touched at all.
    Files and binaries are stored in the cache image, Magisk will move them to /data in the next reboot.
    You can upgrade Magisk, phh root, and install other Magisk Modules within the Magisk Manager app!

    Instructions
    If a prebuilt boot image is available:
    1. Download "magisk+phh_arm64_cache.zip", your prebuilt boot image, and unzip both
      You should get "patched_boot.img" and "magisk_cache.img"
    2. Install Magisk Manager and phh's SuperUser app
    3. Reboot your device to download mode (adb reboot download)
    4. Manually flash the images:
      Code:
      fastboot flash boot patched_boot.img
      fastboot flash cache magisk_cache.img
    5. Reboot and you're done!
    If you are using other bases, then grab your boot image from your OTA package, and follow the instructions:
    1. Download "magisk+phh_arm64_cache.zip", "magisk_boot_patcher.zip", and unzip both
      You should get "magisk_cache.img", and a folder with scripts and tools
    2. Grab ANY rooted device >Android 5.0 to do the patching. Running the scripts on an unrooted device will create an unbootable boot image!
    3. Follow the instructions in the README.txt of the tool, it shall guide you to patch your own boot image

    Downloads:
    Prebuilt Cache Images:
    Prebuilt Boot Images:
    Magisk Manager:
    phh's SuperUser app:
    11
    Reserved

    Reserved
    5
    Just installed on US Unlocked HTC 10 running Stock Android N. Works great. I now have root back. Thanks for doing this.

    Also, @topjohnwu correct me if I'm wrong, but if you install a Magisk Module that prevents your phone from booting, you can just re-flash the cache image. That would remove all modules you may have added and start back with just root.

    And as an added bonus, I am also passing SafetyNet which I was not before do to the unlocked bootloader. Great work.
    4
    Ok, good to know. So in that case, with magisk but no TWRP, can anyone direct me to where I can find a way to extract stock system.img from either OTA or RUU in case we have to fastboot/flash it back to stock to accept OTA updates? With TWRP, I would just flash the stock system image, but now, clearly, that's no longer an option. I tried this, but it just gives a huge list of zip files which are un-extractable.
    Use this tool here, to extract the system.img, out of an RUU:

    http://xdaforums.com/chef-central/a...-htc-ruu-rom-decryption-t3382928/post66943720

    Sent from my HTC 10 using XDA Labs
    3
    Will this work with Viper10 rom based on 2.28.401.6?

    it already has magisk/phh superuser. so there is no need to try this.