Posts Tagged ROM image

HOWTO :: Pull OTA upgrade file from Galaxy Nexus

Recently I’ve got Galaxy Nexus to play with, and as soon as I’ve entered Wi-Fi password, an OTA upgrade came my way. It was very tempting to upgrade immediately, but I’ve decided to pull upgrade file from the device to see what’s inside.

Unfortunately, the phone comes from the factory locked and there’s no way to access system files except unlocking the protection.

Regarding the root access

First we need the root access to be able to access files freely.

I don’t like to permanently root my phone, so I prefer the temporary method, which keeps the phone protected, but gives me the opportunity to access what I need if I really need it (I do not delve into details about how to use adb, hoping you already know that).

Unlock the phone

Reboot into fastboot mode by switching power off, and holding all three buttons (volume up/down and power) until Android logo appears. then issue ‘fastboot oem unlock’ command from your computer. This requires full memory wipe, so be careful and make a backup of any data you care to keep.

Download the superboot

Superboot is the bootoader image, which can turn the phone into a rooted one, but only until the next reboot. Handy and safe.

Reboot into superuser-enabled mode

While still in fastboot mode, the following command will restart the phone with the boot image we have just downloaded.

fastboot boot boot.superboot.img

Wait until the update comes

Since the phone was wiped clear during unlock, we have to wait again for upgrade to come, or request the upgrade check from Settings menu, if you are impatient.

Move upgrade file into the easy to access place

Since adb can not pull system files, we have to move the upgrade file somewhere we can access easily. I chose /sdcard folder for that purpose

adb shell
$ su
# cd /cache
# ls
[... file list skipped ...]
# mv /sdcard/

In your case the file name most probably will be different, but it’s quite easy to tell based on size (90MB in my case), which file to copy.

Extract the file from the phone

Finally we can use adb to get the file:

adb pull /sdcard/ .

, , , ,

No Comments

HOWTO :: repack and sign ROM image update .zip files

DISCLAIMER: I don’t invent anything new here, but just summarise things I’ve read across different forums and web sites. I did not write any software mentioned here, but only copy the files and made them available in one easy to access place. I use the procedure described here to create ROM images I flash to my HTC Desire phone, and so far it worked for me perfectly. However I do not guarantee it will work on your system with your files and your phone — use it at your own risk and assume all responsibility. REFLASHING YOUR PHONE MIGHT GET IT BRICKED AND MIGHT VOID YOUR WARRANTY.


To be able to follow this explanation you will need the basic understanding of the command line, be able to enter commands with the parameters, to walk from one folder to another, to compile programs and to run the resulting binaries. To run Java programs you’ll need Java SE runtime installed. To compress and uncompress files you’ll need “zip” program or something similar.

Your phone should be rooted beforehand or allow the installation of custom ROMs.

The Outline

The process of creating your own ROM update file is not very complicated. Basically it consists of three steps:

  1. Download and unpack the image you like
  2. Make the necessary changes
  3. Pack and sign the .zip file

The update can contain as much as the full system + boot + radio + recovery + extras, which completely overwrites everything you have in your phone, or as little as single .apk file if you want to make just small changes.

Download and unpack

There are plenty of images available on the internet, it’s in your best interest to find the one as much similar to what you need to reduce the necessary changes and introduce as few problems as possible. There are three types of images you may use:

  1. RUU images (.exe)
  2. OTA images (.zip)
  3. 3rd party .zip images

RUU images contain full system, including radio, system, boot and the whole nine yards. However you’ll need to unpack .exe file into .zip file before doing anything useful. I have explanation how to extract the .zip file in Linux but if you use Windows or MacOS your procedure might be different.

OTA images usually contain only the difference between the previous software version and the current one. Therefore you’ll need the previous software as RUU/.zip file with the exact version, and be familiar with bspatch utilty to apply patches, which is quite tedious process. I don’t usually use OTA files if there are any other options available.

.zip images are the easiest to work with, just unpack with your zip archiver to the folder you like.

If you have started with RUU image, you’ll have system.img, boot.img and radio.img files. System image can be further unpacked with unyaffs (requires compilation) to another folder, usually “system/”. Boot image can be unpacked with the perl script (requires perl to be installed on your computer) also to another folder, usually “boot/”. Radio images cannot be unpacked and are better to be left alone.

Make the changes

Most of the changes are done to the system image, which contains all software and data files visible on the phone. Boot image should be changed only if you have deep linux knowledge to modify linux kernel and related matters.

If you have unpacked system image and made some changes, the system.img file is supposed to be moved somewhere else, so it’s not used anymore. Same with the boot.img file. All other files (hboot, recovery) are usually not used, because they might lead back to unrooting the phone and should be deleted or moved as well.

If you have based your work on RUU file, you’ll have to create META-INF folder with the correct information and update scripts inside. If you have unpacked someone’s .zip, the META-INF folder should be already present. Update script might mention some files in the update, so if you have removed (or added new) files, the update script should be amended to reflect those changes. Please, get a few images from different developers and try to understand the correct internal structure.

Pack and sign .zip file

Once you’ve made all the changes, you may change to the folder where you extracted all files, it might now contain .img files, like boot.img and radio.img as well as folders, like “system/”. Zip everything together with the command:

zip -r9 *

-r9 tells the program to collect files recursively and use the maximum compression. If you omit “r”, the subfolders will not be included (bad, bad idea!), if you omit “9″ nothing bad will happens, but resulting file might be about 1% larger.

To sign zipped file you should download (requires Java), there are three files inside:

  • SignApk.jar is a tool included with the Android platform source bundle.
  • testkey.pk8 is the private key that is compatible with the rooted recovery image
  • testkey.x509.pem is the corresponding certificate/public key

and the signing command looks like this:

java -jar signapk.jar testkey.x509.pem testkey.pk8 [] [] can be copied to the phone and installed using the traditional recovery procedure. Personally I’d recommend “ClockworkMod Recovery” from Koush and Paul O’Brien, but I’m not sure if it is available for your phone.


While the actual creation of your own ROM update file is not very complicated, the devil is in the changes you make. Most ROM updates fail at first try, please, have a fresh nandroid backup ready at all times.

, , , , , ,

No Comments

HTC Desire on Softbank :: update to Froyo

wireless and network settings tab

WiFi hotspot settings

Yesterday I’ve started the update process, getting a few ROM images from the Net and trying to make them work well with SoftBank. First, there was Aug,2010 version of Froyo ROM on MoDaCo, where Paul said he did not change anything except rooting the system. I’ve made a few changes in config files regarding SBM network settings and upgraded. Everything went fine, except the phone started to behave funny and today it even FC’ed its own Launcher (!). The version of ROM was 2.09.405.8 WWE.

Finally I gave up and downloaded official RUU with 2.29.405.5 WWE software. Extracted .zip file and applied all the same changes before flashing. The only difference was, I’ve decided to change ro.wifi.hotspotUI=0 to ro.wifi.hotspotUI=1 and see what happens. The results were interesting — I’ve got two extra menu items (1) in “Wireless and Networks” settings tab, which allow to setup and configure the wireless hot-spot and share internet connection wirelessly. Probably the cellular providers are not very happy with that, which resulted in these items being excluded away on most android phones.

Also, the interesting item was (2) “USB tethering”, allowing to convert the phone into RNDIS ethernet gadget and pour TCP/IP over USB link to the PC.

, , ,

No Comments

SBM :: Froyo update secret radio options

Finally I’ve got time to prepare my personal Froyo image for HTC Desire, which is supposed to be stock WWE image with some tweaks and changes, that should allow it to work flawlessly on SBM network and don’t consume too much battery. First, the emergency call codes are supposed to be changed to the following (110 — police, 119 — fire/ambulance, and it still beats me what 118 means):,118,119

Besides the radio options used in the previous versions, there are a few new ones, not found anywhere else except the Softbank ROM image:

Not particularly sure what do they do, I think I might change hotspotUI to “yes” someday later. Also, “ro.telephony.default_network=2″ does not agree to the following piece found later in the same file, I wonder which one takes precedence, and what is network #2 in this context:

# Default network type.
# 0 => WCDMA preferred.

There’s also a few things not found in SBM image, but present in WWE release:


, , , ,

No Comments

Official HTC Froyo (2.2) image for Desire

Here’s official image from HTC, which may contain latest update for HTC Desire up to Froyo (version 2.2). Please, don’t forget to update radio, because Froyo requires at least version 5 and won’t work with outdated version 4.

, ,

1 Comment