⬆️ ⬇️

Russification of the Nook reader: what happened (technical side)

image



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





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% /)



  1. 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
  2. strings.xm -> values ​​/ strings.xml
  3. styles.xm -> values ​​/ styles.xml
  4. strings.xm -> values ​​/ arrays.xml
  5. colors.xm -> values ​​/ colors.xml
  6. values ​​/ * -> values ​​/ *
  7. xml / * -> xml / *
  8. assets / * -> assets / *
  9. executes script
  10. layouts / * -> res / layout / *
  11. drawable / * -> res / drawable / *
  12. Is packing
  13. 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:







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.

Source: https://habr.com/ru/post/97666/



All Articles