Quick Script Instructions
Because the instructions for creating the nook image are simple terminal commands, a member of the nookDevs community has created a downloadable script to automate the process. To download and execute the script, follow these instructions (be sure to read the notes below):
- Run the following in a terminal
cd /tmp/ wget http://programdotrun.com/downloads/nook1.4/1.4nookImage.sh sh 1.4nookImage.sh
- When the terminal prompts you to copy system.img, we need to first create a AVD using the Android AVD Manager (step 14 below). If the android SDK tools are in the path, a simple ‘android’ command will start it, otherwise find the Android SDK tools directory and run ‘android’.
- Click “New” to create a new AVD
- Use the following properties:
Target: Android 1.5
Skin: Click Resolution and fill in 488 x 944 (see note below concerning screen size)
- Click “Create AVD”
- Rename system.img in your images directory to good.img. Copy good.img to the ~/nook_dev/ directory.
- Hit enter in the terminal, and when the script is done, copy ~/nook_dev/system.img into the images/ directory.
- Make sure you have the [Android SDK] installed.
- The above instructions will put everything in ~/nook_dev/
- The directory where the android sdk is installed will be referred to as android_sdk
- The images/ directory that is refered to is android_sdk/platforms/android-3/images/
- The screen size currently does not fit all of the eink display. Any wider and the emulator just won’t start. This is the biggest that will work and should be fine for development
You can now start on step 19 below.
Raw Instructions for Unix/Linux
In order to do this, you will need to:
- Download the Android SDK and install it. Install the Platform 1.5 SDK using tools/android in the Android SDK.
- Grab the original 1.0.0 image from bn.com (mirrored here: multiupload).
- Run dd if=signed_bravo_update.1.0.0.dat of=signed-bravo-update.1.0.0.tar.gz bs=8 skip=19 (On Windows use this tool. At the command line run gzip-extract signed-bravo-update.1.0.0.tar.gz bravo_update.dat. NOTE: gzip-extract requires the .net framework. Afterwards rename bravo_update.dat to signed-bravo-update.1.0.0.tar.gz)
- Extract signed-bravo-update.1.0.0.tar.gz.
- Rename bravo_update.dat to bravo_update.tar.gz and extract it.
- Extract root.tgz.
- Extract root/system/framework/services.jar with your favorite unzip utility.
- Download and install smali. You need at least baksmali-1.1.jar and smali-1.1.jar. For your sanity, grab the wrapper scripts as well.
baksmali classes.dexon the classes.dex from services.jar to disassemble services.jar
- Edit out/com/android/server/ServerThread.smali and remove the line
if-lt v0, v1, :cond_483This should be line 966. (In version 1.0.0)
smali out/to re-assemble classes.dex with our fixes.
- Rename out.dex to classes.dex and copy this classes.dex to services directory, overwriting the original classes.dex.
- Delete the out directory and re-jar the contents of the services directory (not the directory itself!).
jar -cf services.jar classes.dex
- Make an Android Device (AVD entry) in the Android Emulator and name it nook (case sensitive.) Set the target platform 1.5 and skin/screen size of 480 by 944. (The real resolution is more like 600x944 but the emulator won't start at that size. But in order to see the touch-screen, it needs to be at least 944 pixels tall, and the touch display is 480 pixels across, so 480x944 is a reasonable compromise for development.)
- If you are unable to create the AVDs (something like Error: Ignoring platform 'google_apis-3-r03': build.prop is missing. ) then install Eclipse, install the Android plugins for Eclipse and you will be able to create the AVDs from there.
- grab lib/libaudioflinger.so from stock system.img supplied with Android SDK using unix utility unyaffs to extract the file
- overwrite the libaudioflinger.so from the system/lib directory in the nook firmware with the stock Android SDK one.
- use mkyaffs2image to make a system.img of the system/ of the nook firmware (how to build mkyaffs2image on OS X).
mkyaffs2image ./system/ system.img
- rename system.img in the 1.5 firmware platform, android-sdk-linux_86/platforms/android-3/images, to system.good and copy in replacement system.img file you just created (it will be bigger than the SDK Android system.img (approximately 108Mb). You can download here: system.img
- Run the emulator by using command line
emulator @nook -shell -show-kernel -verboseThe emulator will take a few minutes to boot.
- You will NOT be able to register your emulated Nook with BN.com but you can sideload epub books by placing them in system/media/guides when you create your replacement system.img file mentioned in step 17.