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

From CyanogenMod
Jump to: navigation, search

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

Note:

Some devices do not have removable SD cards. Regardless, there should still be a partition on the device named "/sdcard" that can be used for flashing purposes, even though the contents of /sdcard may actually be in internal storage.

  1. Download the prebuilt release of CyanogenMod you wish to install. (Or if you've built CM yourself, look in the $OUT directory for the .zip.)
    Optional: Download any supplemental 3rd-party applications packages for the device you wish to use.
  2. Place the CyanogenMod rom .zip file on the root of the SD card using adb:
    • Transfer your file(s): adb push YOURROMZIP.zip /sdcard/
      • If you boot directly to recovery and have an internal sdcard, you may need to run adb shell mount /sdcard or mount data through the recovery menu before transferring.
      • If you see "error: device not found" there is likely a driver issue on the PC.
      • If you see "error: insufficient permissions for device", try "adb kill-server" and then run "adb devices" to see if the device is attached.
      • On some devices, the zip file can be copied to the device using standard USB Mass Storage or MTP support. Boot the device normally and transfer the file to it.
    Optional: Place any supplemental packages (e.g. Google Apps[1] or kernel) .zip file(s) on the root of the SD card.
  3. Boot to recovery mode on the device by holding Vol Down & Power.
  4. Once the device boots into the ClockworkMod Recovery, use the physical volume buttons to move up and down. On most devices, the power button is used to confirm your selection, although for some devices the power button is used as a "back" button to go up one level, in which case the home button is used to confirm the selection.
    Optional/Recommended: Select backup and restore to create a backup of the current installation on the device. If this option is missing, it's likely because the stock ROM has overwritten your custom recovery on boot.
  5. Select the option to wipe data/factory reset.
  6. Select install zip from sdcard.
  7. Select choose zip from sdcard.
  8. Select the CyanogenMod file you placed on the sdcard. You will then need to then confirm that you do wish to flash this file.
    Optional: Install any additional packages you wish using the same method.
  9. Once the installation has finished, return back to the main menu, and select the reboot system now option. The device should now boot into CyanogenMod.

Helpful Tip

See something wrong on this page? Report it here.