How to flash a Hero ROM onto ADP1 (dev phone)

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

  1. Format sdcard to FAT
  2. Download DREAIMG-RC29
  3. Unzip and copy DREAIMG.nbh to root of sdcard
  4. Power off
  5. Press and hold Camera + Power
  6. Update as per instruction
  7. 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.

  1. Download Cyanogen’s version cm-recovery-1.4.img 
  2. Copy cm-recovery-1.4.img to root of sdcard
  3. Reboot
  4. 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.
  5. Go to Market, search for “telnet” and install
  6. Launch telnet and connect
  7. 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

  8. Power off
  9. Press and hold Home + Power
  10. 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

  1. Download ota-radio-2_22_19_26I.zip and copy to root of sdcard
  2. Download spl-signed.zip and copy to root of sdcard
  3. Reboot to recovery mode
  4. Select apply any zip and select the ota-radio-2_22_19_26I.zip
  5. When completed, reboot to recovery mode
  6. Select apply any zip and select the spl-signed.zip

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

  1. Download sdparted.txt and copy to root of sdcard
  2. Reboot to recovery
  3. Select console mode (Alt-x)
  4. Enter the commands:
    mount /sdcard
    cp /sdcard/sdparted.txt /sbin/sdparted
    chmod 755 /sbin/sdparted
    sdparted -efs ext4 -ss 150M
  5. Continue with execution of the script
  6. Enter the command “reboot recovery”
  7. 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.

  1. Copy the ROM to root of sdcard (via a cardreader)
  2. Insert sdcard back to phone
  3. Reboot to recovery
  4. Select apply any zip and select the ROM
  5. Reboot when done

That’s it :)

hero sense UI

 

Related: