View Single Post
Old 03-23-2012, 05:50 PM   #204
ah-
Connoisseur
ah- could sell banana peel slippers to a Deveel.ah- could sell banana peel slippers to a Deveel.ah- could sell banana peel slippers to a Deveel.ah- could sell banana peel slippers to a Deveel.ah- could sell banana peel slippers to a Deveel.ah- could sell banana peel slippers to a Deveel.ah- could sell banana peel slippers to a Deveel.ah- could sell banana peel slippers to a Deveel.ah- could sell banana peel slippers to a Deveel.ah- could sell banana peel slippers to a Deveel.ah- could sell banana peel slippers to a Deveel.
 
Posts: 64
Karma: 3062
Join Date: Jan 2012
Device: Kobo Touch
Quote:
Originally Posted by RoninTech View Post
Isn't there a version field in the ini file that would let you use it with 1.9.16?

Here you go:
Either this or just install the last version from before the update. Nothing really changed since then.

Quote:
Out of curiosity, how does it get loaded? I am familiar with embedded Linux development so get technical on me if that helps.

The plugin just seems to overwrite a shared library with one that has the tweaks, and which requires the Library setting to be selected to activate them. Rather than this, could you not also provide some extra logic in the boot script (/etc/init.d/rcS) or a script called at the end of the boot script to check to see if the plug-in is set to autostart, and if so backup and then overwrite the stock shared library with a tweaked shared library that doesn't require the library button being pressed?
There's no stock libtweaks.so, it doesn't overwrite any original files.

The main Kobo UI is called nickel, and is implemented with Qt embedded. It's basically one large, mostly monolithic C++ application. Nickel supports plugins for new filetypes, and usually a nickel plugin provides functionality to parse files and display them. This is for example used by the pdf viewer.
For this, each plugin provides a list of mimetypes that it can handle. When nickel needs to open a file for the first time, it looks for plugins (just shared libraries), loads them and calls the function to get the list of mimetypes. This is how the tweaks plugin is loaded at the moment. For even more details, look at the sourcecode at https://github.com/ah-/koboplugins/

It would be no problem to execute some random binary (installing a ssh server is pretty trivial), the problem is to execute code inside nickel.

Another option of getting code to run in nickel would be to fake a Qt plugin (http://qt-project.org/doc/qt-4.8/plugins-howto.html), as they are loaded earlier and require no user interaction. But I haven't looked into that yet. That would also require some code to detect when nickel is fully started, since at the moment I assume that when the plugin is loaded everything is already there and I can start patching things, but during startup that's not the case. This is also probably the reason why the plugin doesn't work with SD cards (just a theory, haven't tested that yet): With an SD card inserted, nickel wants to look at the files on the SD card during startup, and therefore loads the plugin earlier than without an SD card, the plugin doesn't find the stuff it wants to patch as it wasn't loaded yet and does nothing. Also note that nickel loads plugins only once, so since the plugin didn't fully load during startup it also doesn't work if one opens the library later.

Last edited by ah-; 03-23-2012 at 05:58 PM.
ah- is offline   Reply With Quote