Archive for March, 2011
Recently Apple has introduced new iPad2 and the iPad prices plunged overnight. I’m not big fan of Apple or their products, but given the opportunity to get a 10″ tablet brand new for $300, I just could not resist the temptation. After all, I need to have a reference point for comparison with Android.
Well, the very first impressions were quite unexpected. I’ve never had a thought that after I have recharged the battery and turned the iPad for the first time I’d be unable to do anything. Brand new iPad shows “connect to iTunes” picture, which beautifully rotates with a nice smooth animation when I turn the tablet upside down, but that’s pretty much it. I can turn power off and back on to see the same picture. Nothing else happens. Nothing at all. I wonder how the people use iPad if they don’t have a computer. Or if they have a Linux desktop, which does not support iTunes.
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 process of creating your own ROM update file is not very complicated. Basically it consists of three steps:
- Download and unpack the image you like
- Make the necessary changes
- 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:
- RUU images (.exe)
- OTA images (.zip)
- 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 update.zip *
-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 SignApk.zip (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 [update.zip] [update-signed.zip]
update-signed.zip 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.
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=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.
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):
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: