htcdev - unlock bootloader

6
ROM Flashing Guide: Best Practices What is This Document? Disclaimers Definitions Process Flashing: From a Computer Flashing: From the Device What is This Document? This document outlines best practices for changing the software that operates HTC Android devices. It is only useful to people who wish to run software not provided by HTC or wireless carriers in order to change the functionality of the device. Disclaimers Software provided by HTC or wireless carriers is always provided as 1) a program that runs on a computer connected to an HTC device and that updates the software on that device, or 2) an update downloaded and installed by the device itself. This guide is not intended for users who are installing approved software provided by HTC or wireless carriers. Our devices have been designed with our hardware and software specifications in mind and unlocking the bootloader will change the software and may cause unexpected side effects. If you unlock the bootloader and attempt to flash a custom unsigned ROM to your device, this ROM will not have gone through our internal testing process. It is impossible for HTC to ensure the proper functioning of your device after this. In the worst case scenario, it is possible that your device may be physically damaged due to overheating or the behavior of your device might be altered and certain functions may cease to work. It is our responsibility to caution you that not all claims resulting or caused by or from the unlocking of the bootloader may be covered under warranty. Please understand that you will not be able to return your device to the original state and going forward your device may not be held covered under the warranty for all claims resulting from the unlocking of the bootloader. HTC bears no responsibility if your device is no longer usable afterwards. We strongly suggest that you do not unlock the bootloader unless you are confident that you understand the risks involved and the potential consequences both to your device and to your warranty. Definitions This document attempts to use informal language that will make it as easy as possible to understand for anyone interested in the topic, even if they have not been technically trained. Here are the informal definitions of the technical terms used in the document: hardware the physical components of an electronic device software information contained in the device that determines how it behaves; it can include instructions the device can follow, or data that it acts on operating software software that controls how the device works, as opposed to software like apps that provide specific functions and that are run by the operating software ROM a set of operating software for a device, derived from the term “Read Only Memory” due to the fact that operating software used to be stored in a way that could only be read, not written to Welcome, satyaji. Logout My Account ROM Flashing Guide Unlock Bootloader Frequently Asked Questions Preview Unlock Process About Unlock and SON ROM Flashing Guide Building Kernels

Upload: cliquedev

Post on 17-Jan-2016

52 views

Category:

Documents


0 download

DESCRIPTION

bootloader unlock

TRANSCRIPT

Page 1: HTCdev - Unlock Bootloader

ROM Flashing Guide: Best PracticesWhat is This Document?DisclaimersDefinitionsProcessFlashing: From a ComputerFlashing: From the Device

What is This Document?

This document outlines best practices for changing the software that operates HTC Android devices. It isonly useful to people who wish to run software not provided by HTC or wireless carriers in order to changethe functionality of the device.

Disclaimers

Software provided by HTC or wireless carriers is always provided as 1) a program that runs on a computerconnected to an HTC device and that updates the software on that device, or 2) an update downloadedand installed by the device itself. This guide is not intended for users who are installing approved softwareprovided by HTC or wireless carriers.

Our devices have been designed with our hardware and software specifications in mind and unlocking thebootloader will change the software and may cause unexpected side effects. If you unlock the bootloaderand attempt to flash a custom unsigned ROM to your device, this ROM will not have gone through ourinternal testing process. It is impossible for HTC to ensure the proper functioning of your device after this.In the worst case scenario, it is possible that your device may be physically damaged due to overheatingor the behavior of your device might be altered and certain functions may cease to work.

It is our responsibility to caution you that not all claims resulting or caused by or from theunlocking of the bootloader may be covered under warranty. Please understand that you will not beable to return your device to the original state and going forward your device may not be held coveredunder the warranty for all claims resulting from the unlocking of the bootloader. HTC bears noresponsibility if your device is no longer usable afterwards. We strongly suggest that you do not unlock thebootloader unless you are confident that you understand the risks involved and the potentialconsequences both to your device and to your warranty.

Definitions

This document attempts to use informal language that will make it as easy as possible to understand foranyone interested in the topic, even if they have not been technically trained. Here are the informaldefinitions of the technical terms used in the document:

hardware ­ the physical components of an electronic device

software ­ information contained in the device that determines how it behaves; it can include instructionsthe device can follow, or data that it acts on

operating software ­ software that controls how the device works, as opposed to software like apps thatprovide specific functions and that are run by the operating software

ROM ­ a set of operating software for a device, derived from the term “Read Only Memory” due to the factthat operating software used to be stored in a way that could only be read, not written to

Welcome, satyaji. Logout My Account

ROM Flashing Guide

Unlock Bootloader

Frequently Asked QuestionsPreview Unlock ProcessAbout Unlock and S­ONROM Flashing GuideBuilding Kernels

Page 2: HTCdev - Unlock Bootloader

flash ­ to change part or all of the operating software on a device, derived from the fact that operatingsoftware is often stored in a device in a way that can only be updated in large pieces or by special softwareor hardware

RUU ­ Rom Update Utility, a program provided by HTC that runs on a computer connected to an HTCdevice and that updates the operating software

unlock ­ removing restrictions on a device, often placed there to ensure the device behaves in a reliableand known manner with easier and higher quality support and to ensure the device behaves as requiredby the owner of the cellular network it is designed for

SIM ­ a card in some devices that identifies the account on the cellular network and stores some contacts

SIM unlock ­ unlocking a device so that it can use SIM cards from a different cellular network

bootloader ­ operating software that runs when a device is first turned on and decides what other softwareto run

bootloader unlock ­ unlocking a device bootloader so that different software may be run; enables the userto put custom ROMs on the device

unlocked/relocked/locked/tampered ­ a message displayed by the bootloader to help support staffunderstand the device may no longer behave as they were trained to support

signing ­ putting an identifier on software that indicates who created it and that becomes invalid if thesoftware is changed

partition ­ a separately named area of the device for storing software; different partitions are used fordifferent purposes and the amount of access allowed by the bootloader differs

S­OFF­ a term used by HTC to indicate no partitions are secured. HTC does not ship devices S­OFF dueto regulations and dangers related to radio software being changed and other issues. HTC devices shipwith S­ON status

Process

To flash software not signed by HTC, you first need to unlock the bootloader on your device. You canunlock the bootloader on supported HTC devices here: http://www.htcdev.com/bootloader/

HTC is committed to assisting customers in unlocking bootloaders for HTC devices. In some cases,however, carrier restrictions prevent certain devices from participating in our bootloader unlockingprogram. Rest assured, HTC is committed to assisting developers in unlocking bootloaders for HTCdevices and we’ll continue to assist in unlocking additional devices in the future. Please refer to the list ofsupported devices to see if your device is eligible for unlocking the bootloader. Unlocking the bootloaderdoes not unlock all partitions on the device, such as the one that holds radio software or the one thatdetermines if the device is S­ON/S­OFF. Please reference the Unlock process overview here for additionaldetails.

Flashing: From a Computer

Flashing from a computer connected to a device can be done in two ways. One way is to run an HTC RUUprogram provided to update devices to a certain software ROM version. RUU programs include the ROMin the RUU program itself. The RUU program presents a graphical user interface when run that guides youthrough the process with buttons for things like continuing and canceling.

Page 3: HTCdev - Unlock Bootloader

Running an RUU on a computer to replace the software on the connected phone.

The second way is to use the command line textual computer program called fastboot. This runs on thecomputer connected to the device and allow flashing separate ROM ZIPs and separte partition dataimages. Copies of the fastboot program are available on the second page of the unlock instructions.

To flash a ROMs or partition data using fastboot on a new device like the HTC One, you would follow thesesteps:

1) Turn the device off: Start your phone’s Settings. Enter the Power section. Make sure the “Fast boot”option is not checked. This option prevents the device from fully restarting. Unplug the device and holddown the power button approximately 15 seconds until the button lights flash. This completely powersdown the device.

2) Start the phone in bootloader mode: If your device started booting automatically, hold down the volumedown button while it boots. If it stayed off, hold down the volume down button and press the power buttonto boot the phone. The phone should boot into a text menu with the FASTBOOT option highlighted. Pressthe power button to select this option.

A phone started in bootloader mode with the FASTBOOT option selected.

3) Connect the device to the computer. Ensure the device drivers are installed. The FASTBOOT indicatoron the phone should change to “FASTBOOT USB” when plugged in.

Page 4: HTCdev - Unlock Bootloader

A phone after selecting the FASTBOOT option, but before connecting it the PC with workingdrivers.

A phone in FASTBOOT mode with a connection to the PC with working drivers.

4) Use the “fastboot oem rebootRUU” command to prepare the device to receive an update. Run the“fastboot erase cache” command to clear the temporary file area.

5) If you are flashing a ROM provided by HTC and your device is unlocked, run the “fastboot oem lock”command.

6a) To flash a ZIP called rom.zip with multiple partition data files inside it, use the command “fastboot flashzip rom.zip” to send the update to the device. Not that most HTC and HTC derived ROMs are distributed inthis format. Other custom ROMs are delivered as a different kind of ZIP file called an update ZIP. Anupdate ZIP contains a list of commands that perform the actual flashing and need to be run as per theFlashing: From the Device section of this document. You cannot flash an update ZIP by this process.

Page 5: HTCdev - Unlock Bootloader

Flashing an entire ROM.

6b) To flash a single partition data image for the boot partition in a file called boot.img to the boot partition,use the command “fastboot flash boot boot.img”. Some custom ROMs require performing this and theninstalling an update ZIP afterwards to flash the rest of the partitions on the device.

6c) To flash recovery data from a file called recovery.img, use “fastboot flash recovery recovery.img”.

6d) To boot the phone only once using a boot partition data file called boot.img, run “fastboot bootboot.img”.

7) If you are prompted to “flush again immediately”, repeat steps 5 and 6 again to update the remainingpartitions. Run “fastboot erase cache” when finished. If you do not clear the temporary file storagepartition, the phone may not boot completely and you may see the startup sequence repeat over and over.Restart from step 1 if this happens.

8) Use the “fastboot reboot” command to have the device reboot and run the updated software.

Flashing: From the Device

Some devices support reading an HTC ROM zip from external storage attached to the device. Forexample, to flash an HTC Sensation with an SD card from the device itself, connect it to a computer, putthe Sensation in USB storage mode, copy the ROM to the SD card as “PG58IMG.zip”, then use steps 1­2above. The name of the file changes depending on the device. This process works with devices thatinclude an SD card slot, such as the Sprint Evo 4G LTE. Devices like the HTC One do not have an SD cardslot, but can read an update ZIP from external storage via a USB dongle.

Another way to flash from the device is to use custom recovery partition software. To do this you wouldcopy what you want to flash on to the device ahead of time while fully booted into Android. Next follow thesteps for flashing from a computer to flash the custom recovery file. If the recovery file is namedrecovery.img, you would run “fastboot flash recovery recovery.img” for step 6. To then use the customrecovery:

1) Turn the device off: Unplug the device and hold down the power button approximately 15seconds untilthe button lights flash. This powers down the device. If you power down by the power button menu inAnroid instead, ensure you have turned off the Fast Boot setting in the phone settings. This settingprevents the phone from fully powering off when turned off by the menu.

2) Start the phone in bootloader mode: Hold down the volume down button and press the power button ifneeded to boot the phone. The phone should boot into a text menu with the FASTBOOT optionhighlighted. Press the volume down button to select the RECOVERY option. Press the power button tochoose this option. The phone should now reboot into the custom recovery software.

3a) The custom recovery software may support installing a ROM update ZIP file. It may also contains acommand called “fix permissions” that will enable installing update ZIPs like that require extra access tothe system partiton. Many recoveries also support making a backup of your device’s current state. It isgood practice to make a backup before flashing any further partitions.

3b) Custom recovery software may support running the ADB tool from the desktop to run as root on thedevice and flash partitions manually. To flash the HTC One boot partition from recovery you would run the“adb shell” command, then this to confirm where to write to and write:

/dev/block # cd /proc//proc # cat emmcdev: size erasesize namemmcblk0p19: 000ffa00 00000200 “misc”mmcblk0p34: 00fffe00 00000200 “recovery”mmcblk0p33: 01000000 00000200 “boot”mmcblk0p35: 73fffc00 00000200 “system”

Page 6: HTCdev - Unlock Bootloader

mmcblk0p26: 00140200 00000200 “local”mmcblk0p36: 27fffe00 00000200 “cache”mmcblk0p37: 680000000 00000200 “userdata”mmcblk0p22: 01400000 00000200 “devlog”mmcblk0p24: 00040000 00000200 “pdata”mmcblk0p27: 00010000 00000200 “extra”mmcblk0p31: 04b00200 00000200 “radio”mmcblk0p16: 03c00400 00000200 “adsp”mmcblk0p15: 00100000 00000200 “dsps”mmcblk0p17: 007ffa00 00000200 “radio_config”mmcblk0p20: 00400000 00000200 “modem_st1”mmcblk0p21: 00400000 00000200 “modem_st2”mmcblk0p28: 00100000 00000200 “cdma_record”mmcblk0p18: 02000000 00000200 “reserve_1”mmcblk0p30: 034ffa00 00000200 “reserve_2”mmcblk0p32: 05fffc00 00000200 “reserve_3”mmcblk0p29: 06069e00 00000200 “reserve”/proc # dd if=/sdcard/boot.img of=/dev/block/mmcblk0p3311500+0 records in11500+0 records out5888000 bytes (5.6MB) copied, 1.515062 seconds, 3.7MB/s/proc #

4) Be sure to use the erase cache option in the recovery before rebooting.

Copyright © 2015 HTC Corporation. All rights reserved.Terms of Use Privacy Policy About HTCdev HTCdev Affiliates

Follow UsComments ­ Tell HTCdev what YOU want.