[Xiaomi Redmi 5A Guides, News, & Discussion] saurabh6377:
Bypass bootloader guide https://xdaforums.com/xiaomi-redmi-5a/how-to/bypass-bootloader-lock-redmi-5ariva-t3772381 by dev @xaacnz.

A little bit of disclaimer......

Appender is for those who are currently using bypass bootloader hack above, so there is no need of manually appending blocks to boot image/recoevry image after every flash. Appender automatically appends the 4k bytes to boot image and recovery image.

NOTE: DO NOT QUOTE WHOLE POST OR I WILL IGNORE

Appender-v4 Download below

Changelog:

Appender-v4

*Fixed Appender on system-as-root boot images (Appender breaks GSI with system-as-root, don't use GSI)

*Improved overall code

Appender-v3

*Initial test version

Recommended twrp: Pitch black recovery

Link

Appender-v4.zip is for boot image

Appender-v4-rec.zip is for recovery image

Appender Usage

1. Flash rom

2. Flash magisk for root (skip if you don't need root)

3. Flash custom kernel (skip if you don't need custom kernel)

4. After that flash Appender-v4.zip

5. Reboot

Appender Recovery Version Usage

1. Flash recovery image

2. Flash Appender-v4-rec.zip

3. Reboot Recovery

CAUTION: Appender must be flashed EVERY time you modify boot image or recovery image.

And don't forget to press thanks if this tool has helped you

Reporting errors.

After flashing appender, send the file /cache/recovery/last_log if Appender didn't worked, and also metion the issue you are facing.

Credits and thanks

@osm0sis for Anykernel3

@xaacnz for bypass bl guide

steeldriver (stackexchange) for helping me with commands

busybox team

Old method

Note1: Even though no data is erased in this process it is recommended to take backup.

What this guide covers.

1. Rooting your device

2. Flashing custom kernel

All without need to unlock bootloader​

Well there are two ways with which you can do this

Requirements

For PC based method

1. Working twrp recovery (if you dont have twrp installed follow this guide)

2. Pc must have linux installed, if you have windows don't worry install WSL using this link

3. Android image kitchen for your respective OS.

4. Latest magisk zip from here

For Android only

1. Working twrp

2. Any hex editor(Note2) for android/windows (optional)

3. Latest Magisk manager app only (for root only)

4. Android Image kitchen- android, windows/linux (for custom kernel only)

Steps for PC based​

1. Flash magisk zip or any kernel. Don't reboot system.

2. Go to backup senction in twrp and backup boot.

3. Connect your device to PC and look where you backed up boot and copy boot.emmc.win to Android image kitchen folder and rename to boot.img

4. Run unpackimg.sh or double click on unpackimg.bat. Then run repackimg.sh or double click on repackimg.bat. You will see image-new.img in the same folder

5. On windows hold Shift and right click in file manager with mouse, you will see open linux shell here, click it. OR if you have linux (specifically ubuntu) then right click and select open terminal here in Nautilus.

6. Run (to append 4k block, note that you can append block to any file specified by "of" parameter like of=twrp.img, of=boot.img etc)

printf 'x30x83x19x89x64' | dd of=image-new.img ibs=4096 conv=sync,notrunc oflag=append

7. Copy the image-new.img to your phone anywhere you prefer.

8. Flash image-new.img using twrp to boot partition.

9. Reboot

Steps for non-PC based (*outdated and some kernels won't work fully)​

[/CENTER]

1. Extract boot.img from your currently installed rom and put it in internal storage of your phone (if you do not want to flash custom kernel skip to step 4)

*2. Download custom kernel you want to flash, extract zImage from the flashable kernel zip

*3. Unpack boot image using android image kitchen, in the split_img folder delete "boot.img-zImage" and put zImage you extracted in split_img folder and rename it to "boot.img-zImage"

*For custom kernel only

4. Install magisk manager apk on your phone

5. open magisk manager, you will see magisk is not installed select install (first one), a popup will appear telling to install magisk, select install, then select Patch a file, select the boot.img file that you extracted, then let magisk manager do the rest, after finishing the magisk-patched.img file will be stored in Downloads folder of your internal storage

6. Open the patched_boot.img in hex editor

7. To make the patched_boot.img to boot append(Note2) a 4k block which begins with 0x30, 0x83, 0x19, 0x89, 0x64 to patched_boot.img, and save the file

8. Boot into twrp and flash patched_boot.img

9. Done, reboot

Note2: On Linux you can use dd command to append

printf 'x30x83x19x89x64' | dd of=testfile ibs=4096 conv=sync,notrunc oflag=append

Note3: If you get error cannot mount twrp while flashing, use recommend twrp above

If you get error related to ramdisk compression, use Appender-v4 or above

XDA:DevDB Information

Appender for Redmi 5A (bypass bootloader), Tool/Utility for the Xiaomi Redmi 5A

Contributors

saurabh6377

Version Information

Status: Beta

Current Beta Version: 4

Beta Release Date: 2019-09-29

Created 2019-09-28

Last Updated 2019-09-29