• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[APP][NST/G] Mantano Reader [MOD]

Search This thread

nmyshkin

Recognized Contributor
Nov 21, 2013
1,495
437
I keep my NSTG on FW 1.2.1 because there are issues with Tasker and plugins on FW 1.2.2. The resulting apps are OK, but development is a problem unless I do it on FW 1.2.1. So that one device has B&N apps removed. AlReader has been my go-to reader app. Until now.

While working on some thorny issues with a Tasker app update I came across a book I wanted to read. Unfortunately it was only available in PDF format and AlReader can't handle that. I soon found that something like EBookDroid really couldn't deal well with a PDF file that begged for text reflow (problematic as that is). I wanted something that was at least as good as the stock reader. I could have just picked up one of my other NSTs and read the book that way, but when you abandon the B&N system you should at least break even, not lose. So I went searching through the forum for some ideas.

Mantano Reader caught my interest. Not only can it reflow PDF text (pretty much like the stock reader-don't get too excited), it can also display PDFs as a continuous scroll, with zoom. It can handle Adobe DRM books! And the TTS works (not a big deal). So I looked around and started with version 2.2.12 from Apkpure. This is the last version for Android 2.1. I found that full-screen reading was broken in this version and I couldn't see why, so I worked my way back until it wasn't broken. That was version 2.2.3.

Not for everyone

Those are some of Mantano's virtues, but it's not for everyone. I think it's chief drawback is the absence of full font support. There is only the default (admittedly not bad) and although there is provision for user fonts, there are issues. More on that later. Then there is the really tiny user interface. The colors render somewhat muddy on the NST also. Those are really tough issues to address, certainly beyond my pay grade. Also, none of the syncing, cloud, downloading of dictionaries, OPDS books, fulfilling of .acsm files, additional fonts, user manuals, etc., works. Can't be fixed. I looked. Finally, the reader options are pretty simple, about what is available for the stock reader (except for fonts). So if you like the hundreds of setting combinations in something like AlReader or FB Reader, this app is not for you. If you want something straightforward so you can just read a book without all the B&N hoopla, Mantano may be worth a look.

Mods

When I started getting serious about this I decided to try to learn by doing. My goal was to remove (or at least hide/disable) stuff that did not work. Almost all of my modifications were in the resources folder of the apk file. There was also one annoying issue with the aspect ratio of book covers that required a minor change in two smali files (thanks to @Renate). Here's a short list:

1. Removed Bookstore (OPDS) tab on home screen (formerly "My Catalogs" as described in User Guide)
2. Removed menu icons for sync and cloud
3. Disabled sections in Settings that don't work (Login, Sync, Dictionary download, Fonts, User Manual download)
4. Corrected font colors in some local dialogs so text is visible
5. Made the page number black, smaller, and with a transparent background for less visual distraction

Also, there were a few dialogs with invisible text that used the system framework to generate the window. The only way to fix this was to make a few very minor changes in framework-res.apk. This worked well and even helped with a few other apps that formerly had invisible text. A win-win. You can update your framework-res.apk using the CWM zip provided below. Despite its filename, it is not an "update" zip. You'll just be installing a zip file with CWM.

Making do

Overdrive Library epubs: No app will be able to fulfill .acsm files on the NST/G. The SSL is just not up to it. So there's no point in registering the device with Adobe. That just wastes one of your allowed devices and so I disabled that first Settings selection. However, the app can read Adobe DRM books, understands due-dates, etc. You just need to introduce your device to ADE running on your PC (ver. 3.0 works well for me on Windows) and transfer fulfilled books from there, just as you would with the stock reader.

Fonts: You can, in theory, supply your own TrueType fonts and place them in /sdcard/Mantano/fonts. When a book is opened, the lower menu options include "Themes". This odd term is for adjusting the appearance of the book (fonts, margins, justification, line spacing, colors). You can make a new theme or edit the default one. Either way, you will get to select a font. You will see the font you added in the folder (you can copy any font you like from /system/fonts or from anywhere else). The problem is that Mantano has no way to deal with font families. For example, I prefer Malabar. Of course, there is the base font, the bold instance, italic, bold italic. Mantano makes you choose one of these. Clearly you choose the base font (no need to copy over the others). If there are italics or bold type in a book, the reader uses the default font. This would not be such an issue for small sections of emphasized text, but the font scales are not the same. Malabar is larger than the default font. So any italics is obviously smaller. I tried a software package for scaling the font but it just turned it into rubbish. I am learning to like the default font. This issue was fixed in version 2.4.6, based on what I've read. But that won't run on the NST, of course.

Dictionaries: The reader has the ability to go out to find definitions on the WWW. Big pain. Although you can't download any dictionaries from within the app, Mantano does play nicely with ColorDict and there are plenty of dictionary options for that. Easy fix.

User Guide: I poked around and found a guide labeled "Version 2.1". That was the best I could do. It seems pretty close, although what was the "Bookstore" tab in this version (which I have removed) is referred to as "My Catalogs" in the manual. Either way, it's non-functional and gone. The same goes for references to cloud, accounts and sync. None of it works and all of it has either been removed from view or disabled in this mod.

Extras

Unlike AlReader and FB Reader, Mantano's main activity is the library view. That means there is no simple way to use the "reading now" status bar button to go directly to your current book.

I also like to be able to use the current book cover as a screensaver. AlReader and CoolReader both have this capability. Mantano does not, but it does create thumbnails for each book (if you let it) and one of those is screensaver size (default.png). For some unknown reason, all the thumbnails of various sizes for display in the library have the correct aspect ratio except for default.png. I fixed this in the app with a view to using it as a screensaver image.

To address these issues, I have used Tasker to create two small apps. Mantano_Extras1 enables a listener for when the reader is closed (either by two presses of the back button or simply by pressing the "n" button). When that happens, the Mantano database is queried for the last reading point/book. This is stored in a variable. Accessing Mantano_Extras1 after setup sends a command to open that file. If Mantano is your default app for epubs and/or pdfs, the book will open automatically to the right place without passing through the library. Thus assigning Mantano_Extras1 to the "reading now" button with NookTouch ModManager restores the function of that button.

Mantano_Extras2 does everything described above. During setup it also creates the folder /media/screensavers/CurrentBookCover. When the reader is exited and the database information stored in a variable, it copies the default.png for the current book to that folder. If you select that folder in your NST Settings app for the screensaver, the current cover will be displayed during sleep.

I should add that both apps check to see if the current book has changed before they do anything. If there is no change, they simply stop.

As these are Tasker-generated apps (but don't require Tasker to run), they have a dependency on two small library files. If you don't have one of my other Tasker apps already, you need to copy the two files in the zip as below:

/system/etc/permissions/com.google.android.maps.xml
/system/framework/com.google.android.maps.jar

Set permissions for both files to rw-r--r-- and reboot. Without these files resident, the app will not install.

The apps also use sqlite3 and busybox. If you rooted with NookManager you already have busybox. A few other special packages probably include it. If you have it, you will find it in /system/xbin. If it's not there, copy the file from the zip to that location and set permissions to rwx-rwx-rwx.

If you don't already have sqlite3, move the file from the zip to /system/bin and set the permissions to rwx r-x r-x.

When you have prepared the way, reboot and then install whichever of the two "Extras" apps you want. When you first tap on the app icon there will be a pause while things are set up and then a request for root access. Once that's done they are good to go. Use NTMM to assign the app to the "reading now" status bar button and set your screensaver directory to "CurrentBookCover" (if you installed Mantano_Extras2).
 

Attachments

  • User Guide.pdf
    877.1 KB · Views: 4
  • framework-update.zip
    3 MB · Views: 0
  • Mantano_Extras1.zip
    1.5 MB · Views: 0
  • Mantano Extras2.zip
    1.5 MB · Views: 0
  • Mantano_Reader_2.2.3.apk
    7.7 MB · Views: 3
Last edited:

SJT75

Senior Member
Sep 19, 2020
138
8
Belgrade
This is nice work. I have heard good thing about Mantano reader before. I believe it still exists although under new name I think. Its sad that you had to remove app options to make it work on NST. Still I am glad that you make some improvement that could if exploited properly make this device better than before. I believe that solving invisible text message is best of what you did and if understood properly can make number of apps that had this problem before usable again for this device. I would not dismiss even TTS working as I remember that someone tried to implement that on NST before yet I do not remember it was solved. So if it work out of box with Mantano reader it might be prudent to see what makes it work if it is fine TTS not some hardly intelligible sound generator. This options you removed how did you confirmed that they are not working? For cloud I believe it was NST lockout and now enforced TLS1.2 it can not reach that gives you hard time. Yet for syncing it is little harder to understand. For the rest like OPDS and such I guess my knowledge is not sufficient to guess how that even work so if you know more than me I am more than ready to listen.
 

nmyshkin

Recognized Contributor
Nov 21, 2013
1,495
437
I believe it still exists although under new name I think.
Now Bookari.
Its sad that you had to remove app options to make it work on NST.
I didn't so much remove options to make it work. It worked as-is, but not the login/download components, and they are not necessary for the reading functions.
I believe that solving invisible text message is best of what you did and if understood properly can make number of apps that had this problem before usable again for this device
It's possible. I noticed improvement in dialog boxes for ES File Explorer. But there are other types of dialog boxes and I only dealt with what was needed for this app. Spillover is a gift.
I would not dismiss even TTS working as I remember that someone tried to implement that on NST before yet I do not remember it was solved. So if it work out of box with Mantano reader it might be prudent to see what makes it work if it is fine TTS not some hardly intelligible sound generator.
Well, that could have been me. Pico TTS (if not removed) always worked on the NST if you downloaded some voices. I have a post about this somewhere with links. But the quality is really wretched. I looked at this further awhile back and found that Google TTS began with Android 2.2 (of course). There is a "bridge" system involving a custom settings app but each application must include this custom code to work. I did a MOD for AlReader to enable this, but it's not easy and would be (nearly) impossible for Mantano as very few of the smali files have descriptive names. Most are just "a.smali, b.smali", etc. So it's really difficult to track down what you want.
This options you removed how did you confirmed that they are not working? For cloud I believe it was NST lockout and now enforced TLS1.2 it can not reach that gives you hard time. Yet for syncing it is little harder to understand. For the rest like OPDS and such I guess my knowledge is not sufficient to guess how that even work so if you know more than me I am more than ready to listen.
It's not all SSL. Or it may be that also. The URLs in the apk file don't go anywhere, even on my PC browser. So far I've gotten up to version 4.5 and still no working URLs. Perhaps when Bookari emerged as the name the old URLs were abandoned and the old Mantano apps became crippled in this way.
 
Last edited:

SJT75

Senior Member
Sep 19, 2020
138
8
Belgrade
Thanks nmyshkin you clarified some things. I agree that change to new platform and abandoning the URL domain for cloud use could be cause for that option not functioning anymore. Yet unless the syncing have not be performed through a same route (login account on the same domain) sync should function fine from one device to another for example. About the rest you are correct I have come to a same conclusion that even slight upgrade of Android on this device would make vast improvement in options available to exploit. Sadly B&N did not go that way. I will look upon PicoTTS to see if something about the way it actually work can be understood to evaluate if it is worth the effort or it maybe can be discarded as irrelevant for this device.
 

SJT75

Senior Member
Sep 19, 2020
138
8
Belgrade
Just crossed my mind... nmyshkin did you tried to hunt down inside apk file exact spot where that URL is written/coded and change it to something else like IP address of your computer/drive/*/*/sync folder ?
 

nmyshkin

Recognized Contributor
Nov 21, 2013
1,495
437
Just crossed my mind... nmyshkin did you tried to hunt down inside apk file exact spot where that URL is written/coded and change it to something else like IP address of your computer/drive/*/*/sync folder ?
No, it didn't occur to me. I only read on one device so that's not the kind of thing that interests me. Also, I just transfer books over from my PC to the Nook when I get them, usually via FTP.

I did see cloud, sync, etc., URLs but I suspect that just changing them would not produce the capability you seem to be hinting at. It's likely a lot more complicated than that. It seems to me that syncing implies active communications from both ends. Teaching your PC to respond to the overtures of the Nook would be a whole other rats nest.
 

SJT75

Senior Member
Sep 19, 2020
138
8
Belgrade
You are correct. Using URLs to connect to PC is not safe. Therefore some home workgroup network or SFTP access are more reasonable way. Maybe if you change cloud sink URL to Dropbox folder you get something?
 

nmyshkin

Recognized Contributor
Nov 21, 2013
1,495
437
You are correct. Using URLs to connect to PC is not safe. Therefore some home workgroup network or SFTP access are more reasonable way. Maybe if you change cloud sink URL to Dropbox folder you get something?
I don't think so. The app innards were designed for negotiating with certain remote servers and expect a certain dialog. Just changing the URL doesn't address these issues. Using Dropbox as an example, there are login credentials to be supplied and other issues to be addressed before files can be freely moved in either direction.
 

SJT75

Senior Member
Sep 19, 2020
138
8
Belgrade
Well yes unless dropbox folder is public shared one what I wrote will not work. What if you link sync/cloud to internal folders on device inside Dropbox application that also initiate script written to execute Dropbox synchronization? Then login credentials would come from Dropbox app I think.
 

nmyshkin

Recognized Contributor
Nov 21, 2013
1,495
437
Well yes unless dropbox folder is public shared one what I wrote will not work. What if you link sync/cloud to internal folders on device inside Dropbox application that also initiate script written to execute Dropbox synchronization? Then login credentials would come from Dropbox app I think.
1. I am not a Java programmer. What you are suggesting is going to require significant changes in the app. It's not in the same league as the modifications I made.
2. I have no interest in the feature. People who must have synchronization with myriad other devices would be better served by selecting an app that currently has this feature working (like FB Reader).
3. If someone who is a Java programmer and is interested in this feature wants to take a crack at it, more power to them. I personally think it's a dead end. Just about the time you get it figured out, Dropbox will no longer work on the NST. Any modification that relies on exchange with an external commercial server has a built-in self-destruct timer, just waiting for tightening external server access rules. It's over for Android 2.1.
 

SJT75

Senior Member
Sep 19, 2020
138
8
Belgrade
Just about the time you get it figured out, Dropbox will no longer work on the NST. Any modification that relies on exchange with an external commercial server has a built-in self-destruct timer, just waiting for tightening external server access rules. It's over for Android 2.1.
Amen to that. Making NST more cooperative with Calibre is much better option anyway. Commercial server could be also a trap. There was an outcry when Remarkable for example started charging access to their services out of blue and without warning.