Nook Firmware Improvements

Hi all,
here you can find the latest version of all my improvements to Nook firmware.
Mostly, they are related to feauters of EpubReader application, that i suppose is the most important one for an ebook reader as is the Nook.
Hope they could be useful to you!

Features:
  • ReaderEpub: usage of custom fonts for reading epub documents (on stock firmware you only have Amasis, Helvetica and Light Classic);
  • ReaderEpub: set the max depth of document TOC showed into "Go-To Chapter" menĂ¹ (on stock firmware it's locked to first level);
  • ReaderEpub: choose text orientation between portrait (defaul) or landscape;
  • ReaderEpub: choose to display (default) or hide the top status bar (i.e. the one displaying title, battery status and time);
  • General: choose a custom image that is showed when the Nook is turned off (on stock firmware the display is full white).

Warnings:
  • this procedure could only be used when your Nook firmware version is the original 1.5.0 by B&N or any derived firmware (like softroot firmware 2.5.1); applying this procedure when your firmware (you can check your firmware version on Settings page of your Nook) is a different one, will probably lead to your reader not working correctly anymore; 
  • applying this procedure you will void your warranty and you may even brick your Nook; i don't take any responsibility in the (unlikely) event something goes wrong while executing the below mentioned procedure;
  • i received some feedback from users that applying the following procedure could require re-registering Nook in case it was already registered; is it also possible that it will be necessary to re-download purchased books from B&N. Please be sure this is not a problem in your case.
Credits:
  • For both the orientation and full-screen (since v1.2) features, all credits go to user darkker of russian forum "The Electronic Book". I just merged the modification he made with my code (in order to keep also the other improvements i made). This is the original link in russian (and its translation to english) to the thread where you can find more info about his implementation of this feature and its author.

Prerequisites:
  • Nook with firmware 1.5.0 from B&N, and already rooted;
Download:
  • version 1.2.1 (sources);
  • SHA-1 hash: E8EF9664082683DCEB9582023C7BFDA81B923371;
  • SHA-1 hash (sources): F678C353D082C5F44F2620B83EFD10470911B15D;
  • quick upgrade from v1.2:
    • overwrite file ReaderEpub.apk;
    • alternatively, you can proceed with the full installation procedure described below.
  • changelog:
    • full-screen mode update: small bugfix (by darkker). 
  • version 1.2;
  • SHA-1 hash: 19A746AB6D6B693CA19F7800E848C75DA82E9694;
  • quick upgrade from v1.1:
    • overwrite files android.policy.jar and ReaderEpub.apk;
    • reboot; 
    • alternatively, you can proceed with the full installation procedure described below.
  • changelog:
    • full-screen mode update: now it's managed through reader menu;
    • full-screen and orientation setting persisted across reboots.
    • version 1.1;
    • SHA-1 hash: 9F2266EB451D6F6765205E4845D41B3E6B5EF399;
    • changelog:
      • orientation feature;
      • full-screen mode (hide top status-bar).
    • version 1.0;
    • SHA-1 hash: E8A160AF4624F3FC24E7928F45E7B976984C0489;
    • changelog:
      • initial version.
     Install:
    1. create a folder on you PC (let's call it C:\twllFolder), and then unpack the downloaded file on that folder;
    2. connect to your Nook through ADB (either over USB or Wi-Fi); if you don't know what this means, you can find more details here;
    3. (optional) make a backup of files on Nook we are going to modify (in case you want to rollback the applied modifications):
      adb pull /system/app/ReaderEpub.apk C:\twllFolder\original\
      adb pull /system/framework/android.policy.jar C:\twllFolder\original\
      adb pull /system/lib/libpdfhost.so C:\twllFolder\original\
    4.  copy files unpacked in step-1 into Nook:
      adb psuh C:\twllFolder\ReaderEpub.apk /system/app
      adb psuh C:\twllFolder\android.policy.jar /system/framework
      adb psuh C:\twllFolder\libpdfhost.so /system/lib
    5. reboot your Nook.
    Usage:
    • General: 
      • If you connect the Nook to PC after installation of hack, you should see that on internal Nook sd-card (i.e. the one that by default is called "Nook" in Windows explorer, and that contains folders "my documents", "my screensavers", "my wallpapers") a new folder has been created. It is called "settings". This folder contains the file "settings.ini", that is used to configure the behaviour of Twll features.
      • After any modification on "settings.ini", you should reboot your Nook for the changes to take effect.
      • In the file itself there is an explanation of the meaning of any parameter and its allowed values.
    • Set Custom Go-To depth:
      • verify that on "settings.ini" the value for "enable_font_hack" is true;
      • on "settings.ini", set the value for "max_chapter_level" to the desired level (1-10) and reboot the Nook;
      • please consider that the higher the chosen level, the higher the time the EpubReader will need to open the epub document, the first time, to complete the TOC indexing. In case of big documents with a complex TOC structure, it could take even more than 1 minute, in case max_chapter_level>=3. Anyway, this issue will just affect the first time the epub document in opened.
    • Set Custom Font:
      • verify that on "settings.ini" the value for "enable_font_hack" is true;
      • on internal Nook sd-card, create folder "my fonts" (lowercase);
      • inside folder "my fonts", create 3 sub-folders: font1, font2 and font3; you should now see, when Nook is attached to a PC through USB cable, something like this;
      • to use a custom font, just put the 4 font files (corresponding to the 4 supported font styles) into the relevant folder (either font1, font2 or font3); the name of the files should be:
        • normal.ttf: for plain font style;
        • bold.ttf: for bold font style;
        • italic.ttf: for italic font style;
        • bold_italic.ttf: for bold / italic font style;
      • moreover, you could also place in the same folder a file called <name of the font>.fontname : this way, the string <name of the font> will be displayed as the font name in the font-selection menu of ePub Reader application of Nook (in case this file is missing, the label "unknown font X" is used, being X equal respectively 1,2 or 3);
      • remarks:
        • use always ttf extension, even for otf fonts (that are also supported by Nook);
        • use always lowercase file name (except for <name of the font>, where you can use whatever you want);
        • apparently, some fonts are not supported by reader applications, for some unknown reasons; in that case, they are just ignored and the default font is instead used (i.e. Light Classic);
        • in case the font files are missing on any fontX folder (or the entire folder fontX is missing), the corresponding default font is used;
        • If you want, you can download here (sha1: 891bdf73cab87a17f4b2beb3a226c7b9d0aea9a4) a sample "my fonts" folder structure. In this example, font1 folder contains "Gentium" font; font2 and font 3 are empty so the default fonts "Helvetica Neue" and "Light Classic" are used
    • Set Custom Shutdown Image:
      • verify that on "settings.ini" the value for "enable_shutdown_image" is true;
      • put the image you want to use into folder "settings"; rename this image as "shutdown.<extension>";
      • png, gif, jpg format are supported;
      • any image size could be used (a resize mechanism is in place); but to get best result, it is better to use an image whose size is 600 x 800 pixel;
      • during shutdown procedure, the Nook will check if into folder "settings" there is a file called shutdown.raw (i.e. the shutdown image in Nook native format); if it's present (and is suitable), that file will be used as shutdown image.
        Otherwise, if an image called "shutdown.<jpg|gif|png>" exists, it will be converted into Nook native format (therefore shutdown.raw will be created) and it will be used as shutdown image.
        If no image is found, the default behaviour would be applied (i.e. white screen would be displayed).
      • If you don't want to use a shutdown image you can either:
        • remove any file called shutdown.* into folder "settings";
        • or,  on "settings.ini", set the value for "enable_shutdown_image" to false and reboot the Nook.
    • Set Full-Screen mode (hide top status bar):
      • on reader menu "Preferences", you have a new item "Full screen" where you can enable or disable full-screen mode;
      • the full screen mode hides both the top status bar and the progress bar located at the bottom of the screen;
      • this setting is persisted across reboots (since v1.2).
    • Set Text Orientation:
      • on reader menu "Preferences", you have a new item "Orientation" where you can choose portrait or landscape; default setting is portrait.
      • this setting is persisted across reboots (since v1.2).