{% include alerts/warning_unlocking_bootloader.md %}
```shell
fastboot flashing unlock_critical
```
## Flashing firmwares
1. Connect your device to your PC via USB.
1. Download the [NMJ88C archive](https://mega.nz/#!1CgF3SLa!CHLLA0HvtDtzzDnOl3CbJ1EUnhR6vFb4NA9IG6au3to) and unzip it
1.Reboot in bootloader mode
1.Enable OEM unlock in the Developer options under device Settings, if present.
```shell
1. On the computer, open a command prompt (on Windows) or terminal (on Linux or macOS) window, and type:
```
adb reboot bootloader
```
1. execute the script:
On Linux or MacOS X:
```shell
./flash-all.sh
1. Once the device is in fastboot mode, verify your PC finds it by typing:
```
fastboot devices
```
On Windows:
1. Unlock bootloader
```shell
./flash-all.bat
fastboot flashing unlock
```
(it takes a while to complete)
## Installing a custom recovery: TWRP for Mata
1. Download [TWRP for Mata](https://androidfilehost.com/?fid=818070582850502775)
1. Connect your device to your PC via USB.
1. Flash TWRP to the boot partition:
1. Unlock critical partition
```shell
fastboot -w
fastboot flash boot twrp-mata_11.img
fastboot flashing unlock_critical
```
1. Stay in bootloader mode, and use the volume down to select "Recovery mode". Then hit the power button: this should boot you in to recovery mode (TWRP). If it's asking for a password, enter your previous lockscreen password or pin, this will decrypt your data partition. Note: don't be surprised that TWRP will be erased at next boot. Therefore, you will have to reinstall it if you want to install another ROM on your device.
{% include templates/recovery_install_fastboot_ab.md %}