Thread: Kobo Installer
View Single Post
Old 04-26-2014, 12:28 PM   #1
Lucas Malor
Pain in the arse
Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.
 
Lucas Malor's Avatar
 
Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
Kobo Installer

I created a simple tool to install patches for Kobo. I get this idea from yoq.

Advantages:
  1. Really simple to use, no sed or regular expressions
  2. Safe: code is robust and "infinite reboots" are prevented
  3. You can easily patch files, that is better than overwrite them:
    • firmware upgrades can't be messed up
    • patches done by other users are not removed
  4. you can do single or multiline patches
  5. auto-backup of patched files
  6. Patches survive after firmware update (but not hard-resets), so you don't need to reinstall your modifications after a firmware upgrade

The Installer has also an optional and rudimentary package manager: it prevents installation of older Kobo modifications if a newer version is already installed. Read here for further informations.

If you want to use it for your mod, you've simply to:
  1. suggest users to install the Kobo Installer, or merge the content of this package with the source code of your project
  2. add to your project a /installer.d/ folder and write a script into it. The script must be an ".sh" or a ".py" script. This script will be invoked every time at boot. You can invoke kobo_patch.py from this script. Usage:

    PHP Code:
     kobo_patch.py append PROGNAME FILEPATH CODE
     kobo_patch
    .py add-after PROGNAME FILEPATH SEARCH_STRING CODE
     kobo_patch
    .py add-before PROGNAME FILEPATH SEARCH_STRING CODE 
    "append" action appends CODE at the end of FILEPATH.

    With "add-after" and "add-before", CODE is added after or before SEARCH_STRING in FILEPATH.

    FILEPATH will be backed up to FILEPATH_before_PROGNAME before any change will be applied. No patch will be performed if FILEPATH is already patched.
    If, and only if, kobo_patch.py will succesfully patch at least one file, system will be rebooted.
    IMPORTANT NOTE: failed scripts are removed from the device, so get a copy.

The package contains also Python 3 interpreter and some of its modules. Here is the entire py3 Standard Library, pyc compiled.
Attached Files
File Type: zip KoboInstaller_3.0.0.zip (3.48 MB, 769 views)

Last edited by Lucas Malor; 09-22-2014 at 04:03 AM.
Lucas Malor is offline   Reply With Quote