Ideally, to install a OTA update on your Asus Zenfone 2, you need to be on a stock system firmware with stock recovery and no root. However, many of us like to keep our devices rooted for Xposed framework and other useful/fun stuff root access allows on Android.

So what do you do when you have a OTA update to install for your Zenfone 2, but you can’t install it because your device is rooted. Well, there are is a quick workaround. And it is a bit lengthy process to follow.

Installing Zenfone 2 OTA update with TWRP recovery

Below is a preface of what we’ll be doing to make your rooted Zenfone 2 (with TWRP) compatible with the OTA update zip.

Preface:

  • Unroot your Zenfone 2
  • Uninstall Xposed framework
  • Edit OTA update zip to make it compatible with TWRP recovery
  • Flashing OTA update using TWRP
Step 1: Download/Save the OTA update

If you downloaded the OTA update from the update notification, you can find the OTA update under /cache directory with “dlpkg” file name. Copy the dlpkg file to your device storage and rename it to update.zip.

OR you can just download the OTA update zip from various forums on the internet where Zenfone 2 is discussed like xda and Asus’s official forums.

Step 2: Unroot your Zenfone 2

The first thing you need to do to install OTA update is to unroot your Zenfone 2. For this, open SuperSU app » select Settings tab » and then select “Full unroot” to permanently unroot the device and remove all traces of it from system.

Step 3: Uninstall Xposed framework

If you’ve Xposed installed on your Zenfone 2, you need to completely uninstall it to install the OTA update.

Download the Xposed Uninstaller x86 zip file and flash it from TWRP recovery to safely uninstall Xposed.

Note: For updated Xposed uninstaller, go to the official xposed thread and download the xposed-uninstaller-xxx-x86.zip file.

Step 4: Modify OTA update zip

Now you need to modify the updater script on the OTA update zip to make it compatible with TWRP.

First, unzip/extract the OTA update zip file that you saved/downloaded in Step 1. From the extracted files and folders go to META-INF/com/google/android/ directory and open updater-script file from there.

Tip: If you’re editing the file on PC, we recommend using Notepad++, or if you’re on mobile use either DroidEdit or Turbo Editor.

Once you’ve updater-script opened, remove the following lines from the file (2nd to 5th):

getprop("ro.build.fingerprint") == "asus/WW_Z00A/Z00A:5.0/LRX21V/2.20.40.90_20150903_4959_user:user/release-keys" ||
 getprop("ro.build.fingerprint") == "asus/WW_Z00A/Z00A:5.0/LRX21V/2.20.40.97_20150917_1572_user:user/release-keys" ||
 abort("Package expects build fingerprint of asus/WW_Z00A/Z00A:5.0/LRX21V/2.20.40.90_20150903_4959_user:user/release-keys or asus/WW_Z00A/Z00A:5.0/LRX21V/2.20.40.97_20150917_1572_user:user/release-keys; this device has " + getprop("ro.build.fingerprint") + ".");
getprop("ro.product.device") == "Z00A" || abort("This package is for \"Z00A\" devices; this is a \"" + getprop("ro.product.device") + "\".");

After making the changes, your updater-script file should begin with this code.

mount("ext4", "EMMC", "/dev/block/by-name/system", "/system", "max_batch_time=0,commit=1,data=ordered,barrier=1,errors=panic,nodelalloc");
ui_print("Verifying current system...");

Once you’re sure you made changes correctly, save the updater-script file and repackage the all extracted files and folders into a new update.zip file.

Step 5: Flash the modified OTA update zip via TWRP

Finally after unrooting, removing Xposed and modifying OTA zip, you can now install the OTA update with TWRP recovery.

Just boot into TWRP and flash the OTA update zip like you’d flash any other zip using the recovery.

Hope you find the instructions above helpful.

Thanks AL_IRAQI for the original guide at xda.