In general, I bought myself a Nook reader, read and read for several weeks, and then I wanted to write something for it and this initiative turned into a russified firmware made with
nilov and with the help of various people from nookdevs.org, including JesusFreke and poutine.
')
Excuses
- Personally, I did everything under Linux, but nothing special, which cannot (I think) be done under Windows (and the first versions of the scripts were written under it) or under a poppy.
- I am new to writing scripts, so I would be happy if someone put them in order or corrected me.
- And yes, I do not bear any responsibility for what you do with your Nook.
- In part, this article will be a guide for those who also want to join us.
Required software
Description of all utilities and build their firmware
ATTENTION: I beg you very much - do not create thousands of firmware versions! Let's do it all over-centrally!
Getting applications directly from the device: download / download-all utilities
These utilities allow you to download applications from your folder to the downloaded folder, and also completely unpacks them into the selected folder (we will need it to get the initial resources and code).
The first one gets the names of the system application at the entrance, and the second one does not receive anything and downloads all the applications listed in rus_res / index
They look very simple - this is the sequential execution of the adb and apktool utilities:
adb pull /system/app/$1.apk downloaded/$1.apk
java -jar apktool.jar d -f downloaded/$1.apk extracted/$1/
After completing the download-all, we get all the resources we need and now we can proceed to the modification and replacement of resources.
Application modification
There are some difficulties. Painlessly, you can change only the resources, and the code will not change, apparently because of the dalvik-machine cache or something like that.
Resources
There is nothing complicated in the replacement of resources - we simply unpack the downloads folder into the temporary work /% appname% folder, replace the files there and pack them back, and then perform adb push (not adb install) and download the application to the device. This method is very convenient for debugging new design, debugging fonts and css-ok in readers, something simplified by this method was used by my acquaintance with mynook.ru when selecting fonts, etc. =)
Code
Everything is absolutely the same as with resources, but there is one thing. We will not be able to put the application on the device. When you try to open a new application, Nook simply simply hangs, and a normal adb install will not roll, because we change system applications. What is the way out? The solution is to directly assemble the firmware with the modified code and put them on the device and see how it works. Yes, it is difficult, but we do not need cardinal changes anyway.
Scripts for modifications: process / process-all
Full code process
Here I will briefly describe what and where it copies and executes (all files are taken from rus_res /% appname% /)
- For Home and Library, unpack with decompiling the code, for the rest - only resources - here you need to edit if in other applications you will change the code
- strings.xm -> values / strings.xml
- styles.xm -> values / styles.xml
- strings.xm -> values / arrays.xml
- colors.xm -> values / colors.xml
- values / * -> values / *
- xml / * -> xml / *
- assets / * -> assets / *
- executes script
- layouts / * -> res / layout / *
- drawable / * -> res / drawable / *
- Is packing
- Signs with our key
Russification of most texts: folder sasha and script copy-sasha
In the sasha folder (so simply the designer’s name is with mynook, by the way, he is extremely thankful to him for that. Without him I wouldn’t have much enthusiasm at least =)) are cut xml files with texts that are glued together and copied to the required places in the rus_res folder.
Upload to device: upload / upload-all
Let me remind you that this is only for applications with modified resources and with the original code.
The code is also extremely simple:
adb push %appname%.apk /system/app/%appname%.apk
Create firmware: build-firmware
Here, too, everything is very simple =) We will use the standard softrutovskuyu firmware and change it.
On the nookdevs.com IRC channel, people gave me a special (not complicated) script for packing / unpacking images and we will also use it.
With all this, we can simplify as much as possible the entire course of creating the firmware: unpacking, changing, packing.
I will list what we are changing in the firmware at the moment:
- We replace the necessary system applications with our russified applications from the output folder (obtained in the previous steps through the process script).
- We copy init.rc - it is necessary for FBReader'a
- We copy our applications - the application manager and our modified wifi locker from nookdevs.com
- Copy FBReader and its associated hacks - for example, sqlite3root with SUID, as well as replace the boot scripts that govern the rights to sqlite3root, copy the native libraries of the freighter.
- We copy the Russified UI fonts.
- Copy wallpaper =)
Now we have the firmware and we can run it on our ruled Nuke!
PS:
there may need to manually create some folders, I do not remember where I already adjusted in the scripts.