I don't know how this works in country, but our justice allows us to unlock bootloader, root, install own software and so on. If phone damages somehow, company you bought phone from must prove that your software, your modification or your new non original battery caused that issue (which is...