How to Install CyanogenMod on the HTC G2 / Desire Z ("vision")

De CyanogenMod
Ir para: navegação, pesquisa

This guide will walk you through the process of taking the G2 / Desire Z from stock to having a custom recovery image and the ability to flash the latest version of CyanogenMod.

Note: DISCLAIMER

Modifying or replacing your device's software may void your device's warranty, lead to data loss, hair loss, financial loss, privacy loss, security breaches, or other damage, and therefore must be done entirely at your own risk. No one affiliated with the CyanogenMod project is responsible for your actions. Good luck.


Important Notes

The HTC Vision is a touchscreen smartphone manufactured by HTC. It is marketed as the TMobile G2 in the USA and as the HTC Desire Z internationally. Official CyanogenMod support for the HTC Vision was added in CyanogenMod 6.1.


Note:

Although the hardware is virtually identical between both versions of the vision, the installation instructions are slightly different if you have a T-Mobile G2 or Desire Z, so only follow the instructions for your device.

First, downgrade the firmware (if necessary)

If you are running a newer version of the stock firmware, you will need to first downgrade it to an older version which can be "exploited" (by which we mean given the ability to replace the operating system). So, if you have never installed your own firmware, this step may be necessary.

Here are the instructions for both the HTC Desire Z (sold in Europe) and the T-Mobile (sold in the US), both of which are based on the vision hardware:

Rooting the T-Mobile G2

Note:

If you have the Desire Z, skip this section.

Before you begin, if VISIONary is installed on the TMobile G2, uninstall it before continuing.

  1. You will need ADB on the computer to root the TMobile G2 and to flash the necessary files for radio S-OFF. Follow the Android SDK guide, to get the ADB shell on the computer.
  2. Download busybox, the ClockworkMod Recovery, the Engineering HBoot, gfree 1.0, psneuter, root_psn, Superuser package:
    • busybox: Download
      md5: 25c5db694c987995909cc3166d4f01b0
    • ClockworkMod Recovery: Download
      md5: cbc776e7941ebf030e9fa39473d5b6f1
    • Engineering HBoot: Download
      md5: 24670529d0b676ff3e53be33ac003185
    • gfree 1.0: Download
      md5: 0bc9fc22bda897c765b02066f8a3c83b
    • psneuter: Download
      md5: 89c2dec8d72d87b4c669f44dd31c8d17
    • root_psn: Download
      md5: c8fe38ef55eb8951def9ff17b2eb99c1
    • Superuser package: Download
      md5: 43d9a40b63e916635d5ad7ca32433fab
  3. Unzip the zip files and copy the contents to the same folder as adb (the /platform-tools folder within the Android SDK folder).
  4. Connect the TMobile G2 to the computer via USB.
  5. Make sure USB debugging is enabled on the TMobile G2 by checking Settings » Applications » Development » USB debugging.
  6. On the computer, open terminal and run the following commands:
    adb push busybox /data/local/tmp/
    adb push gfree /data/local/tmp/
    adb push hboot-eng.img /data/local/tmp/
    adb push psneuter /data/local/tmp/
    adb push recovery-clockwork-3.0.2.4-vision.img /data/local/tmp/recovery.img
    adb push root_psn /data/local/tmp/
    adb push su /sdcard/
    adb push Superuser.apk /sdcard/
    adb shell
    chmod 755 /data/local/tmp/*
    /data/local/tmp/psneuter
    NOTE: You will drop out of the shell after this command. Restart the shell using:
    adb shell
    cd /data/local/tmp
    ./gfree -f -b hboot-eng.img -y recovery.img
  7. As it is very important that the hboot was installed correctly gfree calculates md5sums of the partition. It will calculate the following 3 checksums
    • md5sum #1 - checksum of partition 18 before the installation
    • md5sum #2 - checksum of the hboot image that should be installed
    • md5sum #3 - checksum of partition 18 after the installation
  8. The messages that you what to see are either/or
    • md5sum #1 == md5sum #2 - the hboot image is already installed -> skipping installation
    • md5sum #3 == md5sum #2 - the hboot image was successfully installed -> OK!
  9. If you get a different error message then DO NOT REBOOT and join #G2Root on Freenode for further help.
  10. If gfree worked correctly continue with:
    ./root_psn
    sync
    reboot
  11. The TMobile G2 is now rooted with S-OFF, the Engineering HBoot & the ClockworkMod Recovery. Continue to the next section.

Rooting the Desire Z

Note:

If you have the T-mobile G2, skip this section.

Before you begin, if VISIONary is installed on the HTC Desire Z, uninstall it before continuing.

  1. You will need ADB on the computer to root the HTC Desire Z and to flash the necessary files for radio S-OFF. Follow the Android SDK guide, to get the ADB shell on the computer.
  2. Download busybox, the ClockworkMod Recovery, the Engineering HBoot, gfree 1.0, psneuter, root_psn, Superuser package:
    • busybox: Download
      md5: 25c5db694c987995909cc3166d4f01b0
    • ClockworkMod Recovery: Download
      md5: cbc776e7941ebf030e9fa39473d5b6f1
    • Engineering HBoot: Download
      md5: d8f61830f104ff5d48b855bbe0d95f56
    • gfree 1.0: Download
      md5: 0bc9fc22bda897c765b02066f8a3c83b
    • psneuter: Download
      md5: 89c2dec8d72d87b4c669f44dd31c8d17
    • root_psn: Download
      md5: c8fe38ef55eb8951def9ff17b2eb99c1
    • Superuser package: Download
      md5: 43d9a40b63e916635d5ad7ca32433fab
  3. Unzip the zip files and copy the contents to the same folder as adb (the /platform-tools folder within the Android SDK folder).
  4. Connect the HTC Desire Z to the computer via USB.
  5. Make sure USB debugging is enabled on the HTC Desire Z by checking Settings » Applications » Development » USB debugging.
  6. On the computer, open terminal and run the following commands:
    adb push busybox /data/local/tmp/
    adb push gfree /data/local/tmp/
    adb push hboot-eng.img /data/local/tmp/
    adb push psneuter /data/local/tmp/
    adb push recovery-clockwork-3.0.2.4-vision.img /data/local/tmp/recovery.img
    adb push root_psn /data/local/tmp/
    adb push su /sdcard/
    adb push Superuser.apk /sdcard/
    adb shell
    chmod 755 /data/local/tmp/*
    /data/local/tmp/psneuter
    NOTE: You will drop out of the shell after this command. Restart the shell using:
    adb shell
    cd /data/local/tmp
    ./gfree -f -b hboot-eng.img -y recovery.img
  7. As it is very important that the hboot was installed correctly gfree calculates md5sums of the partition. It will calculate the following 3 checksums
    • md5sum #1 - checksum of partition 18 before the installation
    • md5sum #2 - checksum of the hboot image that should be installed
    • md5sum #3 - checksum of partition 18 after the installation
  8. The messages that you what to see are either/or
    • md5sum #1 == md5sum #2 - the hboot image is already installed -> skipping installation
    • md5sum #3 == md5sum #2 - the hboot image was successfully installed -> OK!
  9. If you get a different error message then DO NOT REBOOT and join #G2Root on Freenode for further help.
  10. If gfree worked correctly continue with:
    ./root_psn
    sync
    reboot
  11. The HTC Desire Z is now rooted with S-OFF, the Engineering HBoot & the ClockworkMod Recovery. Continue to the next section.

Installing CyanogenMod from recovery

  1. Download the CyanogenMod package for your device that you'd like to install to your computer.
    Optional: Download 3rd party applications packages, like Google Apps which are necessary to download apps from Google Play.
  2. Boot to recovery mode, and connect the phone to your computer through USB.
    • Vol Down & Power
  3. In ClockworkMod Recovery, use the physical volume buttons to move up and down. On most devices, the power button is used to confirm a menu selection, but for some devices a physical home key acts as a selector. Some devices have touch enabled ClockworkMod Recovery, in which case you may be able to swipe to, or touch, menu selections.
  4. Optional (Recommended): Select backup and restore to create a backup of your current ROM.
  5. Select wipe data/factory reset.
  6. You have two options for transferring and installing the installation packages. Both cases require adb to be working in recovery. The sideload method is more universal across devices, whereas the push and install method is more commonly used:
    • Sideload method: select install zip > install zip from sideload. Follow the on-screen notices to install the package. The installer does not necessarily display an "Install complete." message. You can tell the install is complete if there were no fatal error messages and you have regained control over the menu.
    • Push and install method: Open a command prompt (or Terminal on Mac and Linux) and navigate to the directory holding the package(s) you would like to install. On the device, navigate to the mounts and storage menu. If you see /storage/sdcard0 or /sdcard as a mountable volume, go ahead and mount it. If you do not see one of these partitions, then instead mount the /data partition. Take note of which volume you mounted. Now, push the package(s) to your device (also, see tip below):
    - If you mounted /storage/sdcard0, then: adb push update.zip /storage/sdcard0/
    - If you mounted /sdcard or /data, then: adb push update.zip /sdcard/
    where update.zip should be replaced with the package filename. Go back to the main menu and select install zip. Choose to install from the same directory where you pushed the package(s). If you are installing multiple packages, install CyanogenMod first and then install any subsequent packages on top of it.
  7. Once installation has finished, return to the main menu and select reboot system now. The device will now boot into CyanogenMod.

Helpful Tip– SD card folders

CyanogenMod 10.1 and newer have multi-user support (introduced in Android 4.2). If your device has storage on the /data partition, then Android actually looks in /data/media/0/ for the first user's /sdcard/ storage. ClockworkMod recovery symlinks /sdcard/ to /data/media/ though. So, if you are pushing files to internal storage in recovery and want them to be visible in Android, you should push them to /sdcard/0/ or /data/media/0/. Here's the most frequent scenarios:

  1. If you're coming from a ROM with Android 4.1 or older to CyanogenMod 10 or older: adb push update.zip /sdcard/
  2. If you're coming from a ROM with Android 4.1 or older to CyanogenMod 10.1 or newer: adb shell "mkdir /sdcard/0/" followed by adb push update.zip /sdcard/0/
  3. If you're coming from a ROM with Android 4.2 or newer to CyanogenMod 10.1 or newer: adb push update.zip /sdcard/0/

Helpful Tip

See something wrong on this page? Report it here.