![]() |
#16 | |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 38
Karma: 90402
Join Date: Feb 2019
Device: Tolino Shine 3
|
Quote:
adb shell getprop ro.boot.hardware E60K00 Assuming it's the same as mine, you'd edit the file fstab.E60K00 (otherwise substitute your hardware type) inside boot.img, and you'd want to (1) uncomment the entry for /dev/block/mmcblk0p4, (2) change vfat to ext4 there, then edit init.rc and disable the vold service (simply add a line saying disabled under it). Then rebuild the image and flash it (fastboot flash boot boot.img). At some point you'd also have to format the filesystem, more or less like that: adb shell mke2fs -t ext4 /mnt/media_rw/extsd Maybe you also have to unmount it first or use -F -F. Note: you'd lose all files on that partition of course, and there might be something else to do as well (most likely a permissions issue). I haven't tried it myself so I can't really say. Last edited by Peripathetic; 02-07-2020 at 05:48 PM. |
|
![]() |
![]() |
![]() |
#17 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 38
Karma: 90402
Join Date: Feb 2019
Device: Tolino Shine 3
|
Removing System Crash Reporter (and Making Other Filesystem Changes)
Android devices usually come with a plethora of bundled applications nobody ever asked for that cannot be uninstalled, stuff that keeps running in the background, unnecessarily draining battery and perhaps also compromising privacy.
The Tolino is not a particularly bad offender in this aspect but there is at least one application, called System Crash Reporter, that seems to serve no benefit to the user, and it might not be a bad idea to get rid of it. These steps will also illustrate how to make any other changes to the filesystem. Removing System Crash Reporter All the persistent operating system files are stored on the /system partition. It is possible to modify these files while the operating system is running but even though we already have superuser access via ADB, the partition is mounted read-only, so we must remount it for reading and writing first:
How could you know that this particular APK was there if I haven't told you? There are couple of ways:
If you are modifying or copying new files, you should make sure they have the correct metadata set: use chown, chmod, and chcon to change ownership, permissions (mode) and security contexts respectively. Applications can be installed with adb install. More information about these and other commands is available in the Android documentation. Some Other Points of Interest Around the Filesystem
|
![]() |
![]() |
Advert | |
|
![]() |
#18 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 38
Karma: 90402
Join Date: Feb 2019
Device: Tolino Shine 3
|
Fun with APKs
Most Android devices use a number of different APKs to implement specific functions (launcher, dialer, file explorer, file viewer, browser, etc.). While the Tolino also comes with a lot of APKs, they are all very low-level, and practically all the interesting functionality is concentrated in EPubProd.apk, which is the launcher, book browser, book reader, Internet browser, and settings menu all at the same time.
To Keep or Not to Keep Some people might at this point be inclined to just delete this APK from device and install their custom launcher and book reader applications. This is definitely an option, although with a few caveats: most importantly, full screen refresh would have to be reimplemented in the reader app, which was apparently already done in KOReader, and almost done in CoolReader. Another app would have to be used to allow the adjustment of backlight settings (there's one written by Ryogo of TWRP fame). The device also wouldn't support automatic suspend and resume with smart cover but in principle it would still work fine with EPubProd.apk gone, as long as you installed a replacement launcher. Yet another option is to keep EPubProd.apk but not as a launcher. If more than one application provides launcher functionality, Android will prompt the user to make the choice. We can force this prompt to appear programmatically with ADB: adb shell am start -c android.intent.category.HOME -a android.intent.action.MAIN EPubProd.apk's manifest could also be modified to not make it appear as a launcher and perhaps go back to another launcher instead of its home screen. There are a lot of possibilities. As for my Tolino however, I decided to mostly leave the EPubProd app (is that short for "EPub Product?") working the way it was originally intended to, only changing some relatively minor aspects of it, so this is what I'm going to describe. The Right Tools for the Job Android application packages are not supposed to be reverse engineered but of course they can be. There exists a great utility for meddling with them called Apktool. Other useful tools include Android Asset Packaging Tool (AAPT) and Smali/Baksmali. All these require Java Runtime Environment (JRE) to run, I suggest getting a portable version of it to avoid cluttering your system with unneeded Oracle garbage. Applications are generally written in a high-level language such as Java or Kotlin but can be decompiled only to Dalvik virtual machine pseudo-assembly language. The numerous .smali files can then be edited with a text editor. Afterwards, the APK can be compiled together again. While this is doable even with the Notepad bundled with Windows, I suggest getting a better editor such as Notepad++. Two more useful tools are GrepWin to search for text or regular expression patterns in many files at once, and WinMerge to compare the contents of two (or even three) files or directories. All these utilities are open source and cost nothing. As a rule APKs need to be signed but this is not strictly enforced for system apps, and we can take advantage of this to keep things simpler. When making changes, you can keep the original signature metadata. A recompiled (and signed) APK should be processed by Zipalign, a small command-line utility distributed with Android Studio. It will still work without this step but might run slower and there might be a warning message written to the system log. What Also Works Sometimes While Apktool is the proper tool of choice for serious APK modification, there exists another way. An APK file is just a ZIP archive at the core and can be unpacked and packed with a tool like 7-Zip. While all the code is inside classes.dex and cannot be conveniently edited this way, resources (data) can easily be replaced. XML files inside the APK are in "binary" format and will look like gibberish but other than that, assets and resources generally can be modified without having to resort to Apktool. This is sufficient for some of the modifications I describe in the next post. Installing the Modified APK This in fact can be done on a live system, and the commands are as follows:
Last edited by Peripathetic; 02-08-2020 at 06:57 PM. |
![]() |
![]() |
![]() |
#19 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 38
Karma: 90402
Join Date: Feb 2019
Device: Tolino Shine 3
|
Modifying EPubProd as a ZIP File
All the changes listed in this post can be made with a ZIP archiver. You do not need to use Apktool (yet) but of course it can be used for these modifications too.
Add Hyphenation for More Languages
Replace UI Font / Fix Accented Characters in Book Titles & Author Names The Tolino app uses a typeface called Bariol. According to the designers' description, it already supports practically all European languages written in the Latin script at no extra cost: Spoiler:
Unfortunately it seems the support for some accented characters was cut of from the version bundled with the app. Even if you only use one of the supported languages, you might still be reading something like The Good Soldier Švejk by Jaroslav Hašek, and the "š" will be displayed with the fallback font (Droid Sans), which makes both the title and the author name look quite ugly. One way to fix this is to replace the Bariol font with a version that supports the full character set, as it was supposed to in the first place. Yet another option would be to replace it with another font of your choice. The files are:
You will want to use another typeface if you foresee using: (1) some non-European languages written in Latin script, for example Vietnamese; (2) Greek or Cyrillic and don't want them to revert to fallback font; (3) rare Latin characters used mostly by linguists. If you need to check which character sets are supported by a font, there's a utility called BabelMap. If you only want a different font to be available for book text, it can be simply copied to the Fonts directory on the user data partition. The APK does not have to be modified for this. Disable Calling Back Home / Automatic Update Check If you do not use Tolino's online features and want to prevent it from unnecessarily calling back home, look at assets/environments/app.properties.prod: Spoiler:
Replace all occurences of bosh.pageplace.de with 0.0.0.0 (an invalid IP address so that any connection attempt fails immediately). I also set REPORT_ERRORS=FALSE but left the BOSH_TIME_URL intact so that the time is still synchronized. In particular, using a customized firmware we only want to update to newer versions once we customize them, so perhaps it's especially worth it to disable UPDATE_CHECK_URL. Last edited by Peripathetic; 02-08-2020 at 09:42 PM. |
![]() |
![]() |
![]() |
#20 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 38
Karma: 90402
Join Date: Feb 2019
Device: Tolino Shine 3
|
Modifying EPubProd by Decompiling It
For the following modifications, the APK has to be decompiled with Apktool, and recompiled back again when done.
Remove Store from Home Screen The home screen layout is specified in the XML file res/layout/home_activity.xml, and the store content is in its "bottom part." To hide it we will change the height of this part to 1 pixel: <FrameLayout android:id="@id/home_activity_app_area_bottom_part" android:layout_width="fill_parent" android:layout_height="315.0dip1px" android:layout_alignParentBottom="true"> While it can be removed completely, it is a bit tedious, so for now I settled for the path of least resistance. The result is practically the same, as none of it can be seen any longer. Eventually, more book covers could be added to the home screen to take advantage of the freed up space but their number is hardcoded too, so it's not a trivial change. Adjust Translation Strings Most of the text messages displayed by the app are contained in the files:
The only thing I did with these files was to capitalize all instances of "tolino." I can imagine someone might want to change "To my books" / "My books" to "Library" or something like that. This is the place to make any such changes. And of course the app can be translated to another language this way too. Note that you can see these strings.xml files for a lot of languages but this is just because a library used by the app (ABC Search Bar) supports all of them. It doesn't mean the Tolino app includes for example a hidden Albanian (sq-rAL) translation. If you look at the size of these files, they are much smaller than what a complete translation would have to be. Any missing strings are replaced from the from the default file under res/values. Use the Refresh Button to Rescan for Updated Books The Tolino app book database is supposed to get updated every time the mass storage device is unmounted. A side effect of switching to MTP mode is, since that no longer happens, the database does not get updated at all and new books do not show in the app. The app has a refresh button in the library view but whatever it is supposed to do, it doesn't work unless logged in: it will only show a pop-up dialog otherwise. Let's make this button simply rescan the user data for new books. The code that runs when the button is clicked is in smali/de/telekom/epub/ui/activities/BasicContentActivity$MainMenuButtonClickListener.s mali. In the source I decompiled it starts at line 131 but it will be different depending on the application version and parameters passed to Apktool (I use -b or --no-debug-info). Here is the relevant part, and how to modify it: iget-object v3, p0, Lde/telekom/epub/ui/activities/BasicContentActivity$MainMenuButtonClickListener;->this$0:Lde/telekom/epub/ui/activities/BasicContentActivity; iget-boolean v3, v3, Lde/telekom/epub/ui/activities/BasicContentActivity;->isConfigLoaded:Z if-eqz v3, :cond_4 iget-object v3, p0, Lde/telekom/epub/ui/activities/BasicContentActivity$MainMenuButtonClickListener;->this$0:Lde/telekom/epub/ui/activities/BasicContentActivity; invoke-virtual {v3}, Lde/telekom/epub/ui/activities/BasicContentActivity;->startCloudSync()V invoke-static {}, Lde/telekom/epub/application/Globals;->getApplicationContext()Landroid/content/Context; move-result-object v0 new-instance v1, Landroid/content/Intent; const-class v2, Lde/telekom/epub/ui/activities/AddLocalFilesActivity; invoke-direct {v1, v0, v2}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V const/high16 v2, 0x10000000 invoke-virtual {v1, v2}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent; invoke-virtual {v0, v1}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V goto :goto_0 The new code is more or less equivalent to running the following command, which can also be used to refresh the library: adb shell am start -n de.telekom.epub/.ui.activities.AddLocalFilesActivity The same code could also be made to run every time a USB device is unmounted. Remove the Bookmark Icon In the reader app, a bookmark icon is shown on every page to indicate the place that can be tapped to add a bookmark, which I find unnecessary and distracting. To get rid of it:
Last edited by Peripathetic; 02-09-2020 at 12:36 PM. Reason: Added section: Remove the Bookmark Icon |
![]() |
![]() |
Advert | |
|
![]() |
#21 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 38
Karma: 90402
Join Date: Feb 2019
Device: Tolino Shine 3
|
The Modified Tolino App & Firmware Patch
The Modified Tolino App
The APK file with all the modifications as described in this thread can be downloaded here: Below are a couple of annotated screenshots showing some of the changes, and possible scope for improvement in the future: Firmware Patch Installer A convenient way to apply all the changes I made is to use an installable update file. However, the file is too large to store here, so I have to host it externally. If there's a problem accessing it, let me know.
If you want to make your own patch, all the sources for what I did are already included inside the ZIP file. In particular, have a look at:
Mandatory Disclaimer The files work well on my Tolino Shine 3, should be safe to use, and if you have a backup of your SD card it's always possible to restore things to their previous state. However, please understand that you assume all responsibility for using the files and instructions I am sharing. I will not be liable for any damage, neither should you expect any support from me or anybody else in case of problems. If you disagree or have any doubts, do not use these files. Have fun, and please share any interesting results of your modifications. |
![]() |
![]() |
![]() |
#22 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 72
Karma: 1795
Join Date: Jun 2017
Device: Kobo,Tolino,BN,PB,Kindle,Likebook,Inkbook
|
@Peripathetic
Thank you so much for your work! Earlier for myself, I created a zip file with apps that I need first of all and installed this file via TWRP. Can you put these apps in patch_installer_tolino_v9.zip so that everything is already in one. I think many would be useful. |
![]() |
![]() |
![]() |
#23 |
Lucifer's Bat
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,536
Karma: 19491715
Join Date: Nov 2010
Location: Earth/Berlin
Device: Kobo Libra 2
|
Thank you!!! Especially for the patch installer! Makes it so much easier for the normal folks like me
![]() |
![]() |
![]() |
![]() |
#24 |
Connoisseur
![]() ![]() Posts: 64
Karma: 144
Join Date: Aug 2019
Device: Tolino Vision HD4, BOOX Poke2
|
Hi Peripathetic,
Do you occasionally know how to install GooglePlay on Tolino's Android 4.4.2 and/or which version of GP to take and try ? Thanks a lot, Norbert |
![]() |
![]() |
![]() |
#25 | |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 38
Karma: 90402
Join Date: Feb 2019
Device: Tolino Shine 3
|
Quote:
adb install <filename>.apk. But if you really want Google Play, you can try to install OpenGApps from here: https://opengapps.org/ The version you need is: ARM (32-bit), 4.4, pico (smallest). They're updated regularly so I'm not posting a direct link. You might need to use the trick I posted before to access the full settings to be able to add your Google account: adb shell am start -n com.android.settings/.Settings If your device is showing as "uncertified," you can add an exception for it here (have to log in to the same account as on the device): https://www.google.com/android/uncertified/ Yet another approach would be to use Yalp Store (or Aurora Store) with MicroG. This is an alternate way to access Google Play Store and services. Not really sure what you're trying to do but this might work just as well for your purposes. Last edited by Peripathetic; 02-25-2020 at 08:16 AM. |
|
![]() |
![]() |
![]() |
#26 |
Connoisseur
![]() ![]() Posts: 64
Karma: 144
Join Date: Aug 2019
Device: Tolino Vision HD4, BOOX Poke2
|
Hi Peripathetic,
Thanks a lot for you answer and time. I of course install by sideload all free apps, but I need one dictionary app which I purchased and I can't sideload install it as they apparently utilize google play licensing api to check the license ... Two years ago I managed to install GP on my first older Tolino (Android 4.0.4), then installed my dictonary app and uninstalled GP as it was pretty instable (and am using it until now). But I haven't managed this on my 2nd Tolino with Android 4.4.2 (:-( I tried your advices but can't install gapps even pico due to too low space on system partiton (cca 75MB) but it needs for Core about 80MB ... I was able to install yalp, throug FDroid, and was able to install my dictionary app from my google account, but then upon starting they again claimed no license ... apparently yalp doesn't support licensing api ... Thanks again, Norbert |
![]() |
![]() |
![]() |
#27 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 38
Karma: 90402
Join Date: Feb 2019
Device: Tolino Shine 3
|
Your options include:
|
![]() |
![]() |
![]() |
#28 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,884
Karma: 3933245
Join Date: Sep 2012
Location: Salzburg AT
Device: Bigme 3/3, Boox 4/14, Like-/Meebook 2/8, Tolino 1/10, Ki/Ko 0/8
|
Quote:
|
|
![]() |
![]() |
![]() |
#29 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 38
Karma: 90402
Join Date: Feb 2019
Device: Tolino Shine 3
|
Thank you for the clarification. The Shine 3 is my only Tolino, I don't really know much about the rest.
Maybe I should clarify it in the thread title but I think most of what I wrote can be adapted to other devices, so perhaps I'll leave it for now. |
![]() |
![]() |
![]() |
#30 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,884
Karma: 3933245
Join Date: Sep 2012
Location: Salzburg AT
Device: Bigme 3/3, Boox 4/14, Like-/Meebook 2/8, Tolino 1/10, Ki/Ko 0/8
|
Quote:
Only Page and Shine have. |
|
![]() |
![]() |
![]() |
Tags |
adb, epubprod, mtp, tolino, twrp |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Tolino Page & Tolino Page same size? | rcentros | Tolino | 6 | 08-21-2018 03:07 PM |
Tolino II und Tolino-Tablet bereits im Herbst? | hamlok | Andere Lesegeräte | 2 | 06-19-2013 08:58 AM |
Customizing the library | centuryx476 | Library Management | 3 | 05-09-2013 09:31 PM |
customizing the toolbar | rkillings | Library Management | 3 | 09-02-2011 04:37 AM |
Customizing Calibre | lunixer | Calibre | 5 | 08-23-2010 01:21 PM |