you can find a working R version for mido here
just remember flash is only possible with twrp based on 4.9 kernel…