[Recovery][Root][02.05.2017] Huawei Mate 9 Pro * Unofficial TWRP for all LON models

raimondomartire

Senior Member
Nov 9, 2005
3,579
4,893
263
Salerno
Team Win Recovery Project 3 ver 3.0.3 RAYGLOBE



This has been tested and working great on LON-L29 international. It will work on all mate 9 pro devices, however I added a list of supported devices below which can be checked.

[COLOR="Red"]WARNING #1[/COLOR]: Unlocking BL and flashing a custom recovery voids your warranty. Please make sure to contact your carrier/seller if your phone is still under warranty after unlocking the bootloader.

[COLOR="red"]WARNING #2:[/COLOR] Make sure you have enabled OEM unlock and unlocked bootloader before trying to flash this. How you can successful root and install TWRP will be described below.

[COLOR="red"]WARNING #3:[/COLOR] Nougat introduce dm-verity v2.0 so before modify /system make a backup of partition and flash root (see above).

[COLOR="red"]WARNING #4:[/COLOR] Don't make factory reset inside TWRP on Huawei device.
[SIZE="3"]

[SIZE="3"]
WHAT IS TWRP?[/SIZE]

TWRP, short for Team Win Recovery Project, is an open-source recovery image for Android-based devices. It provides a touch-enabled interface which allows users to install third-party firmware and backup the current system, which are often unsupported by stock recoveries.
It allows you to back up and restore your data, flash custom ROMs to your device, repair broken file systems, and root your device.

[SIZE="5"]HOW-TO INSTALL[/SIZE]
0. Make sure you enabled OEM unlock in settings, if you haven't please do that now by tipping 10 times on build number (to activate developer options), than open developer options and go to OEM unlock, enable it
1. Have an unlocked bootloader is required!
2. Download the TWRP recovery from the download section below
3. Make sure you got fastboot drivers installed (I will describe this below in how to unlock your bootloader)
4. Open the adb/fastboot application on your pc and go to the directory where your TWRP img file is downloaded
5. Boot your phone into download mode (First method: fastboot reboot-bootloader while connected to pc. Second method: power off your phone, hit power on and volume down until it boots to download mode)
6. Check again if there is written: UNLOCKED phone! and frp UNLOCKED
7. If yes type now into your adb/fastboot terminal: fastboot flash recovery Rayglobe_Recovery.img
8. Type: fastboot reboot
9. Now boot into recovery by pressing: power+volume up+volume down at the same time
10. Enjoy twrp

[SIZE="4"]HOW-TO UNLOCK BOOTLOADER[/SIZE]
1. Call Huawei in the HiCare app, request the bootloader unlock code there or Buy credit on dc-unlocker software
2. Install minimal adb and fastboot drivers from here: [URL="http://forum.xda-developers.com/showthread.php?t=2317790"]ADB and Fastboot drivers[/URL]
3. Plug in your phone and make sure all huawei drivers got installed
4. Enable developer options in settings as described above.
5. Enable OEM unlock, enable USB debugging (both in developer options)
6. Open the adb tool you installed recently
7. Type fastboot devices (now a device number should show up)
8. Type fastboot reboot-bootloader (your phone will now boot into bootloader, if not, you haven't set up drivers or adb/fastboot correctly)
9. [COLOR="Red"]This step will wipe all your data![/COLOR] Type: fastboot oem unlock xxxxxxxxxxxxxxxx (xx is for your unlock code)
10. Ones it's done type: fastboot reboot. Your phone will reboot and you have an unlocked bootloader!
11. You can now go on installing TWRP on your device
[SIZE="4"]
HOW-TO ROOT YOUR MATE 9 PRO[/SIZE]
0. Backup, just in case
1. Have an unlocked bootloader and TWRP installed from above
2. We will use this root method: [URL="http://forum.xda-developers.com/android/software-hacking/wip-selinux-capable-superuser-t3216394"]Phh's superuser[/URL]
3. Download only this zip (i adapted for mate 9) [URL="https://www.androidfilehost.com/?fid=529152257862699355"] superuser zip [/URL]
4. Put the zip on your otg-usb (since we can't access /data in twrp)
5. Boot into twrp and flash the downloaded file
6. Install latest Material phh apk: [URL="http://forum.xda-developers.com/showpost.php?p=69224582&postcount=1896"]Release post[/URL]
7. Now you are rooted, congrats!

[SIZE="4"]FEATURES[/SIZE]
Built in android 7.1 tree
Support .sh script so you can install phh root without problems
Latest stock kernel included
f2fs file system support (read, write, format, backup & restore)
exFAT file system support (read, write, format, backup & restore)
Full SELinux support


[COLOR="Red"]KNOWN ISSUES[/COLOR]
Encryption is not supported yet! I hope that @paulobrien can share his sources as soon as possible
We can't save twrp settings
Factory reset delete data/hw_init directory so make backup if you want themes and original apps
Aroma is broken, seems on all other Huawei phones


[SIZE="4"]SUPPORTED DEVICES[/SIZE]
LON-L29
LON-AL00
[SIZE="5"]
DOWNLOAD[/SIZE]
[URL="https://www.androidfilehost.com/?fid=457095661767133388"] TWRP IMAGE FILE[/URL] ---> FLAT VER
[URL="https://www.androidfilehost.com/?fid=457095661767133388"] TWRP IMAGE FILE[/URL] ---> THEMED VER


Last ver
v3.0.3 -1.0.7.

[HIDE]
[img]http://i.imgur.com/iWqWAnYh.png

[/HIDE]






XDA:DevDB Information
[Recovery][Root][02.05.2017] Huawei Mate 9 Pro * Unofficial TWRP for all LON models , Tool/Utility for the Huawei Mate 9

Contributors
raimondomartire, Tkkg1994, LastStandingDroid
Source Code: https://github.com/Tkkg1994/android_device_generic_a15


Version Information
Status: Stable

Created 2017-01-29
Last Updated 2017-02-05
 

5[Strogino]

Senior Member
Sep 23, 2009
1,567
406
0
Moscow
Factory reset delete data/hw_init directory so make backup if you want themes and original apps
Just my 2 cents. When you did factory reset / wipe data from TWRP, phone will not boot anymore.
TWRP clears whole data partition
But Huawei links additional things (hw_init, custom.bin and etc...) to /data partition, which stock recovery does not clear.

So advice: Never do wipe data / factory reset from TWRP
 
  • Like
Reactions: clmbtti and Reb0rn

raimondomartire

Senior Member
Nov 9, 2005
3,579
4,893
263
Salerno
Just my 2 cents. When you did factory reset / wipe data from TWRP, phone will not boot anymore.
TWRP clears whole data partition
But Huawei links additional things (hw_init, custom.bin and etc...) to /data partition, which stock recovery does not clear.

So advice: Never do wipe data / factory reset from TWRP
Yes mate agree with you I put a script to avoid this. I don't know if really work. A lot of mods in twrp 3.0.3 that i must test
 

raimondomartire

Senior Member
Nov 9, 2005
3,579
4,893
263
Salerno
some user write me in PM that recovery work good also on mate 9 (flat version).
I removed sdcard from .fstab files for mate pro 9 users (we don't have sdcard) so you must use otg usb
 
Last edited:

raimondomartire

Senior Member
Nov 9, 2005
3,579
4,893
263
Salerno
And what's difference with Tkkg1994's build for Mate 9 users?
Good question, but before do you read first post?:p
In short:
- with my recovery you can flash phh root without problem and use old .sh script
- have .sh script that make a factory reset. On huawei factory reset must be avoid
- have right partition for mate 9 pro
- have right kernel
- have right script to manage brightness inside recovery

:good:
 
  • Like
Reactions: M4cr0s and gm007

5[Strogino]

Senior Member
Sep 23, 2009
1,567
406
0
Moscow
Good question, but before do you read first post?:p
In short:
- with my recovery you can flash phh root without problem and use old .sh script
- have .sh script that make a factory reset. On huawei factory reset must be avoid
- have right partition for mate 9 pro
- have right kernel
- have right script to manage brightness inside recovery
Yep, i've read)
My question is about support Mate 9 users (not Pro)...
It links to "some user write me in PM that recovery work good also on mate 9 (flat version)."

In general, it is safer to use Tkkg1994's build cause it has right kernel :)
But if you're added some extra features, may be it's better to share them with Tkkg1994 ?
 

raimondomartire

Senior Member
Nov 9, 2005
3,579
4,893
263
Salerno
Yep, i've read)
My question is about support Mate 9 users (not Pro)...
It links to "some user write me in PM that recovery work good also on mate 9 (flat version)."

In general, it is safer to use Tkkg1994's build cause it has right kernel :)
But if you're added some extra features, may be it's better to share them with Tkkg1994 ?
For this reason I avoid to put sdcard line to avoid to disturb Tkkg1994's work. I'm on telegram group with him and other friends. I'm waiting that Paulobrien release decrypt sources to update my github. In this way everyone that contribute to this :good:
 

5[Strogino]

Senior Member
Sep 23, 2009
1,567
406
0
Moscow
Update first post with zip file to hack dm verity with root
Congratulations)
Btw, i recommend to delete string in script (changes.sh) that changes RO to RW on all secured partitions by default (system, cust, vendor and etc...)
It would be better if user will mount system partition by button or anything else...
I can modify every partition which is without tag "verify" - tested and approved)

And there is one string in fstab.hi3660
Code:
/dev/block/bootdevice/by-name/userdata         /data                f2fs      nosuid,nodev,noatime,discard,inline_data,inline_xattr wait,check,fileencryptioninline
Code from changes.sh does not know about "fileencryptioninline".
Probably, if add in changes.sh code that will remove this tag, so /data partition will not be encrypted. But i did not test yet.
 

raimondomartire

Senior Member
Nov 9, 2005
3,579
4,893
263
Salerno
Congratulations)
Btw, i recommend to delete string in script (changes.sh) that changes RO to RW on all secured partitions by default (system, cust, vendor and etc...)
It would be better if user will mount system partition by button or anything else...
I can modify every partition which is without tag "verify" - tested and approved)

And there is one string in fstab.hi3660
Code:
/dev/block/bootdevice/by-name/userdata         /data                f2fs      nosuid,nodev,noatime,discard,inline_data,inline_xattr wait,check,fileencryptioninline
Code from changes.sh does not know about "fileencryptioninline".
Probably, if add in changes.sh code that will remove this tag, so /data partition will not be encrypted. But i did not test yet.
I agree with you. In boot.img i can confirm you that without tag "verify" you can modify everythings:D Please if update here if you modify changes.sh. Thanks for your feedback
 
  • Like
Reactions: Reb0rn

offall

Member
Sep 28, 2009
47
3
0
Excuse me if this is a dumb question: It seems that there have been successes using the other TWRP for mate 9 (the other thread in this forum) for mate 9 pro version already, so what's has been improved here?

One thing missing from the other TWRP is the ability to write to system partition hence half of the root apps are non functioning, eg. busy box, ad away, ... Does this one fixed the problem?
 
Last edited:

raimondomartire

Senior Member
Nov 9, 2005
3,579
4,893
263
Salerno
Excuse me if this is a dumb question: It seems that there have been successes using the other TWRP for mate 9 (the other thread in this forum) for mate 9 pro version already, so what's has been improved here?

One thing missing from the other TWRP is the ability to write to system partition hence half of the root apps are non functioning, eg. busy box, ad away, ... Does this one fixed the problem?
Yes, already post this answer before. Yes my twrp work for this. here a tes ver. for mate 9. Flash my zip ver. in first thread for root
https://www.androidfilehost.com/user/?w=settings-dev-files&flid=149142
 
Last edited:

JATCHUHAN

Senior Member
Oct 1, 2010
124
25
0
Tried the link but have to have an account to access it. Also to clarify are you saying that by flashing your test version of twrp and your root method that we can have a writable system? If so that's great

Sent from my MHA-L09 using XDA-Developers Legacy app
 

lukemo

Senior Member
Feb 17, 2008
599
89
28
Milan
New backup/restore structure partitions (more stable)

https://www.androidfilehost.com/?fid=673368273298928161
Dear Ray, a beer: Confirmation number: 71T12250HF2138003 to thank you for your fantastic job, done in the pure spirit of XDA.

And now, if you're going to keep the phone at least 2-.3 months, we'll be waiting finally for a custom ROM if possible, or at least for a stock ROM flashable using TWRP, avoiding new absurd "taxes" to update...