Locate install-recovery.sh and rename it to install-recovery.sh.bak .
On some newer devices with strictly enforced verified boot (dm-verity), modifying this script without a patched kernel might cause a bootloop. Download Resources
In many Android versions, the system includes a safeguard script located at /system/etc/install-recovery.sh or /system/bin/install-recovery.sh . Its primary job is to check the integrity of the recovery partition; if it detects a custom recovery, it automatically reflashes the original factory recovery.
The file install-recovery.sh is an Android system script traditionally used to restore the stock recovery partition during boot, which can often overwrite custom recoveries like TWRP .
Disabling this file may cause official Over-The-Air (OTA) updates to fail, as they often check for original system file integrity before installing.
If you have root access through a terminal, you can move the file with: mv /system/etc/install-recovery.sh /system/etc/install-recovery.sh.bak .
Modern rooting tools like SuperSU or Magisk typically patch or disable this script automatically during the installation process.