[Huawei Mate 9 Guides, News, & Discussion] saurabhg9:
Hi,

I received my dual-sim Huawei Mate 9 Europe version a few weeks back. I selected this as the natural choice after running Samsung Note 3 for several years. There was no other phone that quite fit the bill as this one -

Big screen

Excellent battery

Excellent performance

I am a reasonably advanced user of my android phones - keeping them rooted, unlocked, flashing different roms are just by my alley :)

However after tinkering around with this new baby, I realized that this is quite different than what I was used to with Note 3.

Never before had I to read so many different forum threads to gain a full understanding of how to do things that I could do very easily with my Note 3 earlier without the need to have an indepth knowledge - just copy the steps and execute was good enough to get what I wanted. i.e.

The bureacratic boot loader unlocking process (never had to deal with this before from Samsung)

Rooting

Flashing custom recovery

Flashing custom rom

Backing up and restoring the different partitions through custom recovery

Flashing stock rom in case things don't work out as expected with the new rom

etc. etc.

I have spent several days reading practically all the forum threads on Mate 9, in order to get a good overview of how to manage this awesome device.

I am usually prone to forgetting things. So I knew after a few weeks, there will be something else that will catch my fancy and whatever I have learnt about Huawei Mate 9 after investing so many days will have gone to waste and I would have to scour the threads again if I need to do something with my Mate 9.

So I started to write down a basic guide in a text file to act as a refresher capsule whenever I decide to open the hood again after a few months :)

I also wanted to share my summarized learning capsule back to the community, since I have learnt so many from the various threads and the experiences from so many people.

This prompted me to actually create an XDA account (even though I have been a voracious consumer of XDA for several years, but never created an account).

Just one last tip - if you are a new user of Mate 9 trying to understand all the concepts from scratch, then try to read this guide in its entirety. Some concepts are introduced in the beginning, which might be confusing at the start, but you will understand it well after it is covered again towards the later part of the guide. Once you have a good hang of the different concepts involved, then you can jump directly to the specific section for reference.

So enough background to this thread and now out with the content.

--------------------------------------------------------------------------------------------------------------------------------------------------------

Phone Information

--------------------------------------------------------------------------------------------------------------------------------------------------------

The Model number of my phone is MHA-L29. It is a dual sim phone hence L29 at the end.

Single sim version has model number MHA-L09 i.e. L09 at the end.

The firmware version that I am running is : MHA-L29C432B156

Here is the breakup of how to read this number or the naming convention

Naming convention

L29 = Dual sim

C432 = Europe region (there are other regions as well e.g. C636 for Asian and so on)

B156 = version (this is the actual version number of the firmware)

--------------------------------------------------------------------------------------------------------------------------------------------------------

How to best use the phone

--------------------------------------------------------------------------------------------------------------------------------------------------------

For best results in order to get the full power from the hood, you will use the phone with

bootloader is unlocked

phone is rooted

either Custom recovery of TWRP or Stock recovery will be on the phone depending on the situation.

For daily usage, keep stock recovery on your phone since in case of tough situations requiring unbricking etc. stock recovery is the best to have around.

You will also remove the crapware/bloatware. It is difficult to list all the bloatwares, since they differ based on the region.

Factory resets

Reset due to minor issues

In such situations, typically your data partition is messed up but other partition (system) is fine.

If you have software issues due to software which has been additionally installed or phone has become slow etc. then boot to recovery (stock recovery) and do a factory reset. If you are running custom recovery (TWRP), then first you will need to flash the stock recovery. Then do a factory reset through the stock recovery. This action will format the data partition and copy the necessary stuff from the system partition over.

Restart the system.

Reset due to major issues

In such situations, typically your data as well as system partition is messed up. This will typically happen in case you have software issues due to un-installation of core system applications (as a root user) which have resulted in them being removed from the system partition and now you cannot restore them by an ordinary factory reset (since factory reset does not modify/reset the system partition, it only resets the data partition).

This step also requires you to have initially backed-up the system partition using TWRP. If you haven't backed-up the system partition, then you can also extract the system partition by using Huawei Update Extractor tool on the stock firmware of your region and version, which will give you the image file of the system partition that can be used further below.

Steps -

If you are running stock recovery, then first you will need to flash custom recovery (TWRP).

Using TWRP wipe the system partition.

Reboot to recovery.

Format (not wipe) the data partition.

Reboot to recovery.

Wipe the dalvik cache and cache.

Now from the already backed up TWRP partition backups

(a) restore the system partition (or the system partition image file extracted using Huawei Update Extractor)

(b) restore the data partition.

Reboot to recovery.

Wipe the dalvik cache and cache.

Restart the system.

The above should be enough for full reset. An alternative to 7.(b) above is to flash the 2 zip files containing region specific and other related system applications (you might get "error 7", but that is normal).

Upgrades

You can continue to receive over the air (full or incremental) upgrades from huawei even in a rooted and bootloader unlocked phone.

However in order to apply the received updates, you will need stock recovery, as only stock recovery has the capabilities to install the received updates. Thus before applying any update, if you are running custom recovery (TWRP), then first you will need to flash the stock recovery.

Make sure you backup all your private data and do a full installation (instead of incremental). You can select to install the full package by clicking on the 3 dots on top right corner of update screen and selecting to download the full installation package.

After this process, do a full factory reset, so your system is fully reset and updated based on the latest version.

It might happen that after the update, bootloader is locked again and you have lost your root privileges. In that case follow the steps below for unlocking the bootloader and rooting the phone again.

Also after this step, do the below.

Download the new stock firmware from hwmt.ru (as below) and the related 2 zip files zip files containing region specific and other related system applications for the new version and back them up

Make a TWRP backup of all the partitions and and back them up.

This is necessary as you might need them for other activities e.g. flashing stock recovery of the new version, doing full factory resets etc.

--------------------------------------------------------------------------------------------------------------------------------------------------------

General information on Rooting / Bootloader unlocking / Firmware

--------------------------------------------------------------------------------------------------------------------------------------------------------

The device that you get from the factory is bootloader locked with a region specific firmware.

Partitions

The phone has several different partitions (e.g. boot, data, system etc.)

The "BOOT" partition contains the boot image which boots the system and reads from other partitions

The "DATA" partition contains the user private data (e.g. contacts etc.) and is encrypted by the boot partition (Android Nougat feature). When the Android operating system starts, the boot partition decrypts the data partition and then reads it. This is the reason why other "parallel" softwares like TWRP will not be able to read from data partition, since when they read it, then it is already encrypted. Due to this TWRP will be able to backup(clone) all the other partitions except for data partition, as data partition is encrypted on the first boot of a new system. The other way to backup the data partition is to make the backup before you have booted the system (which results in encryption of the partition).

You can do this by the following steps -> "format (not wipe)" the data partition through TWRP + reboot again to TWRP + flashing the 2 zip files containing region specific and other related system applications (you might get "error 7", but that is normal). After this immediately backup the data partition.

The "RECOVERY" partition contains the stock recovery which you can replace with custom recovery TWRP

The "RECOVERY2" partition contains the "Huawei eRecovery mode" and "Huawei updater mode"

Unlocking bootloader

You can unlock the bootloader with the help of unlocking code. You get this from Huawei. Read further below on how to go about it.

Rooting phone

In order to root the phone there are 2 ways

Old method

This requires you to patch your boot partition and replace the stock boot image (which encrypts the data partition), with a custom boot image which does not encrypt the data partition.

After this you format (not wipe) the data partition, so that it is replaced by an unencrypted data partition and then you root the system in which the root exploit is directly injected in the unencrypted data partition.

New method

This does not require you change your boot image. You basically just install the custom recovery TWRP and then root using the PHH super user zip file. Read further below on how to go about it.

Recovery

If you are rooting using the new method, then you will replace the stock recovery with TWRP.

The disadvantage of TWRP recovery is that it is only the Stock Recovery that has the capability to do a proper "Factory Reset" the phone. Basically when you do a factory reset, then you "format (not wipe)" the data partition. But Huawei firmwares, also have some region specific and other related system applications (e.g. themes, camera, system updates etc.), which are also installed on the data partition. The stock recovery recognizes this and does the factory reset carefully (either by removing everything except for necessary system applications OR by doing a complete format (not wipe) of data partition but then re-applying the necessary system applications). TWRP also can do a "factory reset", but TWRP will simply format the data partition dumbly and not take care of re-installing the necessary system applications on the data partition. If you happen to do a "factory reset" or format "data" partition through TWRP, then you will need to manually flash the zip files containing region specific and other related system applications. You can get those zip files (e.g. update_data_public.zip & update_hw_eu.zip) through the same routine for downloading stock firmware detailed below. When installing these zip files through TWRP, you might get "error 7", but that is normal and you can ignore it.

Stock recovery is also useful for managing OTA updates. Typically when you download firmware updates, then they boot to stock recovery for further processing.

Hence even if you have installed TWRP, you will need to flash stock recovery for factory resets or handling new firmware updates.

Thus as mentioned before, for regular daily usage, keep stock recovery on your phone.

In order to get the stock recovery image, you can extract the stock recovery image file by downloading the "update.zip" of the target firmware and extract the "UPDATE.APP" file and then running the "Huawei Update Extractor" tool on it. Commands to flash the obtained stock recovery image file are similar to the command to flash TWRP recovery below.

Note, when you run the "Huawei Update Extractor" on UPDATE.APP file, then you will see RECOVERY.img, as well RECOVERY2.img

RECOVERY refers to the stock recovery and RECOVERY2 refers to huawei eRecovery mode & huawei updater mode.

Stock firmware

Huawei has region based firmwares e.g. in my case, the region is europe (C432)

There are stock firmwares of each region. However except for 2 regions (C636 and AL00), all other stock firmwares cannot be directly flashed. This is by design from Huawei. Even though the stock firmwares are easily available for all regions, but it is only for these 2 regions that firmwares have the PACKAGE_TYPE token set to OFFLINE_UPDATE. The PACKAGE_TYPE tokens for other region's stock firmwares are set to ONLINE_UPDATE, which makes it not possible to flash those through Huawei Updater.

Thus if you are majorly messed up or bricked, then the only way out is to rebrand your phone to a C636 (i.e. changing the OEMINFO partition from C432 (europe) to C636) and then flash that stock firmware for C636.

https://xdaforums.com/mate-9/how-to/guide-rebrand-chinese-al00-mate9-to-t3554656

https://funkyhuawei.club/rebranding

In order to flash the C636 stock firmware, download the "update.zip" of the target firmware and extract the "UPDATE.APP" file into the "dload" folder created at the root of an external SD card and then starting the phone in a "Huawei Updater mode".

In order to get back to your region (C432), you will then have to use tools like "Firmware Finder" (FF), which spoof Huawei servers through DNS and network and make it possible for the updater to download and flash their stock firmwares thinking it is downloading it online from the huawei servers. You might not be able to update to the latest firmware using FF (since Huawei doesn't authenticate for latest versions sometimes), but you can try to update to an older version first and once that is sorted out, then you can update directly within system update settings to move to the latest update.

As a short-cut and if situation permits, you can also use FF, to directly flash your own region's firmware, without needing to go through the C636 route first.

However if that doesn't work, then flashing the C636 as described above is the only way out.

Also the eRecovery mode or recovery through hisuite only works if you are on a C636 region firmware.

Some useful links -

https://xdaforums.com/mate-9/how-to/guide-rebrand-chinese-al00-mate9-to-t3554656

https://xdaforums.com/mate-9/development/oeminfo-library-t3555353

https://funkyhuawei.club/rebranding

https://xdaforums.com/mate-9/how-to/guide-rebrand-chinese-al00-mate9-to-t3554656/page5

https://xdaforums.com/mate-9/development/rom-romaurb175v1-0-t3575146/post71812906#post71812906

https://xdaforums.com/showpost.php?p=71804525&postcount=393

https://xdaforums.com/mate-9/help/help-completely-lost-ideas-t3561569/post71208272#post71208272

https://xdaforums.com/mate-9/how-to/guide-installing-b138-using-firmware-t3557089

--------------------------------------------------------------------------------------------------------------------------------------------------------

FRP Lock (Factory Reset Protection)

--------------------------------------------------------------------------------------------------------------------------------------------------------

Sometimes during normal usage of the phone, if the phone detects some security anomaly, it would engage the FRP lock .

It has also been found that the phone enters FRP lock mode also when you do a "Reset to default" in the developer mode. So try to avoid doing that.

Basically what happens when you reset the developer mode is that the "OEM Unlock" setting goes back to disabled, and typically when OEM Unlock is disabled, then FRP lock is enabled. However if the bootloader is unlocked, then you will find that it is not possible to change the "OEM Unlock" setting in developer mode, because if bootloader is unlocked then this setting is greyed out and not possible to change.

In short ->

Bootloader is Locked -> "OEM Unlock" setting is greyed out

"OEM Unlock" is enabled -> FRP Lock is Unlocked

"OEM Unlock" is disabled -> FRP Lock is Locked

FRP lock is to prevent mis-use of the phone in case of theft. Since it requires you to enter your google sign-on information again after doing a factory reset before you can use the phone..

FRP lock disables entering any fastboot command, which is a big issue since it means you cannot do anything in bootloader mode i.e. no flashing another recovery, no lock/unlock OEM etc.

In order to check if your phone is FRP locked or not, enter the bootloader mode. Over there it will be mentioned "FRP Lock" or "FRP Unlock", the former indicating that the phone is FRP locked.

In such scenarios, the only way out of the FRP lock mode is to flash the stock firmware again (which means your phone will be restored to totally factory condition i.e. bootloader will be locked, phone will be unrooted).

At the point when the phone enters FRP Lock, if you happen to have stock recovery, then you have a better situation as compared to if you have custom recovery (TWRP).

This is because if you have stock recovery, then you can simply use FF to flash your region's stock firmware. However if you have TWRP, then you have to flash the C636 version (asian) using Huawei Updater mode and then move on to your region's stock firmware.

--------------------------------------------------------------------------------------------------------------------------------------------------------

Using Firmware Finder (FF)

--------------------------------------------------------------------------------------------------------------------------------------------------------

Firmware Finder basically spoofs the Huawei servers by using a local proxy server leading the phone to thinking that there is a firmware update available, and thus allowing you to flash the firmware you wish (with some restrictions of course).

Using Firmware Finder requires you to have stock recovery.

If you are trying to install European regional firmware from scratch, then start by installing version B138 through FF and then move to higher versions using normal system update (or if you are not getting prompted for a normal system update automatically, then of course update through FF.)

For getting the full version of B156 (2.2 GB) through FF, at the time of writing this it was not yet authenticated by Huawei, so if you try to download it you will get authentication error after the download is completed and being verified. Thus, you will instead need to download a partial update of 409 MB through FF (if you are moving from B138 to B156). If you are moving from B126 to B156 then you will need to download the partial update of 473 MB through FF. This will allow you to have B156 on your phone.

The limitation of FF is that it only allows you to install firmwares which are authenticated(approved) by Huawei. Thus in order to install the latest and greatest, you might not be able to use FF. In such cases you can use paid services such as FunkyHuawei which allows you to install even non authenticated(approved) latest and greatest Huawei firmwares.

Though personally, I feel that it is for a good reason that Huawei does not authenticate the latest and greatest since they are beta versions and it is not that big an issue to not have them on the phone.

FF has 2 APKs for the phone - one is the actual application and the second one is a proxy server. The usage is simple - you find the firmware to install using the main application and then send the selected firmware over to download through the proxy server application on the phone. You will also need to change your Wifi settings to add a local proxy server (localhost:8080) before trying to check through system update on availability of new firmware.

FF firmware download on the phone has 3 phases.

Phase 1

The first phase requires you to modify the wifi network config to have localhost and 8080 as proxy to go through the FF Proxy application, which will spoof the Huawei servers and allow the handshake to happen to download the right firmware.

Phase 2

Once the download has started, then move on to the second phase, in which you pause the download, and then once again modify the wifi network config to remove the proxy configuration and then resume the download. This will allow you to download the update at full speed without any proxy intervention

Phase 3

The third phase starts at the last phase of the download in which you pause the download at last remaining 1%. After that you turn off wifi and start mobile data and resume the download from there. This is good because after the download is complete, the firmware will be verified and a last authentication handshake will be done to huawei server, and this doesn't need to be spoofed or be through wifi. Instead it is better that it should be originating through your mobile network.

i.e. a spoofed connection is only required in the first phase of the download

After updating from FF, you will need to do a factory reset of the phone. Then proceed with normal installation, bootloader unlocking, custom recovery installation, rooting. If necessary also flash the 2 zip files containing region specific and other related system applications. After this revert back to stock recovery and do a factory reset again. After this the phone is fully clean and ready to use.

--------------------------------------------------------------------------------------------------------------------------------------------------------

How to download stock firmware

--------------------------------------------------------------------------------------------------------------------------------------------------------

Go to this site (replace the MHA-L29C432 part of the string at the end with the model number of your own Mate 9 device)

http://hwmt.ru/oth/HWFF/info/view.php?find_model=MHA-L29C432

In the "Тип" column, you should only filter by FULL (no OTA, as that update is only eligible for usage by a paid service called funkyhuawei)

Check that the link in the "Список изменений" column is almost the same as "Файл обновления" column. Only difference should be the last part which should be changelog.xml in former and update.zip in the latter.

Now using the link, change the last part of the link to filelist.xml

This will give the xml path with the details of the files as part of that version.

Example

<vendorInfo logfile="changelog.xml" name="common" package="update.zip" subpath=""/>
<vendorInfo logfile="" name="public" package="update_data_public.zip" subpath="public"/>
<vendorInfo logfile="" name="hw/eu" package="update_hw_eu.zip" subpath="hw/eu"/>

Now change the url to download the above 3 zip files using the subpath i.e

$URL/update.zip
$URL/public/update_data_public.zip
$URL/hw/eu/update_hw_eu.zip

--------------------------------------------------------------------------------------------------------------------------------------------------------

Information on entering the various modes on the phone

--------------------------------------------------------------------------------------------------------------------------------------------------------

Engineer mode

In a powered ON phone

enter the following on the dialler

*#*#2846579#*#*

Huawei Updater mode

In a powered OFF phone

hold volume up + volume down + power for a long time (around 10 seconds)

Recovery mode

In a powered OFF phone

hold volume up + power

In a powered ON phone

enter the following through the command line on computer

adb reboot recovery

Huawei eRecovery mode

In a powered OFF phone

power on the phone through the power button

at the prompt that "Your device has been unlocked and cannot be trusted", it will tell you to press the power up button for 3 seconds to enter the eRecovery mode

Download mode / Fastboot mode / Bootloader mode

In a powered OFF phone

keep the volume button pressed down

connect the USB cable to the computer and the phone

In a powered ON phone

enter the following through the command line on computer

adb reboot bootloader

--------------------------------------------------------------------------------------------------------------------------------------------------------

Information on using adb or fastboot commands on your phone

--------------------------------------------------------------------------------------------------------------------------------------------------------

Make sure that "Minimal ADB and Fastboot" program is installed on your computer

Make sure USB debugging is enabled in phone settings

Make sure all reasonable permissions have been allowed as per the developer options

Make sure that hisuite is installed (which will ensure that USB drivers are installed)

--------------------------------------------------------------------------------------------------------------------------------------------------------

Information on unlocking the bootloader

--------------------------------------------------------------------------------------------------------------------------------------------------------

Steps to obtain unlock code

Entry page for unlocking bootloader is

http://emui.huawei.com/en/

Then click on Download. And then click on "Unlock bootloader"

OR

Visit this page

https://emui.huawei.com/en/plugin/unlock/detail

Enter the required details on the form

Steps to unlock the bootloader

Make sure that USB Debugging is enabled on the phone and the phone has been verified to connect to the computer and phone has permanently accepted the RSA id and connected in debug mode.

Also make sure that "Enable OEM Unlock" has been enabled in the developer options.

Put the phone in "Download mode / Fastboot mode / Bootloader mode"

Enter the following commands

fastboot oem unlock $CODE

fastboot reboot

In the above command, replace $CODE with the actual code received from Huawei

--------------------------------------------------------------------------------------------------------------------------------------------------------

Information on installing custom recovery (TWRP)

--------------------------------------------------------------------------------------------------------------------------------------------------------

Copy the "twrp-3.0.2-2-hi3660.img" file to the "Minimal ADB and Fastboot" directory

Put the phone in "Download mode / Fastboot mode / Bootloader mode"

Enter the following commands

fastboot flash recovery twrp-3.0.2-2-hi3660.img

fastboot reboot

--------------------------------------------------------------------------------------------------------------------------------------------------------

Information on rooting the phone

--------------------------------------------------------------------------------------------------------------------------------------------------------

Make sure that the version of TWRP installed is twrp-3.0.2-2-hi3660

Copy superuser-r275.zip into an external SD card

Boot into TWRP recovery mode and install the above zip file

Restart the phone in normal mode and install the "Superuser_2.0_Beta_9.apk" application

--------------------------------------------------------------------------------------------------------------------------------------------------------

Attachments referred in the guide

--------------------------------------------------------------------------------------------------------------------------------------------------------

https://drive.google.com/drive/folders/0B4pklpmVwGHqOWs3SlpWOEdUcUk