[Q] Change default fonts of N2E - Nook Touch General

Hi everyone
I am a fan of Nook ST, however, the biggest problem with this cute reader is that It does not use Unicode Font. Hence, I cant read ebooks in my maternal language ( Vietnamese). Does any one know how to replace those default fonts with unicode fonts ( Of window) . I dont want to root my Nook because I just use it for reading
Thanks in advance

You can find some helpful info/pointers at the following links:
http://phanquochuy.me/?p=114
http://nookdevs.com/Font_Changes
http://bookclubs.barnesandnoble.com...n-t-display-Vietnamese-characters/td-p/494819
http://www.mobileread.com/forums/showthread.php?t=178623

Usually the route to supporting unsupported character sets is to use the fallback font, DroidSansFallback.ttf
You might try a font from a newer version of Android or replacing it with some big font.
Since I don't know Vietnamese, I don't know exactly what chars you are looking for.
Are your books in Vietnamese using pre-compiled chars, that is a single char for glyph and accent?

There are reasonably wide choices of fonts that can render the (modern) vietnamese character set (subset of latin alphabet with diacritical marks on vowels, plus one modified consonant), unfortunately none of them is in the stock Nook's font set, and the OP does not want to root his/her NST. Embedding font in the epubs is a pain, even with the referenced plug-in for Calibre.

Well, they may not want to root their Nook, but there is rooting and rooting.
If they slap Clockwork Mod Recovery on an SD card they can remount system, replace DroidSansFallback.ttf and reboot.
No harm done and no one the wiser.

Renate NST said:
Usually the route to supporting unsupported character sets is to use the fallback font, DroidSansFallback.ttf
...
Click to expand...
Click to collapse
I took a peek at /system/fonts: DroidSansFallback.ttf is there but it does not show up in the font menu of the stock Reader. To get it in one would have to muck with the Reader's apk content.

DroidSansFallback.ttf is the fallback font.
You never specify it.
When you punch up a website in Hindi and your regular font does not support Hindi letters, the system tries the fallback font.
There is a lot of stuff in DroidSansFallback.ttf, but not everything.
On my desktop, for instance, Arial Unicode MS is the biggest font that I have.
It has pretty comprehensive support for many languages.
The Android 2.1 DroidSansFallback.ttf is 3,081,908 bytes.
The Android 4.0 DroidSansFallback.ttf is 5,300,184 bytes.
Arial Unicode MS is 24,172,892 bytes!

thank digimax for such useful advice. I knew how to embed font into epub however it will be a bit trouble everytime i want to read a new book
I have an idea when I follow given links, especially Font_Changes of Nookdevs. If we modify the reader app in backup nook (.img) or in update files from B&N(.zip) then restore to device, will it work ?

ectacy said:
thank digimax for such useful advice. I knew how to embed font into epub however it will be a bit trouble everytime i want to read a new book
I have an idea when I follow given links, especially Font_Changes of Nookdevs. If we modify the reader app in backup nook (.img) or in update files from B&N(.zip) then restore to device, will it work ?
Click to expand...
Click to collapse
Your idea might work but it seems a bit "heavy-handed", I personally would explore and opt for a more surgical approach along the line @Renate posted above: e.g., use SD CWM to get the file-system mounted as writable then <adb push> the modified reader apk over.
BTW, what are some good sources of good Vietnamese books in epub formats?

digixmax said:
Your idea might work but it seems a bit "heavy-handed", I personally would explore and opt for a more surgical approach along the line @Renate posted above: e.g., use SD CWM to get the file-system mounted as writable then <adb push> the modified reader apk over.
BTW, what are some good sources of good Vietnamese books in epub formats?
Click to expand...
Click to collapse
Here I attach an Vietnamese epub file, you can take it as sample for "nook surgery" ( I dont know which epub is good source of format, hence i picked one which is not converted by Calibre ) . I am newbie in Android, so much thing to explore and learn ADB seems a complicated tool :silly:

I took a peek at Reader.apk (extracted from FW v1.1.2 I currently use): opening and hacking it up is more work than what I would invest into an exercise I thought of doing just for kick.
If you think stuffs like ADB is complicated, I'd suggest the path I had taken: root your NST and get free Mantano Reader from the Google Play store (it opens and displays just fine the Tuyet Son Phi Ho epub you posted above).

digixmax said:
I took a peek at Reader.apk (extracted from FW v1.1.2 I currently use): opening and hacking it up is more work than what I would invest into an exercise I thought of doing just for kick.
If you think stuffs like ADB is complicated, I'd suggest the path I had taken: root your NST and get free Mantano Reader from the Google Play store (it opens and displays just fine the Tuyet Son Phi Ho epub you posted above).
Click to expand...
Click to collapse
thank you I will consider your advice about rooting and matano . Another solution is to sell my nook and get a kindle , no more epub, no more font ... just prc, just read.

In point of fact, the Reader doesn't handle fallback correctly.
You can get your font to work a number of ways.
The easiest is to substitute one of the fonts like Trebuchet.
Copy arialuni.ttf (Arial Unicode MS) from somewhere to DroidSansFallback.ttf
Create a few links so that bold and italics will work.
Connect with ADB shell:
Code:
mount -o rw,remount /dev/block/mmcblk0p5 /system
cd system/fonts
mv Trebuchet.ttf Trebuchet.bak
mv Trebuchet-Bold.ttf Trebuchet-Bold.bak
mv Trebuchet-BoldItalic.ttf Trebuchet-BoldItalic.bak
mv Trebuchet-Italic.ttf Trebuchet-Italic.bak
Push with ADB:
Code:
adb push arialuni.ttf /system/fonts/DroidSansFallback.ttf
Back to ADB shell:
Code:
cd system/fonts
ln DroidSansFallback.ttf Trebuchet.ttf
ln DroidSansFallback.ttf Trebuchet-Bold.ttf
ln DroidSansFallback.ttf Trebuchet-BoldItalic.ttf
ln DroidSansFallback.ttf Trebuchet-Italic.ttf
Open the book up and select "Trebuchet" as the font.
Here's the first page:

Renate NST said:
In point of fact, the Reader doesn't handle fallback correctly.
You can get your font to work a number of ways.
The easiest is to substitute one of the fonts like Trebuchet.
Copy arialuni.ttf (Arial Unicode MS) from somewhere to DroidSansFallback.ttf
Create a few links so that bold and italics will work.
Connect with ADB shell:
Code:
mount -o rw,remount /dev/block/mmcblk0p5 /system
cd system/fonts
mv Trebuchet.ttf Trebuchet.bak
mv Trebuchet-Bold.ttf Trebuchet-Bold.bak
mv Trebuchet-BoldItalic.ttf Trebuchet-BoldItalic.bak
mv Trebuchet-Italic.ttf Trebuchet-Italic.bak
Push with ADB:
Code:
adb push arialuni.ttf /system/fonts/DroidSansFallback.ttf
Back to ADB shell:
Code:
cd system/fonts
ln DroidSansFallback.ttf Trebuchet.ttf
ln DroidSansFallback.ttf Trebuchet-Bold.ttf
ln DroidSansFallback.ttf Trebuchet-BoldItalic.ttf
ln DroidSansFallback.ttf Trebuchet-Italic.ttf
Open the book up and select "Trebuchet" as the font.
Here's the first page:
Click to expand...
Click to collapse
Do I need to root my Nook touch to connect it with ADB ?

thank Renate NST for your help :-? I think Swapping default reader and modified reader can be done without rooting I am reading your topic about modifying APK . It could be hard but I wont give up

ectacy said:
I think Swapping default reader and modified reader can be done ...
Click to expand...
Click to collapse
This is not about swapping Reader.apk (or ReaderRMSDK.apk).
This is just about swapping fonts for one that support Vietnamese characters.
It doesn't involve changing anything in the boot partition.
Yes, to change anything in the system partition you must have root access somehow for as long as it takes to make the changes.
You have to put something on a SD card and boot up on that.
Your choices are:
Use one of the handy-dandy rooter tools that people post
Use Clockwork Mod Recovery that will directly allow you to use ADB
Use noogie and a Linux system to access the /system partition directly

I have found a way to accomplish this with minimal work on the Nook itself.
A little background. I like using the Caecilia font, but it really bugs me that I can't tell the difference between "normal" and "bold" text because for the latest version of Caecilia installed on the nook the weights of "normal" and "bold" are nearly identical. So I went looking for a way to fix that. Here is what I came with. It should work for any font you want to replace.
1) Obtain a copy of the font you want to use, in my case Lexia DaMa.
2) Obtain a copy of Type Light 3.2.
3) Using some temporary or permanent rooting method, copy the font you want to replace from the /system/fonts directory on your nook using adb pull.
4) Open the font file pulled from your nook in Type light 3.2 and note the name of the font stored INTERNALLY in the file.
5) Open the font you want to use in Type light 3.2 and rename it to match the font you are replacing.
6) Using adb push, copy your replacement font over the EXACT file names for the original font on your nook.
7) Reboot your nook.
7) Use your "new" font by selecting the name of the font you replaced.
You do not need to permanently root your device for this method to work and in does not involved creating links which a non-techie can easily mess up. You can do all of the font files for a particular font, or only the regular font file, depending on your purpose. For the OP's purpose, all of the font files should be done. For my purpose, I only did the "regular" file as Lexia DaMa and Caecilia are very close and the Caecilia BOLD, ITALIC, and BOLDITALIC work just fine for me. You should make a backup copy of the original font files from your nook either on or off the device in case you ever want to switch back.
If anyone is interested, I can post a more detailed (including actual commands) description of this method.

Links aren't that complicated.
In any case, the purpose of the links is to:
Insure that foreign language titles appear correctly in indexes.
Avoid the 4 times duplication of a 24 Meg font file!

David0226 said:
I have found a way to accomplish this with minimal work on the Nook itself.
A little background. I like using the Caecilia font, but it really bugs me that I can't tell the difference between "normal" and "bold" text because for the latest version of Caecilia installed on the nook the weights of "normal" and "bold" are nearly identical. So I went looking for a way to fix that. Here is what I came with. It should work for any font you want to replace.
1) Obtain a copy of the font you want to use, in my case Lexia DaMa.
2) Obtain a copy of Type Light 3.2.
3) Using some temporary or permanent rooting method, copy the font you want to replace from the /system/fonts directory on your nook using adb pull.
4) Open the font file pulled from your nook in Type light 3.2 and note the name of the font stored INTERNALLY in the file.
5) Open the font you want to use in Type light 3.2 and rename it to match the font you are replacing.
6) Using adb push, copy your replacement font over the EXACT file names for the original font on your nook.
7) Reboot your nook.
7) Use your "new" font by selecting the name of the font you replaced.
You do not need to permanently root your device for this method to work and in does not involved creating links which a non-techie can easily mess up. You can do all of the font files for a particular font, or only the regular font file, depending on your purpose. For the OP's purpose, all of the font files should be done. For my purpose, I only did the "regular" file as Lexia DaMa and Caecilia are very close and the Caecilia BOLD, ITALIC, and BOLDITALIC work just fine for me. You should make a backup copy of the original font files from your nook either on or off the device in case you ever want to switch back.
If anyone is interested, I can post a more detailed (including actual commands) description of this method.
Click to expand...
Click to collapse
Your solution seems understandable for me @@ I am buried in a jumble of ADB, CWM, Shell,... :cyclops:

Renate NST said:
This is not about swapping Reader.apk (or ReaderRMSDK.apk).
This is just about swapping fonts for one that support Vietnamese characters.
It doesn't involve changing anything in the boot partition.
Yes, to change anything in the system partition you must have root access somehow for as long as it takes to make the changes.
You have to put something on a SD card and boot up on that.
Your choices are:
Use one of the handy-dandy rooter tools that people post
Use Clockwork Mod Recovery that will directly allow you to use ADB
Use noogie and a Linux system to access the /system partition directly
Click to expand...
Click to collapse
Can you give me detail instruction on this solution. I am having noogie and a CD of Ubuntu. Are they enough to follow this method :victory:

Related

[Q] Easiest way to access /system/fonts on Windows?

Hi, all
I'm looking for a way to access /system/fonts from Windows computer so that people can change fonts for foreign language support. I know with a combination of noogie.img and linux computer, it is a piece of cake. But some people are scared to hear linux and I'm trying to guide them to work on Windows computer. Does CWM has those functions or is there any good windows application mounting linux partitions? Thanks a lot~
You can create a update.zip (for cwm) that copies the files to the system partition, so you don't have to mount the partition in windows.
mali100 said:
You can create a update.zip (for cwm) that copies the files to the system partition, so you don't have to mount the partition in windows.
Click to expand...
Click to collapse
That is awesome. Can you guide me how to write update.zip? I need following functions. Can you tell me those are doable?
1. update.zip can contain fonts
2. Delete specific system fonts
3. Copy user-specified fonts to /system/fonts
4. set permissions
Thanks a lot~
herofmm said:
That is awesome. Can you guide me how to write update.zip? I need following functions. Can you tell me those are doable?
1. update.zip can contain fonts
2. Delete specific system fonts
3. Copy user-specified fonts to /system/fonts
4. set permissions
Thanks a lot~
Click to expand...
Click to collapse
Yes, this is all doable. Take one of eded333's update.zips ( https://www.dropbox.com/s/errgjzp1a6ci09x/XU/XUFullTouch-PART-1-START.zip ) as base. Just change the updater script to your needs.
Android commander and adb -just need to remount the directory as rw.
Seems simpler than writing an SD card.

Screensave while in landscape mode

If you use applications in landscape mode, you may have noticed this already.
When your Nook sleeps or is sent to sleep your normal portrait screensaver appears rotated, squished and with black borders.
Clearly, the Nook developers never anticipated that people would be using landscape mode.
I have a mod to /system/framework/services.jar to fix this.
If the graphic is either 600 x 800 or 800 x 600 it will put it in the orientation that fits.
If the graphic is 800 x 800 it will put it in the current orientation, centered at a scale of 1:1.
Since a lot of people seem to use a moded system.jar already it would have to be integrated in.
Is there interest in this?
I am very interested!!
Can u share your mod?
Well, with all the modded services.jar and various updates maybe posting the injected smali code?
Or is that too difficult/annoying?
sounds great! but still I would prefer no-screen-saver mod. i.e. you can see you launcher widgets (calendar, task, time, battery) all the time. These s.s. pictures are quite antiproductive.
Renate NST . we are waiting !
Ok, here goes. My apologies if this is complicated.
I didn't want to distribute B&N code or presume what mods where already in your services.jar
Code:
adb pull /system/framework/services.jar
apktool d services.jar \Services
Edit \Services\smali\com\android\server\PowerManagerService.smali
parta.txt replaces 3 lines in the original that have to do with parse / move / setImageURI
Delete those lines and insert the file where the .line statements match.
You can leave both the comments in parta.txt and the .line statements there.
partb.txt gets inserted at the end of the file.
Code:
apktool b \Services services.jar
adb push services.jar /system/framework/
You probably want to clear the cache and reboot at that point.
Note: If you are using the standard slide unlock, the image placement code for that is in android.policy.jar
That defaults to portrait orientation. It is not affected by this mod.
Please tell me if this works for you.
This is a nice idea. However, when you use book cover as screensaver via Cool Reader most of them aren't 800x600 images. The B&N default behavior is to resize to fit the screen (keep aspect ratio), but with your mod the picture appears at 1:1 scale (normally cropped). Would this be an easy fix?
marspeople said:
Would this be an easy fix?
Click to expand...
Click to collapse
Tomorrow.
It's tomorrow.
I hope that I covered all the cases because more variants will require user configuration somewhere.
If the image is 600 x 800, 800 x 600 or an aspect ratio of 3:4 or 4:3 it will fit exactly.
If the image has another aspect ratio it will fit inside with side strips in white.
If the image is exactly square it will use the current orientation and overfill the screen.
In all cases the aspect ratio will be preserved and at least one axis will fit exactly.
When the lock screen with the slider pops up the image will not be consistent.
This is because B&N handled the screensaver image there separately.
I will be releasing a mod for android.policy.jar to fix that soon.
(Or you could switch to another screen locker.)
Install procedure same as above.
Ok, here's the one that fixes the lock screen too.
parta.txt and partb.txt are the same as they were.
partc.txt and partd.txt are for LockScreen inside android.policy.jar
Code:
adb pull /system/framework/android.policy.jar
apktool d android.policy.jar \Policy
Edit \Policy\smali\com\android\internal\policy\impl\LockScreen.smali
partc.txt replaces the entire updateBackgroundImage method.
partd.txt gets inserted at the end of the file.
Code:
apktool b \Policy android.policy.jar
adb push android.policy.jar /system/framework/
As always, be careful and backup.
(This is also in the readme file.)
Warning: This is only for Nook 1.12 and older, not for Nook 1.2 and newer.
Oh, and if you're tired of dragging to unlock your NOOK™,
place the extracted files in /res/drawable-mdpi/ inside /system/framework/framework-res.apk
Just to be clear, this doesn't change the manner of unlocking, just the look.
(The folks at B&N made the graphics shorter by making the top 30 pixels transparent.
That was an unnecessary hack, as long as all four graphics are the same height it works fine.)
signing / alternative to adb push
Renate,
thank you for the mods. The rotated screensaver has been irritating me for some time ;-) And I intend to put my email instead of the "slide to unlock" text..
Just 2 questions, before I do so:
1) do I need to sign the modified .jar/.apk files?
2) As I do not have ADB installed, I intend to change the files from a command line over ssh (i.e. copy, chown, chmod). My understanding is that this should be equivalend to adb push. Is this so?
Cheers
ajislav said:
1) do I need to sign the modified .jar/.apk files?
Click to expand...
Click to collapse
"Badges? Badges? We don't need no stinkin' badges."
No, if you copy in anything directly you bypass all the signing stuff.
How you get the files over is however you like.
Bootloop
Hi,
I tried to do both changes (screensaver, slider) but since the recompilation of services.jar and android.policy.jar was giving me errors (see below), I decided to go with replacing framework-res.apk
what I did was
ssh into my nook
Code:
cd /system/framework/
mount -o remount,rw /dev/block/mmcblk0p5 /system
#copy the new framework into target dir
cp /sdcard/download/framework-res.apk ./framework-res.apk.new
#fix permissions
chmod 644 framework-res.apk.new
#make a backup
cp framework-res.apk framework-res.apk.old
#replace the file
cp framework-res.apk.new framework-res.apk
now at that moment I got the bootloop screen.. however ssh was still working, so I run the following line to restore the framework:
Code:
cp framework-res.apk.old framework-res.apk
and rebooted.. I am getting bootloops ever since..
I can boot to CWM. so I tried both what I should have done in the first place, i.e. replace the file in CWM
I tried this
http://forum.xda-developers.com/showpost.php?p=24728342&postcount=22
(fixes permissions)
and this
http://forum.xda-developers.com/showpost.php?p=23607664&postcount=11
(restores the old framework and fixes permissions)
but none seem to work... still the same bootloop (nook by B&N and 5 dots going from Left to Right)..
any ideas? I'd rather not go all the way to factory restore
p.s. I also tried wiping cache and dalvik-cache in CWM.. could this cause any problems?
p.p.s. the errors I got with recompiling the jars are:
Code:
>apktool b .\Services2 services.jar
I: Checking whether sources has changed...
W: Could not find resources
I: Building apk file...
is the "Could not find resources" normal?
Let's take the easy one first.
Compiling the jars will return "No resources found", because they are just jars.
You should always check to make sure that the output is about the same size as the original.
It may be a bit bigger or smaller depending on the vagaries of compression.
Now the toughie.
Hot-swapping jars is a bit risky.
In the best of all worlds, you'd like to swap them when they are not being used.
Swapping framework-res.apk could make it crash when something can't find a resource,
but it's not code and generally if you leave the Nook sitting it won't try to access anything.
If all you did was replace one file and now you replaced it back it should be working.
I don't know how you are getting a ssh into the Nook.
I've got no port 22 or 23 open.
Hi Renate,
Compiling the jars will return "No resources found", because they are just jars.
You should always check to make sure that the output is about the same size as the original.
It may be a bit bigger or smaller depending on the vagaries of compression.
Click to expand...
Click to collapse
I did this, of course. The files are generally sightly smaller, in the case of framework-res.apk the change is relatively big: from 2,897,726 to 2,381,970 (but I am not worried about this as I get a similar size decrease even during simple decompile/recompile)
Swapping framework-res.apk could make it crash when something can't find a resource,
but it's not code and generally if you leave the Nook sitting it won't try to access anything.
If all you did was replace one file and now you replaced it back it should be working.
Click to expand...
Click to collapse
I know, and I totally agree with you!
My conclusion is that something got corrupted..
I tried removing the apk.old and apk.new files via CWM (to make sure they are not in the way)
I also tried running e2fsck -p /dev/block/mmcblk0p5 via CMW (from http://forum.xda-developers.com/showpost.php?p=21915065&postcount=59 )
.. but still the same bootloop.
Is there any way to see some logs of the failed boots?
Since I did not make a backup just before doing this change (and I know you had adviced to do so ), the only thing which I can think of now is
a) create a backup with noogie
b) mount the image and check what is actually in /system
unfortunately, I do not have access to linux so this would be kind of pain (my old laptop with WinXPSP3 is the main reason, why I dont have ADB..)
And I am not sure if this is not more complicated than reinstalling everything from scratch..
Thanks for your help, I'll probably give it a day's rest and then do the factory reset..
I don't know how you are getting a ssh into the Nook.
I've got no port 22 or 23 open.
Click to expand...
Click to collapse
I have droidSSHd installed and am able to connect easily with Putty.
Have you already tried to look at dmesg? logcat?
I am not sure how to do this (dmesg, logcat)
I was probably unclear about the ssh - I WAS able to ssh in when Nook was booting normally. Now I cannot.
Is there any way to do this from CWM? (I mean dmesg, logcat)
I was wondering how you were in a boot loop and managed to ssh.
Code:
# dmesg
.....
# logcat
.....
If you don't have a shell this is not going to do you any good.
I used noogie to get an img which I then mounted (using OSFMount and Ext2IFS) under windows..
looking at the /system partition, I see that
- my .old and .new files are gone
- the correct framework-res.apk is in place
i.e. the CWM scripts I have run did their job correctly.. so they have effectively undone any changes that I have made.. so the nook should boot up without any problems
weird....
so I guess my only options are
- restore my pre-root backup
- factory reset

Adding Fonts To Unrooted Nook

I've got an old Nook Simple Touch that I never use and I thought I'd regift it to this kid I know and add a bunch of cool books to it. As he's not my kid I didn't want to register it or root it with my own Google account or anything, so I'm a little limited in what I can do.
Getting it to work without registering it wasn't difficult and I've loaded books onto it.
But the thing is he's got Dyslexia and ADHD so as much as he likes reading it is really difficult for him and he struggles with finishing books on his own. So I thought I'd go ahead and put OpenDyslexic on there as he's had a lot of success with this font before.
As I understand it my options are:
1. Embedding the font in the ePubs already on the Nook. Solid for now, but if he decides to buy books or add books himself (he's twelve) he's SoL.
2. Rooting it and setting it up as a tablet and somehow adding the fonts (I'm not super clear on this course).
Anyone have suggestions/ideas?
clairecakes said:
I've got an old Nook Simple Touch that I never use and I thought I'd regift it to this kid I know and add a bunch of cool books to it. As he's not my kid I didn't want to register it or root it with my own Google account or anything, so I'm a little limited in what I can do.
Getting it to work without registering it wasn't difficult and I've loaded books onto it.
But the thing is he's got Dyslexia and ADHD so as much as he likes reading it is really difficult for him and he struggles with finishing books on his own. So I thought I'd go ahead and put OpenDyslexic on there as he's had a lot of success with this font before.
As I understand it my options are:
1. Embedding the font in the ePubs already on the Nook. Solid for now, but if he decides to buy books or add books himself (he's twelve) he's SoL.
2. Rooting it and setting it up as a tablet and somehow adding the fonts (I'm not super clear on this course).
Anyone have suggestions/ideas?
Click to expand...
Click to collapse
Perhaps boot from one of the ADB enabled images and use that to replace one of the default fonts? as long as the font is in the same format and named the same in the same location it should hypothetically work. I haven't personally tried it so I cannot actually vouch for it, but it sounds like it should.
==EDIT== Does indeed work as I said. Took a while to figure out how to do it, some steps I list may not be necessary. Standard disclaimer, I am not responsible if you brick the device, warranty is void, etc.
Write the NookManager image to a microsd card and boot using that.
Enable wireless (I believe this requires you to have set up your network on the device previously) enable adb.
(I would continue and make a backup here in case it doesn't work for you)
use adb to connect to the device (adb connect $displayed_IP) (this of course assumes you have adb set up on your computer)
adb shell
mount -t ext2 /dev/block/mmcblk0p5 /system
== exit the shell
After that you should just need to adb push the regular, bold, bold italic, and italic versions to /system/fonts/(one of the defaults)-[weight].ttf (using the ttf versions, names of the weights match the version I downloaded except regular where it was just fontname.ttf on the nook)
ex: adb push /path/to/OpenDyslexic-Regular.ttf /system/fonts/Caecilia.ttf
To remount the system directory r/w I've always used:
Code:
mount -o rw,remount /dev/block/mmcblk0p5 /system
Yeah, there are probably easier ways than what I said. Eventually found scripts for NookManager on Github and used a modified version (just changing the mount point) of one of the ones on there. Come to think of it if that was the official github or anything there's probably a way to trigger that script on device that could be easier than what I said

those invisible menu options

There is an interesting discussion on the Russian forum the-ebook.org (paste this link into Google and select the translation; item is on page 2) regarding those annoying invisible menu options in many apps. Although the translation is a little rough around the edges, the gist seems to be that the default text and background colors for the app menus are not exactly what the e-ink display has in mind, often resulting in light or near-white text on a white background--hence, invisible text.
The "solution" used is to change some background color settings in framework-res.apk. I have no idea what the outcome looks like but it seems like a really good idea, although beyond my abilities, and the example used is 1.10 firmware. I'm using 1.21. Any attempt I have made to modify apk files has always failed
Does anyone have a fool-proof set of steps for doing this?
I remember reading about what you're talking about somewhere on the forums but I could never get it to work either...
Here's what I'm talking about:
http://forum.xda-developers.com/showthread.php?t=1356514
http://forum.xda-developers.com/showthread.php?t=1512846
OK, well.....I've got the adjusted background images extracted from the framework-res.apk file that I got from the Russian site (I'm working with the lighter background option at this point). And...I've found the setting in WinRar to simply "store" (not compress) the updated png files. So far, so good. My altered apk file is the same size as the original.
The clincher is to get it back on the Nook without disaster ensuing. I'm going to follow Renate's method for pushing back framework-res.apk via ABD (from this thread):
C:\>adb shell
# stop
# mount -o rw,remount /dev/block/mmcblk0p5 /system
# ^C
C:\>adb push framework-res.apk /system/framework
C:\>adb shell
# reboot
Keep your fingers crossed. If it works, I'll report back with step-by-step and files.
[Report: in concept this "works". On reboot I could see the slightly grey background color in menu options and going to a few apps where I knew the menus were invisible, I could see white text on the slightly grey background. BUT...almost no apps will work. The B&N side seems to function OK, but the App drawer is useless. Back to the drawing board. The Russian site has a method for installation using RootExplorer. I'll try that next.]
OK...day 2. Here's what does NOT work:
1. method in post above using ADB
2. method using RootBorwser as adapted from Russian site and detailed below:
a. Change permissions in /system, /system/etc and /system/framework folders so that all users have write access
(note this is my kludge to get around not knowing how to "mount" the /system partition as r/w--maybe it's wrong?)
b. Use ADB wireless to move modified framework-res.apk into /system/etc
c. Use RootBrowser to check ownership of modified framework-res.apk (should be and was already owner: 0-root, group: 0-root)
d. Use RootBrowser to change permissions on modified framework-res.apk to rw-r--r-- (664)
e. Use RootBrowser to move (cut/paste) modified framework-res.apk into /system/framework (overwrite)
With Superuser permission, this all went off without a hitch.
f. Use RootBrowser to reset permissions of folders listed in (a)
g.Shut down Nook and restart.
The result is the same as the ADB-only method described before. The Nook starts up just fine. You can see that the background color of menus is slightly gray. Those changes have obviously worked. But the vast majority of apps will not run (ADW Launcher is an exception). At one point while I was fiddling with things the Nook spontaneously rebooted.
I guess that's better than spontaneously combusting
SIGH. Clearly, despite my best efforts, something I did in handling the framework-res.apk has damaged it in some subtle way, OR, my inability to properly "remount" the /system as R/W is causing the problem, although using ADB this is accomplished without difficulty and since the result is the same...it must be the modified apk file.
And this is why I have a dedicated SD card backup......
Method 3 that does NOT work:
1. Install Ninjamorph and BusyBox from Market
2. Follow instructions for altering framework-res.apk found here.
Two ways to Finish Project, with zip-align and without. Both yield the same result which is the same as the other methods above, i.e., the B&N stuff mostly works and the desired contrast of the menus is achieved so you can actually see what used to be invisible, but most apps will not run. Really frustrating.
I have to say that while this method seemed promising it is tedious in the extreme as each of the 28 png files must be replaced individually and that means each must be located in a much larger list (which reverts to the top after each replacement....). Ugh.
I simply don't believe anyone who says they can make these modifications with the instructions they have provided. It must be that people who are more familiar with this stuff are leaving out information which is so obvious to them that they don't even think to mention it
framework-res.apk is an apk and therefore it must be signed.
It's a system apk so it must be signed with the system signature.
Modifying a few things doesn't annoy the signature matching, other stuff does.
When you have problems, please quote from logcat because that tells you exactly what the problem is.
Using ADB:
Code:
logcat
Whatever.9.png are special files.
The are usually created thusly:
http://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch
When they get packed into an apk they are turned into a PNG graphic with alpha channel.
aapt handles this.
If you take a PNG with sidebars and just zip it, it will not work.
Renate NST said:
When you have problems, please quote from logcat because that tells you exactly what the problem is.
Using ADB:
Code:
logcat
Whatever.9.png are special files.
The are usually created thusly:
http://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch
When they get packed into an apk they are turned into a PNG graphic with alpha channel.
aapt handles this.
If you take a PNG with sidebars and just zip it, it will not work.
Click to expand...
Click to collapse
I just tried again and this time after pushing the amended framework-res.apk file (yes, all 28 amendations are nine-patch files) I typed in logcat before rebooting.
Whoosh!!! Lines of information went streaming by faster than I could follow, so much that some of the earliest disappeared from the top of the console window. I have no clue how to extract the text from the console window
The top-most complaint I saw was a reference to system error 1248 in association with the CleanMaster app. Then there seems to be a periodic (15 second) dhcpcd renewal. Eventually there is a section that says "Framework disconnected, eof, failed to read size, closing connection". Then comes a long list of notifications from the Service Manager about all the services that have just died. After that it just continues with the 15-second dhcpcd renewal cycle. Then I gave up and rebooted.
The result is the same as before. The new image backgrounds have been incorporated into the system, but most of the app drawer is just pretty icons. ADW runs--at least the drawer and home page appear. The B&N Home and Library pages load but you can't access any of the books shown. Wi-Fi can be accessed but no apps that use it will run. Occasionally the CleanMaster app throws up an error message.
Here's what I've learned so far:
1. In the original amended framework-res.apk file (for FW 1.10) viewing the archive reveals that the files which have been changed all have an "archive " attribute. None of the original files show any attribute. I don't know whether that is important. I've searched on this topic and have come up with nothing.
2. In moving the amended *.9.png files from the original Russian example for FW 1.10 into a copy of my own framework-res.apk for FW 1.21, those "archive" attributes came along for the ride and the resulting amended file does show "STORE" for the method so I think I got that part right and didn't recompress any files when moving from one apk to another (I dragged the files from one instance of WinRAR to another--I tried 7zip as well...).
But I have no idea why people report that this procedure works just fine. For me, it is predictable, but not successful.
I've just completed yet another restore from backup. I'm going to uninstall CleanMaster and try again. Perhaps it's background activities are driving the process into the ground. I have no clue.
Here's the logcat session file (learned how to get that done!) after a re-try, having removed CleanMaster first.
No change in the outcome but no bleating from the Nook about CleanMaster errors.
I wonder--is it the modified apk that is causing the system to malfunction, or....is it the way it is being pushed back to the Nook?
So..an experiment: I pulled a copy of the stock framework-res.apk from my Nook. I didn't do anything to it at all. Then I pushed it back to the Nook via wireless ABD:
C:\>adb shell
# stop
# mount -o rw,remount /dev/block/mmcblk0p5 /system
# ^C
C:\>adb push framework-res.apk /system/framework
C:\>adb shell
# reboot
This is supposed to work, yes? It does not. It leaves me in the same condition that all of the other attempts by this and other methods have. The Nook boots normally and displays Home but you can't access the "currently reading" book. I can get to the app drawer via the quicknav buttons, but very few apps will work (including ADB). There is no way to examine the file system because RootBrowser will not work (although ES File Explorer does, but it doesn't have root access).
So....whether the modified apk is OK or not, I would never know because all of the methods I have tried to get the framework-res.apk back onto the Nook have been unsuccessful.
That procedure should work fine.
Have you checked using the stock framework-res.apk ?
Renate NST said:
That procedure should work fine.
Have you checked using the stock framework-res.apk ?
Click to expand...
Click to collapse
Yes, that's what I just tried. Just pulled it via ADB and then pushed it right back. I also installed a copy of Root Explorer (I generally used Root Browser) because that's what was used in the original thread on the Russian site where I got started with the whole project. That also yields the same results. The Home screen loads but you can't access the book currently being read from it or from the little button at the top left. You can access any of the QuickNav options. The Library "functions". But you can't access books from their covers and the double-tap does not work.
In the app drawer, ADW seems to work fine but you can only run a very few apps, and none that require wi-fi (although wi-fi works). Too much fiddling around and the Nook spontaneously reboots.
When I have tried to move in the modified apk with the slightly gray background 9.png files I can see that the new image backgrounds have been used in the drop-down menus. This suggests to me that the problem is not in how the 9.png files have been moved from the FW1.10 apk obtained from the Russian site into my FW1.21 apk but rather in the integration of the modified apk into the system. I've checked permissions, etc. Everything is OK but the system is just screwed up.
I'm running FW1.21 which has been rooted using Nook Manager with Gapps added. I've done the multi-touch modification and have swapped in a modified internal.db file which seems to have solved the confusion of the "reading now" button. I have some apps that run along in the background, like Tasker and Clean Master (probably others that I don't realize). Do I need a completely clean system to make this change?
I saw the logcat and it showed that it's unhappy and killing the Android.
I couldn't see exactly where the problem is.
I think that you are doing too many things at once.
If there are specific things that do not work, a logcat when you do that should show.
Renate NST said:
I saw the logcat and it showed that it's unhappy and killing the Android.
I couldn't see exactly where the problem is.
I think that you are doing too many things at once.
If there are specific things that do not work, a logcat when you do that should show.
Click to expand...
Click to collapse
Yes, I was probably a little unclear. The ONLY thing that I did when I produced the logcat was attempt to push the modified framework-res.apk file back to the Nook. All those other things mentioned have long ago been successfully accomplished and included in my current backup (which I've had to use dozens of time in the last week or two as I struggle with this framework issue).
The ONLY change to the stock framework-res.apk is the overwriting of 28 *.9.png images with ones copied from another framework-res.apk which, unfortunately, is from FW1.10 (or I'd just use it "as is" without the copying). However, even pushing back an unmodified stock apk results in the same mess.
Like I say, based on what functionality remains when the modified apk file is pushed over, it is clear that the new images are being used, but the system function is severely degraded.
I don't know much about the process, but from what I've read I'm wondering if it would be better to use a zip via CM to deliver this modified file? That way the Android system is not even running (right?) during the replacement procedure.
When you say "stop" Android is no longer running.
Try clearing the cache:
Code:
rm -R /data/dalvik-cache/*
Renate NST said:
When you say "stop" Android is no longer running.
Try clearing the cache:
Code:
rm -R /data/dalvik-cache/*
Click to expand...
Click to collapse
Before pushing? After, but before rebooting?
Anytime that Android is stopped you can clear the cache.
I tried this with a copy of the stock apk:
Code:
C:\>adb shell
# stop
# rm -R /data/dalvik-cache/*
# mount -o rw,remount /dev/block/mmcblk0p5 /system
# ^C
C:\>adb push framework-res.apk /system/framework
C:\>adb shell
# reboot
It put me in an very long chase of the black and white dots that I almost thought would be endless but eventually it finished booting and is in the same condition as all the previous methods. Very crippled.
I can't figure it out
First, get the 1.2.1 update off B&N's website and unzip.
Get framework-res.apk out of that and push it.
The stuff in /system/framework should all be chmod 644.
An ADB push probably leaves it with wider access.
None of this should make any difference.
I'd guess that you are either missing a resource in your fw-r or else you modified something else.
Find an app that crashes. Get a logcat of just that crashing.
Renate NST said:
First, get the 1.2.1 update off B&N's website and unzip.
Get framework-res.apk out of that and push it.
The stuff in /system/framework should all be chmod 644.
An ADB push probably leaves it with wider access.
None of this should make any difference.
I'd guess that you are either missing a resource in your fw-r or else you modified something else.
Find an app that crashes. Get a logcat of just that crashing.
Click to expand...
Click to collapse
I got a copy of the FW 1.21 zip from B&N and extracted the framework-res.apk. I didn't try to push it yet. Instead I got the checksum for the current file on the Nook and compared it to the newly minted file. They were identical. I don't think there is any point in trying yet again with the same procedure. If my reasoning is incorrect, I'm certainly game to try anyway.
All files in /system/framework are chmod 644. The Framework folder itself (and the system folder) are something else, but the contents are all 644.
The only modifications I have made after rooting with Nook Manager are the installation of Google Apps, the implementation of multi-touch (I have to go back and look that up to see what all I did, but surely nothing with framework-res.apk or it never would have worked....), editing settings.db to relabel the QuickNav buttons after programming with NTMM, and pushing a modified copy of internal.db to fix the schizo "reading now" button. As i say, these are all long-established changes and the Nook has been stable with them. I think Google apps may modify framework.jar, but I'm not sure.
[I checked on multi-touch. I flashed a new kernal image and added one line to /etc/permissions/required_hardware.xml in order to enable multi-touch...have no idea what "flashed a new kernal" actually did, but it worked]
Two really noob questions: 1) how can I get a logcat of an app crashing when ADB will not run once a copy of framework-res.apk has been pushed? 2) if the Android system is actually stopped when I type "stop"in ADB shell, how does ADB continue to function?
And, actually, apps do not so much "crash" once I've attempted to put in a "new" framework-res.apk--most just refuse to run. But maybe there is something going on in the droid brain while the screen flickers a little and nothing else happens.
ADB runs under Linux, not the Android subsystem.
You should always be able to access ADB.
If ADB isn't running continuously and reliably you have problems.
If some app does not run, give the specific section in logcat where it doesn't run.

NGL3 Screensaver Images

Hi everyone,
I have a Nook GlowLight 3. I don't like the default screensavers, so I'd like to delete them and (optionally) put in some new ones. Is this possible?
Maybe it's just a matter of getting into the Nook's file system and replacing their image files with my own (with the same filenames)?
This Nook is new. I don't mind voiding the warranty, but I'd rather not unless I know it will be worthwhile. Otherwise, I would try it myself. So I'm hoping some kind soul who has a NGL3 that they have already broken into would be willing to take a look at it for me.
Please let me know if I can help! Thank you!!
Robert
I've got too many Nooks and I'm far removed from stock.
Do you have a directory /data/sleep/
That used to have PNGs for some standby images.
Do you currently have the old, creepy authors?
I have not rooted it or anything yet, just plugged it into my Mac and looked at the default directories it comes with. There is basically nothing there– I even had to research online and experiment how to just create a directory where I could sideload a PDF. So, no, I haven't seen any directory like you mentioned. And I'm not sure what you mean about the old authors(?). The screensavers I have are Symbols and Quotes. In any case, this is my first Nook, and it's less than a week old.
So, do you think there is a good chance I could make changes to the stock screensavers?
The "old, creepy authors" were the screensavers that made the Brontë sisters look like the witches out of Macbeth.
These images are all packed away in /system/priv-app/partner.apk in res/drawable-mdpi-v4/
Code:
artboard_1.png
artboard_2.png
artboard_3.png
artboard_4.png
artboard_5.png
artboard_6.png
artboard_7.png
artboard_8.png
alexander_pope.png
chinese_proverb_00.png
cicero.png
jane_austen.png
john_wilson.png
lady_mary_montagu.png
louisa_alcott.png
robert_southey.png
thomas_jefferson.png
thomas_kempis.png
The list of images is in res/values/arrays.xml in quotes_imgs and symbols_imgs
The actual screensaver mechanism is com.nook.partner.screensaver.ScreenSaver (in partner.apk).
If you repack that all it won't have a B&N signature
I'm not sure how much that will break things.
In worst case you could resign everything.
I think that I'd just rewrite ScreenSaver to fetch PNGs from a directory like /data/sleep
That way, changing the collection would be easier.
Oh, and another thing...
As always, the sloppiness of B&N gets to me.
Those "quote" image files are ten times the size of the "symbol" image files.
Why? Because they have a very subtle dithering to the backgrounds.
It's nothing that you can see even on a regular LCD monitor, let alone on a black & white eInk panel with 16 shades.
So the file is basically trying to compress random noise. That doesn't work out well.
Below is what you get when you use the fill tool (red) in MS Paint on the image.
It leaves holes because the adjacent pixels aren't exactly the same value.
Oh, yes: I remember those goofy portraits.
OK, thank you– I really appreciate your help! I am excited to try this out when I can snag some free time. I will try to post what happened, too.
OK, I was able to pull that partner.apk file to my Mac, and unzip it. The images are there. Awesome!
So, I'm temped to create my own B&W/greyscale pngs, with the same dimensions, and give them the same file names. Then put them in the same locations, rezip (with an apk extension), and push it into place. I know it will have a different file size, etc, but do you think that will be a problem? Normally I'd just try it, but I'm trying to err on the side of caution.
Thanks!
Newtham said:
rezip (with an apk extension), and push it into place.
Click to expand...
Click to collapse
Yes, it should work.
There doesn't seem to be any problem with signatures.
I modified all my images for fun and it didn't break anything.
(Although, I've hacked so much stuff on this that the screensaver never activate. This is not my primary reading device.)
It must have some signature (the originals will do) or it won't be acknowledged as an APK.
Make sure that you keep the original file as a backup.
I'm still new to this, so basic question: what is a signature (in this case) and how do I create or modify it?
Thanks!
Newtham said:
What is a signature...
Click to expand...
Click to collapse
Signatures are the three (or more) files in the META-INF directory in the zip (apk).
If they are there, that's fine.
To learn about apk signing Google it.
@Newtham
Oh! I figured something out. I looked through the code.
If you just want to have one screensaver of your own (which you could manually change).
All you have to do is change some undocumented settings.
File: /data/data/com.nook.partner/shared_prefs/screen_saver_preference.xml
Code:
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
[color=red]<boolean name="pref_key_screen_saver_from_sdcard" value="true" />
<string name="pref_key_screen_saver_from_path">/sdcard/sleep.png</string>[/color]
<boolean name="pref_key_screen_saver_low_power" value="false" />
<int name="key_screensaver_img_index" value="8" />
</map>
OK, awesome, thanks!
About a week ago, I tried just modifying the image files, rezipping & renaming to apk, and pushing into place, but I didn't modify the signatures. So now I'm stuck on the boot screen. (I forced it off in the meantime, but since it's e-ink, its still showing the boot screen.)
I can still see it on the command line via adb, but I no longer have write permission so I can't push the original apk back into place. So that's my next task. I haven't had time to play with it since then. It's fun playing with this, I just wish I had more time.
Newtham said:
I no longer have write permission...
Click to expand...
Click to collapse
Well, you did it once, it's just a question of making /system rw:
Code:
# mount -o rw,remount /system
One of the silly things that B&N did was making the "screensaver" and the "wallpaper" the same thing.
I'll have to write some code to make them separate things.
Lol! As I dived into this I realized that I had been all over this ground before.
The stuff I wrote in https://forum.xda-developers.com/showpost.php?p=79994025&postcount=11 about using settings to disable the B&N wallpaper is true but not necessary.
You can disable all that silliness with:
Code:
# pm disable com.nook.partner/.daydream.DayDream
You can set a simple white wallpaper using my Wallpaper.apk app available in the signature
The wallpaper only appears as a background to a launcher (or any app that has no background).
The Glow3 4.7 & Glow4 5.0 both broke the Wallpaper, you need a separate patch for that, see below.
I had previously made a patch to cycle through user supplied PNGs as a lock screen.
That patch is available in the signature as nook45patch.zip
Code:
C:\> adb pull /system/framework/android.policy.jar
C:\> apktool d android.policy.jar -o AP
C:\> mergesmali /v \AP\smali Screen.smali
C:\> apktool b AP -o android.policy.jar
Then replace android.policy.jar and delete/backup/rename/whatever android.policy.odex
Then stuff your PNGs in /data/sleep
Erm, I think this mostly applies to Glow2 4.5
I'll look more closely at Glow3 4.7
glow45patch.zip works fine on the Glow3 4.7 & Glow4 5.0
So, the nook45patch.zip works fine on the Glow3 4.7
I kind of confused myself, strange things happen if you have no images in data/sleep.
I'll look into that too.
The Glow3 & Glow4 have this problem where B&N stole the functionality of wallpaper for sleep screen.
The background on launchers appears black even though the Wallpaper API changes /data/system/users/0/wallpaper correctly.
I should be able to solve this one too.
There was a minor bug in the old patch.
It would barf if you didn't have any user images.
The new glow45patch.zip is in the signature under mergesmali.
The aforementioned glow45patch.zip is a valid patch for Glow3 4.7 too.
There is also the issue of the black Wallpaper on Glow3 4.7 when using a stock Launcher.
Does anybody else have this/notice it/care?
With 4.7 B&N got rid of /system/priv-app/SystemUI.apk and put it all into /system/priv-app/partner.apk
This necessitated a change in the WallpaperManager since it's all a different package.
The actual ImageWallpaper.DrawableEngine.drawFrame() is a bit complicated.
I couldn't (be bothered to) figure out how it was supposed to work and where it was failing.
To my taste, anything other than solid white wallpaper on an eInk device is just distracting.
I wrote a small patch to make drawFrame() just drawColor() instead of scaling and rotating Wallpapers.
Is there any interest in that?
I have been working on this, but I can't get write access via adb anymore. I have tried everything I can think of, including your suggestion above. I can log in to the adb shell and run as root and make changes there. But anytime I try to push anything with adb, it tells me it is read-only. When I run rootnook.sh, it tells me I'm already rooted, but no superSU found (and then roots again, with no different results). adb root doesn't work, either.
The only major thing that's changed recently is that I installed the latest nook update, which I thought would be a good idea before I start hacking. Maybe that messed it up.
I'm stumped (which is not difficult to do...). Any suggestion on how to get back in there?
Thanks!
You probably de-rooted yourself.
Does adb shell give a # prompt?
Does the shell command "id" tell that you are root?
Does the shell command "mount" tell you that /system is rw?
Does the shell command "getprop ro.secure" say 0 (security is off)?
When in doubt, push to sdcard and then copy (cp) to where it should be.
Thanks! Moving it to sdcard did the trick.
I unpacked the apk with apktool, edited the images directly (didn't change the file names), repacked it with apktool, and then (finally, by using the sdcard directory) got it back to the Nook. And then copied it into place. But I still get the same results: the GUI gets stuck on the boot screen.
So, do you think this has to do with signing the apk file? I did a lot of research on it, but mostly what I found was how to sign your own file, not someone else's. Do you have any tips on how I can do this (if that's what's needed)? Thanks!!
(P.S. Thanks for the info on the glow45patch. I haven't had a chance to look at it too closely yet, but it looks interesting. I'd still like to mod the actual pics, though, if I can.)

Categories

Resources