[GUIDE]HOW TO ROOT YOUR MATE 9 with Decrypt Data in TWRP without needing a patched

Status
Not open for further replies.
Search This thread

beejkitsune

Senior Member
May 2, 2015
115
23
33
Durham, England
Google Pixel 5
Hi Guys, hoping for some help. I just got a "Limited Edition" Champagne Gold Mate 9 today as a replacement for my Nexus 6P since they can't get any parts, apparently, here in the UK and had been holding on to my phone for three months(!).

Currently I'm running MHA-L29C463B197, bootloader unlocked, TWRP 3.1.1-0 (or something to that effect) installed but I cannot seem to get any further with regards to flashing Magisk. As far as my research had gotten me it appears I need to be decrypted for this to work I had the xxx_full_xxx and xxx_hw_xxx files for B197 but I cannot find a boot image.

I have done several hours research here on XDA and I am not a stranger to flashing ROMS after having an S4 from day one and both a Nexus 6 and 6P but this seems to be an entirely different ball game and any help would be muchos appreciated.

Thank you all in advance!!!
 

beejkitsune

Senior Member
May 2, 2015
115
23
33
Durham, England
Google Pixel 5
I have an interesting problem

Flashed phh SU, root checker says all fine, apps can request and get root
BUT
I have to re apply AdAway after every reboot, and I cannot uninstall system apps with any app
What the kek?

MHA-L29C432B190

PS
I confirm Magisk root working fine after having problems with phh SU and SuperSU

Can I ask the procedure you used to get Magisk. I'm on MHA-L29C432B197 unlocked bootloader and twrp?

Sent from my Mate 9 using XDA Labs
 

SonOfTheRain

Senior Member
Oct 8, 2006
73
7
Hello,
I have a problem with upgrading.
My software version is B190 and I have B194 availbale now. Once system restarts, I see TWRP since I installed for Magisk. I found B190's update.zip and extracted RECOVERY.img. After going to fastboot mode I wrote the command fastboot recovery recovery.img, I have following error:
target reported max download size of 471859200 bytes
sending 'recovery' (55218 KB)...
OKAY [ 1.197s]
writing 'recovery'...
FAILED (remote: Command not allowed)
finished. total time: 1.204s

I appreciate any help.
 

ante0

Senior Member
Dec 28, 2009
3,214
1,581
Stockholm
Hello,
I have a problem with upgrading.
My software version is B190 and I have B194 availbale now. Once system restarts, I see TWRP since I installed for Magisk. I found B190's update.zip and extracted RECOVERY.img. After going to fastboot mode I wrote the command fastboot recovery recovery.img, I have following error:
target reported max download size of 471859200 bytes
sending 'recovery' (55218 KB)...
OKAY [ 1.197s]
writing 'recovery'...
FAILED (remote: Command not allowed)
finished. total time: 1.204s

I appreciate any help.

Fastboot flash recovery recovery.img
Mate 9 doesn't allow booting images directly.

Hi Guys, hoping for some help. I just got a "Limited Edition" Champagne Gold Mate 9 today as a replacement for my Nexus 6P since they can't get any parts, apparently, here in the UK and had been holding on to my phone for three months(!).

Currently I'm running MHA-L29C463B197, bootloader unlocked, TWRP 3.1.1-0 (or something to that effect) installed but I cannot seem to get any further with regards to flashing Magisk. As far as my research had gotten me it appears I need to be decrypted for this to work I had the xxx_full_xxx and xxx_hw_xxx files for B197 but I cannot find a boot image.

I have done several hours research here on XDA and I am not a stranger to flashing ROMS after having an S4 from day one and both a Nexus 6 and 6P but this seems to be an entirely different ball game and any help would be muchos appreciated.

Thank you all in advance!!!

If you are stock now you don't need boot image.
You could actually back it up in TWRP. You would only need boot image if you have phh, SuperSU or Magisk installed and want to switch root flavor.

And decrypting is not necessary, only benefit you gain is the ability to backup /data.

EDIT: if you do have stock boot image, please back it up and upload to mega or something. I can't find C463, and if you or anyone else should mess up their boot image it would help to have a backup :)
 
Last edited:

beejkitsune

Senior Member
May 2, 2015
115
23
33
Durham, England
Google Pixel 5
Fastboot flash recovery recovery.img
Mate 9 doesn't allow booting images directly.



If you are stock now you don't need boot image.
You could actually back it up in TWRP. You would only need boot image if you have phh, SuperSU or Magisk installed and want to switch root flavor.

And decrypting is not necessary, only benefit you gain is the ability to backup /data.

I managed to flash Magisk but i had to decrypt. Every time I tried encrypted it put me in to a bootloop and then eRecovery. I don't mind being decrypted.

Thanks for getting back to me though. :)
 

ante0

Senior Member
Dec 28, 2009
3,214
1,581
Stockholm
I managed to flash Magisk but i had to decrypt. Every time I tried encrypted it put me in to a bootloop and then eRecovery. I don't mind being decrypted.

Thanks for getting back to me though. :)

OH yeah. If you used Magisk v14 it would remove encryption flag by default, that's why it boot loops (it tries to boot your phone without decrypting /data).
Magisk v14.3+ "fixes" it. It doesn't actually touch encryption flag now because it breaks support for other phones, so you'd have to edit boot image manually to get decrypted when using latest Magisk.
 

beejkitsune

Senior Member
May 2, 2015
115
23
33
Durham, England
Google Pixel 5
OH yeah. If you used Magisk v14 it would remove encryption flag by default, that's why it boot loops (it tries to boot your phone without decrypting /data).
Magisk v14.3+ "fixes" it. It doesn't actually touch encryption flag now because it breaks support for other phones, so you'd have to edit boot image manually to get decrypted when using latest Magisk.

That would be why. I believed I was using the. Most stable version which still appears to be 14.0. As I said, I don't mind being decrypted.

From what I've read I'm best, now I'm finished flashing everything, reverting back to stock recovery as this is best for fixing things if anything goes majorly wrong?
 

ante0

Senior Member
Dec 28, 2009
3,214
1,581
Stockholm
That would be why. I believed I was using the. Most stable version which still appears to be 14.0. As I said, I don't mind being decrypted.

From what I've read I'm best, now I'm finished flashing everything, reverting back to stock recovery as this is best for fixing things if anything goes majorly wrong?

It doesn't really matter, but if you want to update in the future you'll have to flash back stock recovery.
 

SonOfTheRain

Senior Member
Oct 8, 2006
73
7
Fastboot flash recovery recovery.img
Mate 9 doesn't allow booting images directly.



If you are stock now you don't need boot image.
You could actually back it up in TWRP. You would only need boot image if you have phh, SuperSU or Magisk installed and want to switch root flavor.

And decrypting is not necessary, only benefit you gain is the ability to backup /data.

EDIT: if you do have stock boot image, please back it up and upload to mega or something. I can't find C463, and if you or anyone else should mess up their boot image it would help to have a backup :)

Thank you for answer, I realized that in developer options it was enough to unlock oem. Later the same command worked.
 

beejkitsune

Senior Member
May 2, 2015
115
23
33
Durham, England
Google Pixel 5
I don't think I was forthcoming enough to make a backup. Am I wrong in assuming that it's possible to extract a boot image from the Full OTA file; I'm sure I managed to do that and flash the img when I flashed Magisk 14.0 and when trying to make a Magisk boot img?
 

Valuta

Member
Jan 23, 2017
10
1
I'm trying to switch to magisk but I am kind of stuck. Magisk tells me to un-root, the SuperSU app fails to do so. It also cannot update.
 

drift08

Senior Member
Oct 8, 2008
281
22
OnePlus 9
After testing both root methods, I went back to stock and unrooted because the rooted version gave me error 0 when updating apps like Google. I suspect permission issue with SU or TWRP. Wish someone could fix it
 

calchung

Senior Member
Jul 4, 2009
164
25
Kowloon
@ante0

Hi, I am having bootloop after upgrading to magisk v15 via magisk manager

So i went to twrp to flash the latest magisk uninstaller, then restarted the system. It seems to fix the bootloop, because it can show my wallpaper only, no password asked, only wallpaper and the notification bar is shown. Then I went to twrp again, but I found that the internal sd is encrypted again, so I flashed back the magisk v14 to hope that my phone will work again. However, it shows the Huawei Logo animation and bootloop again.

So I tried to flash the magisk uninstaller again, but no luck, cannot even enter the system or show the wallpaper. I repeated flashing the magisk uninstaller and magisk v14 for a few times. But now the phone is still having bootloop and the internal sd is still encrypted in twrp.

Could you please help me as I dont want to lose the data?
 

ante0

Senior Member
Dec 28, 2009
3,214
1,581
Stockholm
@ante0

Hi, I am having bootloop after upgrading to magisk v15 via magisk manager

So i went to twrp to flash the latest magisk uninstaller, then restarted the system. It seems to fix the bootloop, because it can show my wallpaper only, no password asked, only wallpaper and the notification bar is shown. Then I went to twrp again, but I found that the internal sd is encrypted again, so I flashed back the magisk v14 to hope that my phone will work again. However, it shows the Huawei Logo animation and bootloop again.

So I tried to flash the magisk uninstaller again, but no luck, cannot even enter the system or show the wallpaper. I repeated flashing the magisk uninstaller and magisk v14 for a few times. But now the phone is still having bootloop and the internal sd is still encrypted in twrp.

Could you please help me as I dont want to lose the data?

Flash back stock boot, then flash this:
https://mega.nz/#!JWg1ULpZ!ZLelQPYLN1X7HJPVEpb2Ko5-rJcKngceetEyBzF7aOg

See if it helps. (untested, I'm on Oreo)

You won't be able to decrypt without formatting data. But I guess you could "backup" using root explorer and move it back in twrp.

I'm guessing decryption still doesn't work. It was removed in 14.3 because it broke compatibility with Pixel phones.

You could add it to Magisk but you'd have to build it from source.

As to why, Magisk installer restores stock boot when you upgrade. And stock doesn't decrypt by default. If you boot decrypted, but boot image is encrypted your phone will re-encrypt.
If you then flash 14 which decryption works in, it tries to boot encrypted but won't decrypt, that's why you only saw wallpaper.
 
Last edited:

calchung

Senior Member
Jul 4, 2009
164
25
Kowloon
Flash back stock boot, then flash this:
https://mega.nz/#!JWg1ULpZ!ZLelQPYLN1X7HJPVEpb2Ko5-rJcKngceetEyBzF7aOg

See if it helps. (untested, I'm on Oreo)

You won't be able to decrypt without formatting data. But I guess you could "backup" using root explorer and move it back in twrp.

I'm guessing decryption still doesn't work. It was removed in 14.3 because it broke compatibility with Pixel phones.

You could add it to Magisk but you'd have to build it from source.

As to why, Magisk installer restores stock boot when you upgrade. And stock doesn't decrypt by default. If you boot decrypted, but boot image is encrypted your phone will re-encrypt.
If you then flash 14 which decryption works in, it tries to boot encrypted but won't decrypt, that's why you only saw wallpaper.

@ante0

Thanks for your quick reply. I couldn't find the sd card where I saved the nandroid backup.

Is there any way to download the stock boot image for my rom?
 

ante0

Senior Member
Dec 28, 2009
3,214
1,581
Stockholm
As I remembered, it is bc636b183

Download this one: http://update.hicloud.com:8180/TDS/data/files/p3/s15/G1366/g104/v88255/f2/full/update.zip
Extract update.app from the zip
Download Huawei Update Extractor: https://xdaforums.com/attachment.php?attachmentid=3262544&d=1429042973
Extract zip, open HuaweiUpdateExtractor.exe.
Click on the ".." button in the program, browse to and open your extracted update.app.
Right click on BOOT and click on Extract Selected. Select where to extract to. Flash boot.img with fastboot. Flash v15 i posted in twrp or Flash v14.3
 

calchung

Senior Member
Jul 4, 2009
164
25
Kowloon
@ante0

I found that I have the update.zip of the rom already in my pc, so I extracted the boot.img, and I flashed it in twrp. Then I reboot the recovery, and flashed the magisk.zip that u provided. But it failed.
 

Attachments

  • 20171227_025738.jpg
    20171227_025738.jpg
    252.1 KB · Views: 97
Status
Not open for further replies.

Top Liked Posts

  • There are no posts matching your filters.
  • 33
    HOW TO ROOT YOUR MATE 9 with Decrypted Data in TWRP without needing a patched Boot.img

    I created this thread because there are some users is still confuse on how to root their Mate 9 with decrypted data.
    **Disclaimer-I won't be responsible if you BRICK your MATE 9.Proceed with own RISK,make sure you know what you are doing**

    STEPS
    **SuperRoot**
    01-UNLOCK YOUR BOOTLOADER
    02-FLASH TWRP 3.0.2-2 (thanks to @Tkkg1994) using ADB
    03-Boot into TWRP (HOLD VOL up + POWER)
    03(a)-Backup your Boot thru TWRP into your ext SD or OTG(optional)
    04-Format Data in TWRP
    05-Flash superRoot.zip (thanks to @ante0 for this)
    06-Flash Public_data.zip if you are on build L29C636 u can use THIS
    07-Flash Full_HW_data.zip(you will get error 7 but it still went thru)if you are on build L29C636 u can use THIS
    ***how to obtain files for step 6&7 Read THIS thanks to @gm007
    08-Boot into system (setup ur phone)
    09-Install PHH superuser from playstore.

    **SuperSU** (do not set security such as pin/fingerprint etc b4 fully setup)
    01-UNLOCK YOUR BOOTLOADER
    02-FLASH TWRP 3.0.2-2 (thanks to @Tkkg1994) using ADB
    03-Boot into TWRP (HOLD VOL up + POWER)
    03(a)-Backup your Boot thru TWRP into your ext SD or OTG(optional)
    04-Format Data in TWRP
    05-Flash SuperSU|Mirror 2| Mirror 3Thanks to @ante0
    06-Flash Public_data.zip if you are on build L29C636 u can use THIS
    07-Flash Full_HW_data.zip(you will get error 7 but it still went thru)if you are on build L29C636 u can use THIS
    ***how to obtain files for step 6&7 Read THIS thanks to @gm007
    08-Boot into system (setup ur phone)

    HOPE THE ABOVE IS CLEAR.

    GOOD LUCK

    VIDEO GUIDE
    7
    @eddmecha

    Use this instead for HW/Public, it's easier.
    https://xdaforums.com/showpost.php?p=71302827&postcount=627

    And this to find firmware/hw/public as the search function is down atm
    http://hwmt.ru/oth/HWFF/info/view.php?find_model=

    Oh, gm007 included the above link already :)
    6
    Everything worked for me on my C567. I am now unlocked, rooted, and soon to be ROM'd. Thanks OP!

    **NOTE**
    You might want to add to the OP that the files need to be on an sdcard because MTP file transfer doesn't work in TWRP. Here are the steps I took, broken down a little more:

    1. Unlock bootloader (erases all data)
    2. Place root zip, hw zip, and data zip on an external sdcard in the phone.
    3. Flash TWRP (fastboot flash recovery twrp.img)
    4. Boot into TWRP using VOL UP+POWER
    5. In TWRP go to "Backup" and only select "Boot."
    6. In TWRP go to Wipe, then Advanced Wipe, then "Format Data," but DO NOT REBOOT OR EXIT TWRP. Go back to the main TWRP menu.
    7. Go to "Reboot," then select "Recovery."
    8. Once back in TWRP flash the root zip that you chose. I chose SuperSU.
    9. Flash your devices update_data_full_public.zip
    10. Flash your devices update_full_hw_usa.zip
    11. Reboot to system.
    4
    Can anyone do a video on how to root the Mate 9?

    VIDEO is up!! hope its clear!!
    p/s - sorry for the vid quality:p
    3
    what is public_data and full_hw_Data?
    whats in these two zips?

    Public data and full hw data...

    .
    .
    .
    :D
    They contain bloat apps (Huawei stock apps), lots of settings, themes.
    When you do a full install using Firmware Finder or Funky Huawei they're downloaded and flashed automatically, and installed to /data/hw_init/, when you Format Data that folder is removed. Some people can't use camera either if they don't flash it.

    Make sure you use the guide linked by gm007 so you get the correct versions of those 2 files.

    ---------- Post added at 06:33 PM ---------- Previous post was at 06:22 PM ----------

    ah yes I understand now. It is installed, but will be removed when we do the root process.
    To reply the question above where to find the public like it es described here:
    it should be
    http://update.hicloud.com:8180/TDS/...77/v76459/f2/full/hw/eu/update_full_hw_eu.zip

    but the patched link doesn't work for the requested version MHA-L29C567B167
    I think this is reason why @biggzo is asking.
    I remember to read that the files are almost the same. So maybe downloadable files for other other branding could work.
    copy link from word update until "/full/" and add /hw/eu/update_full_hw_eu.zip or update_data_full_public.zip
    Seems this "tick" does not work on all links, but it works definitely for B156
    http://update.hicloud.com:8180/TDS/...04/v75974/f2/full/hw/ew/update_full_hw_eu.zip
    C432B156 update_data_full_public.zip
    http://update.hicloud.com:8180/TDS/...04/v75974/f2/full/update_data_full_public.zip

    @biggzo
    It's in one of the OTA for b167.
    http://update.hicloud.com:8180/TDS/...59/f2/full/public/update_data_full_public.zip

    http://update.hicloud.com:8180/TDS/.../v76459/f2/full/hw/usa/update_full_hw_usa.zip

    The path is not /eu/, it's /usa/. And there are other paths too so check filelist.xml to get the path.

    ---------- Post added at 06:46 PM ---------- Previous post was at 06:33 PM ----------

    Im familiar with adb
    How would it be done?

    You will need to extract and modify your boot image ramdisk and ramdisk cpio's default.prop from ro.secure=1 to ro.secure=0. That will allow you to run adb shell as root without having su. However, if your boot image still has verity enabled it might not be a good idea to write stuff to system. (I'm not sure how Huawei has done it as I've yet to see a dm-verity screen at boot, only thing I've seen are files reverted to their original after reboot)
    But for this you still need to unlock bootloader. And a modified /system = OTA will fail to install.

    That's how you're supposed to do it, but apparently adbd does not have this enabled.
    ro.adb.secure=0 does nothing either.