Rooting

Rooting is the process of allowing users of s, and other devices running the   to attain  (known as ) over various Android subsystems. As Android uses the, rooting an Android device gives similar access to administrative permissions as on  or any other  operating system such as  or.

Rooting is often performed with the goal of overcoming limitations that and hardware manufacturers put on some devices. Thus, rooting gives the ability (or permission) to alter or replace system applications and settings, run specialized ("apps") that require administrator-level permissions, or perform other operations that are otherwise inaccessible to a normal Android user. On Android, rooting can also facilitate the complete removal and replacement of the device's operating system, usually with a more recent release of its current operating system.

Root access is sometimes compared to devices running the Apple  operating system. However, these are different concepts: Jailbreaking is the bypass of several types of Apple prohibitions for the end user, including modifying the operating system (enforced by a "locked "), installing non-officially approved (not available on ) applications via, and granting the user elevated administration-level privileges (rooting). Many vendors such as, , and  explicitly provide the ability to unlock devices, and even replace the operating system entirely. Similarly, the ability to sideload applications is typically permissible on Android devices without root permissions. Thus, it is primarily the third aspect of iOS jailbreaking (giving users administrative privileges) that most directly correlates to Android rooting.

Overview
Rooting lets all user-installed applications run privileged commands typically unavailable to the devices in the stock configuration. Rooting is required for more advanced and potentially dangerous operations including modifying or deleting system files, removing, and low-level access to the hardware itself (rebooting, controlling status lights, or recalibrating touch inputs.) A typical rooting installation also installs the Superuser application, which supervises applications that are granted root or superuser rights by requesting approval from the user before granting said permissions. A secondary operation, unlocking the device's verification, is required to remove or replace the installed operating system.

In contrast to, rooting is not needed to run applications distributed outside of the Google Play Store, sometimes called sideloading. The Android OS supports this feature natively in two ways: through the "Unknown sources" option in the Settings menu and through the. However, some US, including , prevented the installation of applications not on the Play Store in , although several devices are not subject to this rule, including the ; AT&T lifted the restriction on most devices by the middle of 2011.

, the Amazon defaults to the  instead of, though like most other Android devices, Kindle Fire allows sideloading of applications from unknown sources, and the "easy installer" application on the Amazon Appstore makes this easy. Other vendors of Android devices may look to other sources in the future. Access to alternate apps may require rooting but rooting is not always necessary.

Rooting an Android phone lets the owner add, edit or delete system files, which in turn lets them perform various tweaks and use apps that require root access.

Advantages
Advantages of rooting include the possibility for complete control over the look and feel of the device. As a superuser has access to the device's system files, all aspects of the operating system can be customized with the only real limitation being the level of coding expertise. Immediately expectable advantages of rooted devices include the following:


 * Support for themes, allowing everything to be visually changed from the color of the battery icon, to the boot animation that appears while the device is booting, and more.
 * Full control of the kernel, which, for example, allows and underclocking the CPU and GPU.
 * Full application control, including the ability to backup, restore, or batch edit applications, or to remove that comes pre-installed on many phones.
 * Custom automated system-level processes through the use of third-party applications.
 * Ability to install a (also known as a custom ROM) or software (such as Xposed, Magisk,, etc.) that allows additional levels of control on a rooted device.

Methods
Some rooting methods involve use of the command prompt and development interface called (ADB), while other methods may use specialized applications and be as simple as clicking one button. Devices, or sometimes even different variants of the same device, can have different hardware configurations. Thus, if the guide, ROM, or root method used is for a device variant with a different hardware setup, there is a risk of the device.

In recent years, there is a new method of rooting Android devices called "systemless root". Systemless root uses various techniques to gain root access without modifying the system of a device. One example is Magisk, which also has an ability to hide root access from other applications that refuse to work, such as Safetynet protected applications like and .

The distinction between "soft rooting" through a third-party application which uses a security vulnerability ("root exploit") and "hard-rooting" by a    executable is sometimes made. If a phone can be soft rooted, it is vulnerable to malware.

Varieties
The process of rooting varies widely by device, but usually includes one or more security bugs in the firmware of (i.e., in the version of the Android OS installed on) the device. Once an exploit is discovered, a custom recovery image that will skip the check of firmware updates can be flashed. Then a modified firmware update that typically includes the utilities needed to run apps as root can be installed. For example, the   (such as an open-source one paired with the Superuser or SuperSU application) can be copied to a location in the current process'  (e.g.,  ) and granted executable permissions with the   command. A third-party supervisor application, like Superuser or SuperSU, can then regulate and log elevated permission requests from other applications. Many guides, tutorials, and automatic processes exist for popular Android devices facilitating a fast and easy rooting process.

The process of rooting a device may be simple or complex, and it even may depend upon serendipity. For example, shortly after the release of the, it was discovered that anything typed using the keyboard was being interpreted as a command in a privileged (root) shell. Although Google quickly released a patch to fix this, a signed image of the old firmware leaked, which gave users the ability to downgrade and use the original exploit to gain root access.

Manufacturer support
Some manufacturers, including LG, HTC, and Motorola, provide official support for unlocking the bootloader which allows for rooting without exploiting a vulnerability. However, the support may be limited only to certain phones - for example, LG released its bootloader unlock tool only for certain models of its phones.

The Android  line of devices can be boot-loader unlocked by simply connecting the device to a computer while in boot-loader mode and running the  protocol with the command. After accepting a warning, the boot-loader is unlocked, so a new system image can be written directly to flash without the need for an exploit.

Difficulties
In the past, many manufacturers have tried to make non-rootable phones with more elaborate protections (like the ), but they are usually still rootable in some way. There may be no root exploit available for new or recently updated phones, but one is usually available within a few months.

Industry reaction
Until 2010, tablet and smartphone manufacturers, as well as mobile carriers, were mainly unsupportive of third-party firmware development. Manufacturers had expressed concern about improper functioning of devices running unofficial software and related support costs. Moreover, firmware such as and  sometimes offer features for which carriers would otherwise charge a premium, such as. Due to that, technical obstacles such as locked s and restricted access to root permissions have commonly been introduced in many devices. For example, in late December 2011, and  began pushing automatic,  firmware updates, 1.4.1 to s and 6.2.1 to s, that removed one method to gain root access to the devices. The Nook Tablet 1.4.1 update also removed users' ability to apps from sources other than the official Barnes & Noble app store (without ).

However, as community-developed software began to grow popular in the late 2009 to early 2010, and following a statement by the Copyright Office and Librarian of Congress (US) allowing the use of "jailbroken" mobile devices, manufacturers and carriers have softened their position regarding and other unofficial firmware distributions. Some manufacturers, including, , and  actively provide support and encourage development.

In 2011, the need to circumvent hardware restrictions to install unofficial firmware lessened as an increasing number of devices shipped with unlocked or unlockable s, similar to the series of phones. Device manufacturer has announced that it would support aftermarket software developers by making the bootloaders of all new devices unlockable. However, carriers, such as and more recently, have continuously blocked s, such as HTC and , from releasing  devices with unlocked bootloaders, opting instead for "developer edition" devices that are only sold un and off-contract. These are similar in practice to Nexus devices, but for a and with no contract discounts.

In 2014, Samsung released a security service called, which is a tool that prevents all modifying of system and boot files, and any attempts set an e-fuse to 0x1, permanently voiding the warranty.

Legality
International treaties have influenced the development of laws affecting rooting. The 1996 requires nations party to the treaties to enact laws against  (DRM) circumvention. The American implementation is the (DMCA), which includes a process for establishing exemptions for non-copyright-infringing purposes such as rooting. The 2001 implemented the treaty in Europe, requiring member states of the  to implement legal protections for technological protection measures. The Copyright Directive includes exceptions to allow breaking those measures for non-copyright-infringing purposes, such as to run alternative software, but member states vary on the implementation of the directive.

Australia
In 2010, said that it is unclear whether rooting is legal in Australia, and that anti-circumvention laws may apply. These laws were strengthened by the.

Canada
In November 2012, Canada with new provisions prohibiting tampering with digital locks, with exceptions including software interoperability. Rooting a device to run alternative software is a form of circumventing digital locks for the purpose of software interoperability.

There had been several efforts from 2008 to 2011 to amend the Copyright Act (Bill C-60,, and ) to prohibit tampering with digital locks, along with initial proposals for C-11 that were more restrictive, but those bills were set aside. In 2011,, a Canadian copyright scholar, cited iPhone jailbreaking as a non-copyright-related activity that overly-broad Copyright Act amendments could prohibit.

European Union
The argues that it is legal to root or flash any device. According to the European Directive 1999/44/EC, replacing the original operating system with another does not void the statutory warranty that covers the hardware of the device for two years unless the seller can prove that the modification caused the defect.

United Kingdom
The law makes circumventing DRM protection measures legal for the purpose of interoperability but not copyright infringement. Rooting may be a form of circumvention covered by that law, but this has not been tested in court. Competition laws may also be relevant. See also "" section above.

India
permits circumventing DRM for non-copyright-infringing purposes. introduced a bill including this DRM provision in 2010 and passed it in 2012 as Copyright (Amendment) Bill 2012. India is not a signatory to the WIPO Copyright Treaty that requires laws against DRM circumvention, but being listed on the US "Priority Watch List" applied pressure to develop stricter copyright laws in line with the WIPO treaty.

New Zealand
allows the circumvention of technological protection measure (TPM) as long as the use is for legal, non-copyright-infringing purposes. This law was added to the as part of the.

Singapore
Rooting might be legal in Singapore if done to provide interoperability and not circumvent copyright, but that has not been tested in court.

United States
The guarantees that consumers can unlock or let others unlock their phones. Under the (DMCA) rooting was illegal in the United States except by exemption. The granted an exemption to this law "at least through 2015".

In 2010, in response to a request by the, the explicitly recognized an exemption to the DMCA to permit rooting. In their ruling, the Library of Congress affirmed on July 26, 2010 that rooting is exempt from DMCA rules with respect to circumventing digital locks. DMCA exemptions must be reviewed and renewed every three years or else they expire.

On October 28, 2012, the US Copyright Office updated their exemption policies. The rooting of smartphones continues to be legal "where circumvention is accomplished for the sole purpose of enabling interoperability of [lawfully obtained software] applications with computer programs on the telephone handset". However, the U.S. Copyright office refused to extend this exemption to tablets, arguing that the term "tablets" is broad and ill-defined, and an exemption to this class of devices could have unintended side effects. The Copyright Office also renewed the 2010 exemption for unofficially unlocking phones to use them on unapproved carriers, but restricted this exemption to phones purchased before January 26, 2013.

, a professor at, argued in 2007 that jailbreaking is "legal, ethical, and just plain fun". Wu cited an explicit exemption issued by the in 2006 for personal unlocking, which notes that locks "are used by wireless carriers to limit the ability of subscribers to switch to other carriers, a business decision that has nothing whatsoever to do with the interests protected by copyright" and thus do not implicate the DMCA. Wu did not claim that this exemption applies to those who help others unlock a device or "traffic" in software to do so. In 2010 and 2012, the U.S. Copyright Office approved exemptions to the DMCA that allow users to root their devices legally. It is still possible to employ technical countermeasures to prevent rooting or prevent rooted phones from functioning. It is also unclear whether it is legal to traffic in the tools used to make rooting easy.