this is script to get root access. you need to do something similar, replace in your dump kernel/rootfs/data extracted from global firmware + you can add root to debug issues. just make sure you have good vendor dump, if you break it you can't login to xiaomi cloud anymore. you can send dump to my pm i will check if it's OK.