Ok, I managed to get it working. I don't know what I did differently this time, but I restored the phone back to stock, flashed the boot.img, and this time it worked.
Thank you very much to everyone who helped. I'm just sorry I don't know what actually fixed it for future. :/