Jun Sun's Notes on Android Development Phone 1 (ADP1)

Jun Sun
jsun@junsun.net

My environment

fastboot cannot flash images when the host is a VM image. In my case, I have tried with an VM image that runs on vmserver. Flashing will hang forever.

If you have got a regular T-mobile G1 phone, please follow this guide to unlock and root the device so that it basically becomes a dev phone.

Connect to the device

  1. Build or install adb to your host. Make sure it is in your execution path.
  2. Create /etc/udev/rules.d/51-android.rules as follows:
    
    SUBSYSTEM=="usb",SYSFS{idVendor}=="0bb4",SYMLINK+="android_adb",MODE="0666"
    
  3. Reload the rules: udevcontrol reload_rules
  4. Plug in device, and you will see something like
    
    [jsun@jessica ~]$ adb devices
    List of devices attached 
    HT845GZ51672    device
    
  5. Typing "adb shell" will give a shell to the phone.

Note:

adb will be created under <android_root>/out/host/linux-x86/bin in the following step. However, you might need it now for testing and extracting purpose. You can download the Android pre-built SDK or just my pre-built version for Fedora 10 at here. It should work for all recent Linux distros.

Install busybox

If you would like to have some conenienve while you are inside android phone, you will definitely need to install busybox.

  1. Download a pre-built busybox binary and the installation script. (Yes, unfortunately the self-installation does not work because it likes to install at /bin/ and /sbin etc)
  2. adb push them to the phone's /data/bin/ directory
  3. adb shell: cd /data/bin; chmod 755 ./busybox; sh install-busybox
  4. Optionally, add /data/bin to your path. (TODO: basically modify init.rc file in the root/boot image).

Apparently, the JF hacked images already have busybox installed. So you may skip this step with those community images.

Get around activation and registration

You can find a link below that covers this topic in depths. Here is a quick gist of some of the steps.

  1. To work around "No SIM card found" screen, run this command from adb shell console with root previlidge:
    sqlite3 /data/data/com.android.providers.settings/databases/settings.db "INSERT INTO system (name, value) VALUES ('device_provisioned', 1);"
    
  2. To set up wifi, run this command from adb shell:
    am start -a android.intent.action.MAIN -n com.android.settings/.Settings
    
  3. To avoid Android market registeration, do "vi /data/system/packages.xml" (vi comes with busybox), search for "<package name="com.android.setupwizard" ..." line, add the following before "</package>":
    <disabled-components>
    <item name="com.android.setupwizard.SetupWizardActivity" />
    </disabled-components>
    
    so that the whole section will look like:
    <package name="com.android.setupwizard" codePath="/system/app/SetupWizard.apk" system="true" ts="1217592000000" userId="10010">
    <sigs count="1">
    <cert index="0" />
    </sigs>
    <disabled-components>
    <item name="com.android.setupwizard.SetupWizardActivity" />
    </disabled-components>
    </package>
    

Change boot-up picture

Refer to http://forum.xda-developers.com/showthread.php?t=456071 for details.

Here are the quick steps for changing to netspectrum logo picture:

  1. Download the iamge file
  2. Connect the phone to the PC with fastboot executable installed.
  3. Reboot the phone to fastboot mode. Press camera button while pressing power button.
  4. Once it is up with "serial0", press return button a couple of times until you see "fastboot".
  5. Type on PC
    
    fastboot devices
    fastboot flash splash1 netspectrum-splash.raw565
    fastboot reboot
    
    The first command is to check the connection with the device.

Build from the source

  1. Obtain and install Sun's JDK 5 from here (Just JDK is sufficient)
  2. Prepare generic Android source according to Google's instruction. Note you may stop before "repo sync" step which pulls all the sources. The next step will pull the source again.
  3. Get additional sources for HTC devices based on another Google's doc
  4. Follow the remaining steps mentioned in the above link (i.e., extrace binary files, create buildspec.mk and type make)

Re-Build the kernel

Enable USB networking

This hack does the job. However, It is not cleaned up at all. Use at your own risk. Also, the credit really goes back to one engr in Google who did the work for 2.6.27. I just backported to the release kernel. Note you will lose adb feature if you enable usbnet.

(TODO)

Get rid of "System Update" reminder

For some reasons, a reminder starts to pop up that asks you to update. If you do, then you may loose some of the stuff you did. Not sure if the update comes from JF, or comes from T-mobile. In any case, it is very annoying. Here is the the workaround. You need to log in as a root.
/ # mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
/ # cd /system
/system # cd app
/system/app # mv SystemUpdater.apk SystmeUpdater.apk.orig
/system/app # mv SystemUpdater.odex SystemUpdater.odex.orig
/system/app # cd /
/ # mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system

References