So I'm setting the resolution by editing system files. This has been the only way that works for me. More preciesly I issue this command:
echo 1080p60hz > sys/class/display/mode
to the device's termninal. This succesfully changes the resolution to 1080p60hz or to a different value if it's issued. However after restart the device returns to its previous resolution.
Does nayone know how to make it remember the new resolution? Probably another file needs to be edited but I haven't found out which.