Or Continue to Thread: [Q] Any way to remove the 512 …
Find Your Device:
29th January 2013, 07:12 PM   |  #2  
OP Member
Thanks Meter: 3
 
30 posts
Join Date:Joined: Jun 2011
More
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.

Pre-requisites
  1. Install the Nook framework file. This is needed to properly recompile the apk later.
    Code:
    adb pull /system/framework/framework-res.apk
    Code:
    apktool if framework-res.apk
  2. Copy the original Reader.apk file into the current directory.
    Code:
    adb pull /system/app/Reader.apk
  3. Decompile the apk file using apktool
    Code:
    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.media" android:versionCode="1" android:versionName="1.0" package="com.bn.nook.reader.activities"
          xmlns:android="http://schemas.android.com/apk/res/android">
      • to this
        HTML Code:
        <manifest android:versionCode="1" android:versionName="1.0" package="com.bn.nook.reader.activities"
          xmlns:android="http://schemas.android.com/apk/res/android">
    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.
    Code:
    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.
    Code:
    keytool -genkey -v keystore myAndroidKey.keystore -alias myAndroidKeyAlias -keyalg RSA -validity 10000
  7. Sign your new apk.
    Code:
    jarsigner -verbose -keystore myAndroidKey.keystore ./ReaderUnsigned.apk myAndroidKeyAlias
  8. Use zipalign (also in sdk->tools) to align your apk.
    Code:
    zipalign -v 4 ReaderUnsigned.apk ReaderSigned.apk
  9. Rename the system reader.apk file to uninstall/backup the apk.
    Code:
    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.
      Code:
      adb pull /data/system/packages.xml
    2. Edit the packages.xml file. Search for "com.bn.nook.reader". Remove this entire tag:
      HTML Code:
      <package name="com.bn.nook.reader" ...>...</package>
    3. Push the packages.xml file back.
      Code:
      adb push packages.xml /data/system/packages.xml
  11. Install your new app and enjoy the larger note sizes!
    Code:
    adb install ReaderSigned.apk
Attached Files
File Type: apk ReaderSigned.apk - [Click for QR Code] (592.1 KB, 6 views)