How to flash a Hero ROM onto HTC G1

Published on November 5, 2009

This post describes my experience in flashing a Hero ROM onto a ADP1 Google’s development phone, also known as a G1 or HTC Dream.

I. Downgrading Android to RC29

  • Format sdcard to FAT
  • Download DREAIMG-RC29
  • Unzip and copy DREAIMG.nbh to root of sdcard
  • Power off
  • Press and hold Camera + Power
  • Update as per instruction
  • Finish and reboot

Your phone is now downgraded to G1 build RC29. Wondering why we are downgrading? This is because we need to exploit a security hole that is present in RC29. In RC30+, we can no longer exploit the security hole.

II. Replacing Recovery Image

A recovery image allows us to load custom build of Android, and it is what that gives us root access to the device.

  • Download Cyanogen’s version cm-recovery-1.4.img
  • Copy cm-recovery-1.4.img to root of sdcard
  • Reboot
  • At home screen, press enter > pause for a second > press enter > type “telnetd” (if it is doing a contact search, you are correct) > press enter.
  • Go to Market, search for “telnet” and install
  • Launch telnet and connect
  • Enter the commands:
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
cd /sdcard
flash_image recovery cm-recovery-1.4.img
cat cm-recovery-1.4.img > /system/recovery.img
  • Power off
  • Press and hold Home + Power
  • You should see a Cyanogen system recovery. If you encountered a problem going into the recovery mode, try downgrading to RC29 and repeat again.

In later steps, we will be frequently rebooting the phone and goes into this recovery mode.

III. Upgrading Radio Image and SPL

  • Download and copy to root of sdcard
  • Download and copy to root of sdcard
  • Reboot to recovery mode
  • Select apply any zip and select the
  • When completed, reboot to recovery mode
  • Select apply any zip and select the

Why are we doing this?

The radio image is the latest radio baseband version. We need the correct version to go with the correct Android build.

SPL is Second Program Loader, which is part of the device’s bootloader. It is responsible for bootstraping the device, and we are replacing it with a less restrictive one that allows us to apply flash images from any region.

IV. Partition SD Card

  • Download sdparted.txt and copy to root of sdcard
  • Reboot to recovery
  • Select console mode (Alt-x)
  • Enter the commands:
mount /sdcard
cp /sdcard/sdparted.txt /sbin/sdparted
chmod 755 /sbin/sdparted
sdparted -efs ext4 -ss 150M
  • Continue with execution of the script
  • Enter the command “reboot recovery”
  • Take out your sdcard

Your sdcard is now correctly partitioned for installing bigger sized ROMs, such as Hero. As you will not be able to boot up your phone to access the sdcard now, you would need to copy the ROMs to the sdcard via a card reader.

V. Installing Custom ROMs

The last part is pretty easy - update a desired custom ROM to the phone. The hardest in this last part would be selecting from the many available ROMs :)

Visit the Android ROM Build database to download your desired ROMs. For example, I wanted to try HTC Hero on my ADP1/G1/Dream, I downloaded KiNgxKxROM Sense Hybrid v2.2.

  • Copy the ROM to root of sdcard (via a cardreader)
  • Insert sdcard back to phone
  • Reboot to recovery
  • Select apply any zip and select the ROM
  • Reboot when done

That’s it :)