MANUAL DATA PATCH: put OmniSD or any other app on the data partition

by Speeduploop and Vivek

Unfortunately not all KaiOS devices have the same possibilities. To help users better understand which installation method is more suitable for their device, we have classified KaiOS devices based on two difficulty levels: Debug-enabled and locked.

  • Debug-enabled, for these devices it is sufficient to type one or two codes to enable USB debugging (Nokia phones, Energizer, Positivo, etc...), you can apply the natural sideload methods and the official jailbreak guide for these devices without any problem;

  • Locked devices have no working codes because blocked by the OEM by default. All devices with a relative loader can be used to flash in EDL mode a data partition image (CAT B35 and Jio Phone first of all).

If your device is locked and without working codes or ADB and DevTools access, this method is for you.

If all you want, however, is just to install OmniSD, or any other app directly, bypassing the guide you just read, here is the solution. The procedure seems very simple at first glance, but in reality it requires a lot of attention as we will practically take the place of a direct installation, as the settings need to be precise.

Before starting

Using EDL.PY for your device (for example your-firehose-x0000b.mbn) you must know how to:

  • First get the partition table layout with -printgpt option:

python3 edl.py -loader your-firehose-x0000b.mbn -printgpt

  • Backup any partition from the device with -r [partname] [filename] option. For instance (in our case we need to work on "userdata"):

python3 edl.py -loader your-firehose-x0000b.mbn -r recovery userdata.img

  • To erase the partition, supply the -e [partname] option:

python3 edl.py -loader your-firehose-x0000b.mbn -e userdata

  • To flash the new partition image, supply the -w [partname] [filename] option:

python3 edl.py -loader your-firehose-x0000b.mbn -w userdata userdata.img

Requirements

Jio Phone users can find ready-made userdata.img files on the Internet. This procedure can also be used to add other applications, other than OmniSD.

Proceedings

  1. Extract omnijb-4data-patch.zip and put the omnisd.831337.xyz folder in /data/local/webapps;

  2. Edit the webapps.json file and add the content of the decl.patch file, checking that the format is valid, for example using this website https://jsonlint.com ;

  3. Use DB Browser for SQLite to change the permissions in /data/local/permissions.sqlite, with the right permissions;

  4. In the tab Browse Data select moz_perms:

As you can see there are several lines that represent the permissions of the apps themselves;

5. you have to add five lines:

  • First column: "origin", we must write "app://omnisd.831337.xyz^appId=LOCALID" for all the lines. Replace "LOCALID" with the value following the previous application and do the same in webapps.json (in this example the number is 1048);

  • Second column: "type", we must be sure to enter the correct parameters (for OmniSD are indexDB, device-storage:apps:read, device-storage:sdcard:read, webapps-manage and power). Every name says what is the related function of the app;

  • Third column: "permission", enable the permissions by adding 1;

  • Fourth and Fifth columns: "expireType" and "expireTime", enter the number zero for both;

  • Sixth column: "modificationTime", set an increasing time, even of few digits, as in the example.

---------------------------------------------------------

---------------------------------------------------------

WARNING! Make sure that "localId" in webapps.json and LOCALID in "origin" match, and also installTime and updateTime must match precisely the first and last lines. This applies to any application you are going to install manually!

6. Save the file and flash the userdata.img file, now the app is working with the right permissions... even if some updates preventing the app to work as it should.

Re-flash the data partition

Our custom data partition is ready to make the app sideload. Using EDL.PY and the loader for your device (for example your-firehose-x0000b.mbn):

  • To erase the partition, supply the -e [partname] option:

python3 edl.py -loader your-firehose-x0000b.mbn -e userdata

  • To flash a new partition image, supply the -w [partname] [filename] option:

python3 edl.py -loader your-firehose-x0000b.mbn -w userdata userdata.img

Privileged Factory Reset

The "Developer" menu is still hidden, then we have to perform a Privileged Factory Reset. This guide took OmniSD as an example, but you can also install Wallace or Wallace Toolbox for this in the same way. FTPD and ADBRoot can also be useful for inserting the necessary files, such as the public key that I mentioned in the guide to enable the development tools.

From the first start we will have the "Developer" menu accessible from the settings. Now we're really ready to install any third party app thanks to permissions.