The thing is about Xperia M5 is the enabled dm-verity, if you modify a single bit of it it will refuse to boot, which will ended up hard-bricked
(You will see a RED Led constantly turns on, when you charge the phone, on the top left corner. No success of trying all the methods and combinations...