The legality of rooting varies depending on your country of residence. In the United States, for example, rooting is legal under the DMCA (Digital Millennium Copyright Act). However, it's essential to check your local laws and regulations before proceeding.