Find Your Device:
Or Continue to Thread: [Q] Any way to remove the 512 …
29th January 2013, 08:12 PM |#2  
OP Member
Thanks Meter: 3
Thumbs up
I determined that the 512 character limit is hard coded into the Reader.apk app. I modified the app to increase the limit to 8192 characters (16 times as much) and have posted the details below.

Attached is the apk for the updated app. To install it, you must first uninstall the old reader.apk as this one is signed using a different key.

For those who wish to make the changes themselves, the following are the steps needed.

  1. Install the Nook framework file. This is needed to properly recompile the apk later.
    adb pull /system/framework/framework-res.apk
    apktool if framework-res.apk
  2. Copy the original Reader.apk file into the current directory.
    adb pull /system/app/Reader.apk
  3. Decompile the apk file using apktool
    apktool d Reader.apk
  4. Make the changes needed
    1. Modify the AndroidManifest.xml file. Remove the "sharedUserId" flag.
      • Change this
        HTML Code:
        <manifest android:sharedUserId="" android:versionCode="1" android:versionName="1.0" package=""
      • to this
        HTML Code:
        <manifest android:versionCode="1" android:versionName="1.0" package=""
    2. Modify the following files. Search for "0x200" and replace it with "0x2000" (ie add a zero; this will multiply max size by 16):
      • Reader/smali/com/bn/nook/reader/ui/AddNoteView$1.smali
      • Reader/smali/com/bn/nook/reader/commonui/ReaderCommonUIConstants.smali
    3. Modify the following file. Search for "512" and replace it with "8192" (the decimal equivalent of hex 0x2000)
      • Reader/res/layout/add_note_layout.xml
  5. Recompile the source code into a new apk.
    apktool b Reader ReaderUnsigned.apk
  6. Create a signing key; Skip this step if you have created one already. Note: keytool is located in the Android SDK->Tools folder.
    keytool -genkey -v keystore myAndroidKey.keystore -alias myAndroidKeyAlias -keyalg RSA -validity 10000
  7. Sign your new apk.
    jarsigner -verbose -keystore myAndroidKey.keystore ./ReaderUnsigned.apk myAndroidKeyAlias
  8. Use zipalign (also in sdk->tools) to align your apk.
    zipalign -v 4 ReaderUnsigned.apk ReaderSigned.apk
  9. Rename the system reader.apk file to uninstall/backup the apk.
    adb shell mv /system/app/Reader.apk /system/app/Reader.apk.bak
  10. Remove any entries of the previous Reader.apk signing key from the "/data/system/packages.xml" file.
    1. Pull the packages.xml file.
      adb pull /data/system/packages.xml
    2. Edit the packages.xml file. Search for "". Remove this entire tag:
      HTML Code:
      <package name="" ...>...</package>
    3. Push the packages.xml file back.
      adb push packages.xml /data/system/packages.xml
  11. Install your new app and enjoy the larger note sizes!
    adb install ReaderSigned.apk
Attached Files
File Type: apk ReaderSigned.apk - [Click for QR Code] (592.1 KB, 12 views)