[Asus Zenfone 4 (2017) Guides, News, & Discussion] Spigaw:
Hello,

As I had a somehow hard time to find a comprehensive guide on how to unlock the bootloader and root the Zenfone 4, here is a quick guide on how to do so. The method below was successfully used on a Z01KDA.

PREREQUISITES

Zenfone 4 (that... should be obvious, but who am I to judge)

A computer with:

Windows (at least Windows 7, I guess)

Fastboot ready to use (I recommend using the file from this link as it is the most straightforward, but if you prefer the SDK tools, well, you do you) and being able to use it (though on a basic level)

A USB-C cable capable of transferring data

Time to read all the annoying stuff below, and patience.

1. Bootloader unlock (from this thread // thanks to OP @shakalaca)

​

Whichever method you use to unlock your bootloader,

all your personal data and settings will be erased

and your phone will be restored to factory default. So, backup everything before going forward.

As this method was used on a rather old version of the Zenfone 4 firmware, I suggest that you use the official downgrade method from Android P to Android O. To do so :

Download the file here on your computer (the main page is located here, under Drivers & Tools), and put it

at the root of the phone, do not change the name of the file

After unplugging your phone, it will prompt a software update, proceed with it

If it doesn't work for any reason, use this method instead:

Put the file on a SD card (...inside the phone)

Reboot the phone to recovery (via ADB, or Power button + Volume down)

Install the update from recovery

Wait for the phone to reboot.

After the downgrade, you can proceed to the bootloader unlock:

Download the method of @shakalaca located here

Unzip all the files to the same folder

Get into fastboot on the phone (reboot with Power button + Volume up)

Make sure that your phone is detected with

fastboot devices

Run the file "ze554kl_unlock.bat" as administrator

Let it do its magic

Your phone will reboot, congrats, the bootloader is unlocked.

View attachment 5766345

2. Install the latest firmware available on your Zenfone 4

​

Follow the same steps as in the previous guide (1.), but with this file (the main page is located here, under BIOS & FIRMWARE ==> you have to click on EXPAND ALL to see all files)

View attachment 5766343

3. Root

​

On your phone:

Download the Magisk Manager apk from this link on your phone

Install it

On your computer:

Download the file from step 2. above

Extract it to any location

Locate the file boot.img and put it your phone.

On your phone:

Open Magisk

Click on Install

View attachment 5766355

On the next screen, select

Preserve AVB 2.0/dm-verity

Preserve force encryption

Click NEXT

Under Method, click Select and Patch a File

Select the boot.img file

Let Magisk patch the file

Locate and put the modified boot.img file on your computer (in the same folder as the one with fastboot if you did not install it system wide)

Get into fastboot mode (reboot with Power button + Volume up)

On your computer

Open a cmd window

cd to the folder where the modified boot.img is located

Check if your phone is detected with the following command:

fastboot devices

Input the following command and press Enter:

fastboot flash boot name_of_the_modified_boot.img

Reboot your phone with the following command:

fastboot reboot

Your phone will reboot, congrats, it is rooted.

Feel free to ask any question if this guide is not clear, but it should be easy to follow!