This is Not My work all Credit Goes to @XN Logos
1. unlock bootloader -
2. Download twrp-
3. Run toolkit from recovery folder and follow on screen instructions...
4. taken From https://romprovider.com/2017/10/twrp...-redmi-5-riva/
How to Root-
1. reboot to twrp.
2. create nandroid backup..
3. flash magisk [added with twrp]
4. flash no verity from twrp folder
5. Done successfully Rooted..
have issue in unlocking use china server during unlocking process...