YOUR CUSTOM ROM

(safe method)

Would you like to customize your stock ROM without loosing OTA updates?

This guide is for you! Waiting for future improvements, we can customize our ROM by editing the /data/local/webapps folder and the /data/local/permissions.sqlite file more securely.

In case of problems select "Wipe data / Factory reset" from Recovery to restore all factory settings.

In the past, to change the default configuration, we had to change the system ROM, which compromised the new updates and improvements made possible by the official software development of KaiOS. Working on the data partition allows you to make these changes temporary. Upon arrival of a new update, all our customizations will be deleted again, so it is important to know how to move in the event of future changes.

How to create your ROM on the phone


by AdvancedHACKERniV1

Add, edit and configure the stock apps

We can copy the pre-installed applications from the system ROM and modify them as we prefer, then reinsert them in the data partition and set the webapps.json file in order to recognize the path that we will attribute to our customized stock app. This could be compatible with many different models of KaiOS devices, regardless of the form factor and the firmware's version.

1. Get a temporary root access on your phone, then get a copy of the webapps folders of both /system and /data:

adb pull /system/b2g/webapps webapps-system
adb pull /data/local/webapps

in this way the system's version will be saved as "webapps-system" and we can work on the version of the data partition without troubles.

2. Copy the system folders that you want to customize to the "webapps" one and start customizing it as you want. For example, here are listed other improvements on this section:

At the webapp level you can make any changes you want.

3. Edit the webapps.json file and change the "basePath" value of the applications that you want to modify

  • "basePath": "/system/b2g/webapps",

in this way

  • "basePath": "/data/local/webapps",

Use the JSONLint website to verify that the format is correct for any json file you want to modify.

4. Afther this change push the webapps folder in its place and reboot the phone:

adb push webapps /data/local/
adb reboot

After rebooting your changes will be applied. Them will be restored after a factory reset or after the future updates.

Manually add apps that are not installed

If you want to add other apps that were not installed on your phone to share a custom rom to your friends, you must edit the /data/local/permissions.sqlite file to add the permissions. An example is the manual installation guide of OmniSD.

The simplest method is to install the desired application directly on the phone, before sharing it. Otherwise we can proceed in this way:

  1. Put the app folder in /data/local/webapps;
  2. Edit the webapps.json file and add the application's settings, checking that the format is valid, for example using the JSONLint website;
  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 and start adding the stings.

For more details, find out more here:


How to share your custom ROM

As we have already seen, all we have to patch are the webapps folder and the permissions.sqlite file contained in /data/local.

Extraction of the custom ROM

Using a root access we can easily extract all this into a folder called "local" with this command:

mkdir local && cd ./local && adb pull /data/local/webapps && adb pull /data/local/permissions.sqlite && cd

Installation of "local" on other phones

To install it on another device simply use the command (always with root access):

adb push local /data/
adb reboot

WARNING: this procedure is safe and should work on all KaiOS devices that have access to debugging and root, in case of problems it is sufficient to perform a factory reset to solve everything.

it might also interest you...