2009年7月29日 星期三

Useful tool: unyaffs

To get proprietary files from ADP1 factory image, unyaffs is useful. http://code.google.com/p/unyaffs/

I downloaded both unyaffs.c and unyaffs.h. And:
pfeng@fengdroid:~/android/tools/unyaffs$ gcc -O2 -o unyaffs unyaffs.c
pfeng@fengdroid:~/android/tools/unyaffs$ strip unyaffs
pfeng@fengdroid:~/android/tools/unyaffs$ ls
unyaffs unyaffs.c unyaffs.h


Steps to get all the files from the factory image, using 1.5 as an example:
1. Download the ADP1 factory image files from HTC: http://www.htc.com/www/support/android/adp.html
2. pfeng@fengdroid:~/android/htc$ unzip signed-dream_devphone_userdebug-img-148830.zip
Archive: signed-dream_devphone_userdebug-img-148830.zip
inflating: boot.img
inflating: recovery.img
inflating: system.img
inflating: userdata.img
inflating: android-info.txt
3. pfeng@fengdroid:~/android/htc/system$ sudo ~/bin/unyaffs ../system.img

2009年7月21日 星期二

Installing Android NDK on Ubuntu 8.04

1. Get NDK from here: http://developer.android.com/sdk/ndk/1.5_r1/index.html

2. Follow the instruction on setting it up.

3. On my Ubuntu PC, it has the following problem:

pfeng@pfeng-uatu:~/android-ndk$ ./build/host-setup.sh
./build/host-setup.sh: 23: source: not found
Detecting host toolchain.

./build/host-setup.sh: 57: force_32bit_binaries: not found
./build/host-setup.sh: 58: setup_toolchain: not found
./build/host-setup.sh: 60: cannot create : Directory nonexistent
Can't create directory for host config file: out/host

4. It appears that a bash command: source is used. However, on Ubuntu, due to performance reason, /bin/sh is now linked to /bin/dash, not /bin/bash, fro details, see https://wiki.ubuntu.com/DashAsBinSh.

5. So I have to modify ./build/host-setup.sh, from #!/bin/sh to #!/bin/bash. It works like a charm!